Click here to Skip to main content
15,892,537 members
Articles / Programming Languages / C++/CLI
Article

Enhanced .NET Bootstrap Setup

Rate me:
Please Sign up or sign in to vote.
4.89/5 (61 votes)
24 Nov 20053 min read 730.9K   7.2K   134   303
Modified Microsoft Setup program to install required IE6, MSI 2.0 and .NET.

Sample Image - DotNetSetup.gif

Introduction

In looking to install my .NET program on a Windows 98 or ME platform and even the newer XP and 2000 versions, I ran into several difficulties. There are several requirements to running a .NET program. The first is that the .NET framework needs to be installed prior to installing your program. The second problem is that one of the requirements for a .NET program is that IE 5.01 be installed. Windows 98 comes with IE 4.01 and Windows 98 SE comes with 5.0. And all installer files created by VS use the newer Microsoft Installer (version 2.0). I found the Microsoft setup program to be useful but not enough. So I set out to update the program. Little did I know that I had to dredge up my old Win API skills.

What you need to know

Note: This program was compiled with VS 2003 so the solution file may not work with older versions. I believe that the project will open in older versions as I was asked to convert the solution and not the project.

In order to use this program, you just have to update the settings.ini file.

Settings

The settings are:

  • MSI: Use this to point to your installer file.
  • ProductName: Use this to name your product.
  • FxInstallerPath: This is the path to the .NET installer. It looks for a file named Dotnetfx.exe.
  • IEInstallerPath: This is the path for IE 6.01. It looks for ie6setup.exe.
  • MSIInstallerPath: This is the path for MSI 2.0 (Microsoft's new installer). It looks for two files that you can download from Microsoft's site, InstMsiW.exe and InstMsiA.exe. These are for different versions of Windows.
  • MDACInstallerPath: This is the path for MDAC 2.7 (Microsoft Data Access). It looks for MDAC_TYP.EXE.
  • MDACVersion: 2.7 is the default.
  • .NetVersion: This can be v1.0 or v1.1.
  • MSDEInstallerPath: This is the path to the MSDE installer (Microsoft SQL Server Desktop Engine). It looks for a file named setup.exe.
  • MSDEParams: /settings <settings.ini file> SAPWD="strongpassword" - Note that a strong password is required.

All of the files above were downloaded from Microsoft's site so I won't include them. Note that I had to extract the MSDE files to a folder. Those files contained the setup files which are needed for the installer. The parameters are very important as the setup.exe program will not run without them. It is designed to be a silent application. The password is required but the settings file is not.

Place all of your files in a folder under this version of setup.exe and the settings.ini file. If any of the components above need installing, the dialog shown above will show up, otherwise your installer will run.

The source code is included if you need to make modifications.

Changes from Microsoft's version of bootstrapper:

  1. New dialog that shows what will be installed.
  2. New entries in the settings.ini file for IE 6, MSI, MDAC, & MSDE.
  3. New code for reading those entries.
  4. Code for displaying the dialog box and launching the new programs.

New Features

  1. Added MSDE support. This was added after a user request. It has not been fully tested.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: w2k updates Pin
Anonymous18-Jun-03 5:31
Anonymous18-Jun-03 5:31 
Question90 Megs Sources? Pin
Tomaž Štih11-Jun-03 3:21
Tomaž Štih11-Jun-03 3:21 
AnswerRe: 90 Megs Sources? Pin
Michael P Butler11-Jun-03 3:30
Michael P Butler11-Jun-03 3:30 
AnswerRe: 90 Megs Sources? Pin
dog_spawn14-Jun-03 7:43
dog_spawn14-Jun-03 7:43 
GeneralMDAC 2.6 Pin
jadeboy11-Jun-03 3:19
jadeboy11-Jun-03 3:19 
GeneralRe: MDAC 2.6 Pin
mikasa12-Jun-03 5:40
mikasa12-Jun-03 5:40 
GeneralRe: MDAC 2.6 Pin
jadeboy12-Jun-03 10:29
jadeboy12-Jun-03 10:29 
GeneralRe: MDAC 2.6 Pin
mikasa12-Jun-03 10:59
mikasa12-Jun-03 10:59 
I'm thinking the dowload thing would be a bit more complicated...but it is possible. Probably the easiest way would be to use a Custom Action .NET DLL and use the managed System.Net classes to download MDAC from a URL. I used MDAC as a merge module in the InstallShield project, so the script will not contain references to that.

First off, to understand how I installed the .NET Framework, I did not distribute the whole 20MB EXE that MS has available as a download (although you can do that, just modify the Script). Instead, I ran that EXE with the Command Line Params to just extract the MSI & CAB files that were neccessary for the .NET Framework. And YES, the Framework does contain the Windows Installer setup...that's what I wanted to eliminate (since InstallShield does that for you).

Also take note that the Install functions for MSDE and the SQL Client Tolls NEVER really worked! Apparently the "unattended" script files for the Tools setup doesn't work, and for somereason the command line for the MSDE didn't work...but if you placed the EXACT same command lines in a Batch file...it became magically delicious and worked!

Below is the Script for the "Setup.rul" file. Please keep in mind that you cannot create separate ".rul" files in IS7 (without a huge amount of work). So just overwrite your Setup.rul file with this one.

/////////////////////////////////////////////////////////////////////////////
//                                                                            
//  File Name:    Setup.rul                                                   
//                                                                            
//  Description:  InstallShield script                                          
//                                                                            
//  Comments:     This minimal project is intended for advanced users. 
//                To create a robust project with step-by-step 
//				  instructions, use the Project Wizard. 
//                                                                                                               
/////////////////////////////////////////////////////////////////////////////

//Header Files
#include "ifx.h"
#include "isrt.h"

// Function Prototypes
prototype BOOL InstallDotNET();
//prototype BOOL InstallDotNetSP2();
//prototype BOOL InstallDotNET_ODBCProvider();
prototype InstallMSDE(BOOL);
prototype InstallSQLTools();
prototype BOOL IsSQLServerInstalled(BYREF STRING, BYREF BOOL);
prototype BOOL IsSQLServerRunning();
prototype STRING FormatNum(number);
prototype STRING FormatBool(BOOL);

//Variables
BOOL bReboot;

///////////////////////////////////////////////////////////////////////////////
//                                                                           
//  FUNCTION:   OnFirstUIBefore                                            
//                                                                           
//  EVENT:      FirstUIBefore event is sent when installation is run for the first
//              time on given machine. In the handler installation usually displays
//              UI allowing end user to specify installation parameters. After this
//              function returns, ComponentTransferData is called to perform file
//              transfer.
//                                                                           
///////////////////////////////////////////////////////////////////////////////
function OnFirstUIBefore()
	STRING sSQLType, sResult;
    number nResult, nvResult, nvSize, nUser;
    STRING szTitle, szMsg, szQuestion, svName, svCompany, szFile;
    STRING szLicenseFile;
    LIST listStartCopy;
    BOOL bCustom, bInstallMSDE, bInstallSQLTools, bIsSQLInstalled, bNeedsUpgrade;
begin	
    // TO DO: if you want to enable background, window title, and caption bar title                                                                   
    // SetTitle( @PRODUCT_NAME, 24, WHITE );                                        
    // SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION ); 	                  
    // Enable( FULLWINDOWMODE );						   
    // Enable( BACKGROUND );							  
    // SetColor(BACKGROUND,RGB (0, 128, 128));					   

    SHELL_OBJECT_FOLDER = @PRODUCT_NAME;	
	
Dlg_SdWelcome:
    szTitle = "";
    szMsg   = "";
    nResult = SdWelcome(szTitle, szMsg);
    if (nResult = BACK) goto Dlg_SdWelcome;
	
Dlg_SdFeatureTree: 
	szTitle   = "";
    szMsg      = "";
    nResult = SdFeatureTree(szTitle, szMsg, INSTALLDIR, "", 1);
    if (nResult = BACK) goto Dlg_SdWelcome;
    
    /*
    nResult = FeatureGetData(MEDIA, "MSDE2000Feature", FEATURE_FIELD_SELECTED, nvResult, sResult);
    bInstallMSDE = (nvResult = 1);
    MessageBox("Install MSDE: " + FormatBool(bInstallMSDE), MB_OK);
    
    nResult = FeatureGetData(MEDIA, "Tools", FEATURE_FIELD_SELECTED, nvResult, sResult);
    bInstallSQLTools = (nvResult = 1);
	MessageBox("Install Tools: " + FormatBool(bInstallSQLTools), MB_OK);
	*/
	
Dlg_SdAskDestPath:    	
    nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
    if (nResult = BACK) goto Dlg_SdFeatureTree;
    
Dlg_SdStartCopy:
    szTitle = "";
    szMsg   = "";
    listStartCopy = ListCreate(STRINGLIST);
    //The following is an example of how to add a string(svName) to a list(listStartCopy).
    //eg. ListAddString(listStartCopy,svName,AFTER);
    nResult = SdStartCopy(szTitle, szMsg, listStartCopy);    
    ListDestroy(listStartCopy);
    if (nResult = BACK) goto Dlg_SdAskDestPath;    

    Enable(STATUSEX);
 	//SetStatusWindow(0, "Installing the .NET Framework");
    if (!InstallDotNET()) then	//Install .NET Framework
    	abort;
    //else
    	//InstallDotNetSP2();
    endif;
    /*if (!InstallDotNET_ODBCProvider()) then	//Install the .NET ODBC Provider
    	abort;
    endif;*/
    
    if (bInstallMSDE) then
    	MessageBox("Attempting to Install MSDE", MB_OK);
    	
	    // Determine if SQL Server is Installed
	 	bIsSQLInstalled = IsSQLServerInstalled(sSQLType, bNeedsUpgrade);	// Determine if SQL is Installed or needs an Upgrade
	 	MessageBox("SQL Installed?: " + FormatBool(bIsSQLInstalled), MB_OK);
	 	MessageBox("SQL Type: " + sSQLType, MB_OK);
	 	MessageBox("Need Upgrade?: " + FormatBool(bNeedsUpgrade), MB_OK);
	 	
	 	if (!bIsSQLInstalled) then
	 		//Install MSDE
	 		MessageBox("Installing MSDE", MB_OK);
	 		InstallMSDE(FALSE);
	 	elseif ((sSQLType = "MSDE") && (bNeedsUpgrade)) then
	 		//Upgrade MSDE to SP3
	 		MessageBox("Upgrading MSDE", MB_OK);
	 		InstallMSDE(TRUE);
	 	elseif ((sSQLType = "Standard") && (bNeedsUpgrade)) then
	 		//Upgrade all other editions of SQL Server to SP3
	 		MessageBox("SQL Server SP3a needs to be Installed!", MB_OK);
	 	endif;
 	endif;
 	
 	if (bInstallSQLTools) then
 		MessageBox("Installing SQL Tools", MB_OK);
 		InstallSQLTools();
 	endif;
 	
 	/*
 	if (IsSQLServerRunning()) then
 		MessageBox("SQL Server Service is Started.", MB_OK);
 	else
 		MessageBox("SQL Server Service is not Started.", MB_OK);
 	endif;
 	*/
 	
 	//IsSQLServerRunning();//Determine if SQL Server is Running
 	
 	// setup default status
 	//SetStatusWindow(0, "");
    Enable(STATUSEX);
    return 0;
end;


///////////////////////////////////////////////////////////////////////////////
//
//  FUNCTION:   OnFirstUIAfter
//
//  EVENT:      FirstUIAfter event is sent after file transfer, when installation 
//              is run for the first time on given machine. In this event handler 
//              installation usually displays UI that will inform end user that
//              installation has been completed successfully.
//
///////////////////////////////////////////////////////////////////////////////
function OnFirstUIAfter()
	STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
	number bOpt1, bOpt2;
begin
	Disable(STATUSEX);

	bOpt1  = FALSE;
	bOpt2  = FALSE;
	szMsg1 = SdLoadString(IFX_SDFINISH_MSG1);
	//SdFinishEx(szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2);
	//SdFinishReboot("","",1,"",0);
	RebootDialog("", "", SYS_BOOTMACHINE);
end;
///////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////
//Function to Install .NET
function BOOL InstallDotNET()
	STRING sKey, sValue, sResult;
	BOOL bExists, bInstall;
	number nResult, nSize, nType;
	
begin
	
	//Determine if the .NET Framework is Installed
	bInstall = FALSE;
	RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
	
	sKey = "Software\\Microsoft\\.NETFramework\\policy\\v1.1";
	if (RegDBKeyExist(sKey) >= 0) then
		return TRUE;
	else
		bInstall = TRUE;	//Framework needs Installed
	endif;
	
	/*		
	sKey = "Software\\Microsoft\\.NETFramework\\policy\\v1.0";
	if (RegDBKeyExist(sKey) < 0) then
		bInstall = TRUE;	//Framework needs Installed
	else
		// Determine if the Framework needs upgraded
		nType = REGDB_NUMBER;
		sValue = "3705";
		nResult = RegDBGetKeyValueEx(sKey, sValue, nType, sResult, nSize);
		if (sResult != "3321-3705") then
			MessageBox(".NET is wrong version, Installing.", MB_OK);
			bInstall = TRUE;
		endif;
	endif;
	*/
		
	if (bInstall) then
		//Determine if the Path to the Framework Exists
		//if (Is(FILE_EXISTS, SRCDIR + "DotNetFramework\\NetFX_1.0.msi") = 0) then
		MessageBox(SRCDIR + "DotNetFramework\\NetFX_1.1.msi", MB_OK);
		if (Is(FILE_EXISTS, SRCDIR + "DotNetFramework\\NetFX_1.1.msi") = 0) then
			MessageBox("The Path to the .NET Framework Setup cannot be found.", MB_OK | SEVERE);
			return FALSE;
		endif;
		
		// Install the .NET Framework
		SdShowMsg("Installing .NET Framework v1.1", TRUE);
		nResult = LaunchAppAndWait("MSIEXEC", "/i \"" + SRCDIR + "DotNetFramework\\NetFX_1.1.msi\" /qn REBOOT=ReallySuppress", WAIT);
		SdShowMsg("", FALSE);
		if (nResult < 0) then
			MessageBox("The Installation of the .NET Framework failed.", MB_OK | SEVERE);
			return FALSE;
		endif;
		
		/*
		SdShowMsg("Installing .NET Framework 1.1", TRUE);
		SetStatusWindow(5, "Installing the .NET Framework 1.1");
		nResult = LaunchAppAndWait("MSIEXEC", "/i \"" + SRCDIR + "DotNetFramework\\NetFX_1.1.msi\" /qn", WAIT);
		SdShowMsg("", FALSE);
		if (nResult < 0) then
			MessageBox("The Installation of the .NET Framework failed.", MB_OK | SEVERE);
			return FALSE;
		endif;
		*/
	endif;
	
	return TRUE;
end;
///////////////////////////////////////////////////////////////////////////////



/*
///////////////////////////////////////////////////////////////////////////////
//Function to Install the .NET Framework SP2
function BOOL InstallDotNetSP2()
	STRING sKey, sValue, sResult;
	BOOL bExists, bInstall;
	number nResult, nSize, nType;
begin

	//Determine if the .NET Framework SP2 is Installed
	bInstall = FALSE;
	RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
	sKey = "Software\\Microsoft\\Updates\\.NETFramework\\1.0\\S321884";
	if (RegDBKeyExist(sKey) < 0) then
		bInstall = TRUE;	//Framework needs Installed
	else
		// Determine if the Framework needs upgraded
		nType = REGDB_STRING;
		sValue = "Description";
		nSize=256;
		nResult = RegDBGetKeyValueEx(sKey, sValue, nType, sResult, nSize);
		if (sResult != "Microsoft .NET Framework Service Pack 2") then
			bInstall = TRUE;
		endif;
	endif;
	
	if (bInstall) then
		//Determine if the Path to the .NET Framework SP2 Exists
		if (Is(FILE_EXISTS, SRCDIR + "DotNetFramework\\NetFX_1.0_SP2.msp") = 0) then
			MessageBox("The Path to the .NET Framework SP2 Setup cannot be found.", MB_OK | SEVERE);
			return FALSE;
		endif;
		
		//Run the .NET Framework SP2 Installation
		SdShowMsg("Installing .NET Framework Service Pack 2", TRUE);
		nResult = LaunchAppAndWait("MSIEXEC",  "/p \"" + SRCDIR + "DotNetFramework\\NetFX_1.0_SP2.msp\" /qn REBOOT=ReallySuppress", WAIT);
		SdShowMsg("", FALSE);
		if (nResult < 0) then
			MessageBox("The Installation of the .NET Framework SP2 failed.", MB_OK | SEVERE);
			return FALSE;
		endif;
		
		bReboot = TRUE;
	endif;
	return TRUE;
end;
///////////////////////////////////////////////////////////////////////////////
*/


/* ///////////////////////////////////////////////////////////////////////////////
//Function to Install .NET ODBC Provider
function BOOL InstallDotNET_ODBCProvider()
	number nResult;
begin
	//Determine if the Install Path Exists
	if (Is(FILE_EXISTS, SRCDIR + "DotNetFramework\\ODBC_DataProvider.msi") = 0) then
		MessageBox("The Path to the ODBC Provider Setup cannot be found.", MB_OK | SEVERE);
		return FALSE;
	endif;
	
	//Run the .NET ODBC DataProvider Installation
	SdShowMsg("Installing .NET ODBC DataProvider", TRUE);
	nResult = LaunchAppAndWait("MSIEXEC", "/i \"" + SRCDIR + "DotNetFramework\\ODBC_DataProvider.msi\" /qn REBOOT=ReallySuppress", WAIT);
	SdShowMsg("", FALSE);
	if (nResult < 0) then
		MessageBox("The Installation of the .NET Framework failed.", MB_OK);
		return FALSE;
	endif;
	return TRUE;
end;
///////////////////////////////////////////////////////////////////////////////
*/



///////////////////////////////////////////////////////////////////////////////
//Function to Determine if SQL Server is Installed
function BOOL IsSQLServerInstalled(sType, bUpgradeNeeded)
	STRING sKey, sService, sVersion, sVersionEx, sSPLevel;
	number nResult, nType, nSize;
begin
	
	SdShowMsg("Checking for instances of SQL Server 2000", TRUE);
	RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); //Set the Root to be HKLM
	nType = REGDB_STRING;
	nSize = 256;
	sType = "";
	bUpgradeNeeded = FALSE;
	
	sKey = "Software\\Microsoft\\Microsoft SQL Server";
	if (RegDBKeyExist(sKey) < 0) then
		MessageBox("SQL Server is not Installed.", MB_OK);
		return FALSE;
	endif;
	
	/* // Determine if this is an older version (7.0)
	sKey = "Software\\Microsoft\\Microsoft SQL Server\\70";
	if (RegDBKeyExist(sKey) >= 0) then
		MessageBox("SQL Server 7.0 is Installed.  Needs Upgraded", MB_OK);
		bUpgradeNeeded = TRUE;
		return TRUE;
	endif; */
	
	// Determine if this is an older version of 2000
	sKey = "Software\\Microsoft\\Microsoft SQL Server\\80";
	if (RegDBKeyExist(sKey) < 0) then
		MessageBox("SQL Server 2000 is not Installed.", MB_OK);
		return FALSE;
	endif;
	
	//Determine the Current Version
	sKey = "Software\\Microsoft\\Microsoft SQL Server\\80\\Tools\\ClientSetup\\CurrentVersion";
	if (RegDBKeyExist(sKey) >= 0) then
		nResult = RegDBGetKeyValueEx(sKey, "CurrentVersion", nType, sVersion, nSize);
		
		//Determine if this is MSDE
		nResult = RegDBGetKeyValueEx(sKey, "CSDVersion", nType, sVersionEx, nSize);
		if (nResult < 0) then
			//Could not find Key here, so this is either Developer, Personal, or Enterprise
			sType = "Standard";
		else
			//since this contains the Key here, this is MSDE
			sType = "MSDE";
		endif;
	endif;
	
	//Determine the Service Pack Version
	sKey = "Software\\Microsoft\\Microsoft SQL Server\\80\\Tools\\Service Manager";
	if (RegDBKeyExist(sKey) >= 0) then
		//Determine the "Default" Service Name (in case 2 or more installed)
		nResult = RegDBGetKeyValueEx(sKey, "Default", nType, sService, nSize);
		
		sKey = "Software\\Microsoft\\MSSQLServer\\" + sService + "\\CurrentVersion";
		if (RegDBKeyExist(sKey) >= 0) then
			nResult = RegDBGetKeyValueEx(sKey, "CSDVersion", nType, sVersionEx, nSize);
		endif;
	endif;
	
	//Determine the Service Pack Level
	if (StrFind(sVersionEx, "384") >= 0) then
		sSPLevel = "Service Pack 1";
		bUpgradeNeeded = TRUE;
	elseif (StrFind(sVersionEx, "543") >= 0) then
		sSPLevel = "Service Pack 2";
		bUpgradeNeeded = TRUE;
	else
		sSPLevel = "Service Pack 3";
		bUpgradeNeeded = FALSE;
	endif;
	
	SprintfBox(MB_OK, "SQL Server Info", 
		"SQL Server Type: %s\nService Name: %s\nCurrent Version: %s\nVersion CSD: %s\nService Pack: %s", 
		sType, sService, sVersion, sVersionEx, sSPLevel);
	//SetStatusWindow(40, "Finished Checking for SQL Server...");
	SdShowMsg("", FALSE);
	return TRUE;
end;
///////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////
//Function to Determine if the SQL Server Service is Running
function BOOL IsSQLServerRunning()
	number nResult;
begin
	/*Actions:
		1 = Start
		2 = RESTART
		3 = IsRunning (Returns -1 if Stopped, 1 if Running)
		4 = Delete Service
		5 = Install Service
		6 = Stop
		7 = MODIFY
	*/
	if (Is(FILE_EXISTS, ProgramFilesFolder + "Microsoft SQL Server\\80\\Tools\\Binn\\scm.exe") = 0) then
		MessageBox("Cannot find scm.exe!", MB_OK | SEVERE);
		return FALSE;
	endif;
	
	nResult = LaunchAppAndWait(ProgramFilesFolder + "Microsoft SQL Server\\80\\Tools\\Binn\\scm.exe ", "-s -Action 1 -Service MSSQLServer -SvcStartType 2", WAIT);
	SprintfBox(MB_OK,"SQL Server", "SQLServer Running? %d", nResult);
	if (nResult = 1) then
		return TRUE;
	else
		return FALSE;
	endif;
end;
///////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////
//Function to Install MSDE
function InstallMSDE(Upgrade)
	STRING sParams;
	number nResult;
begin
	//Determine if the MSDE Folder Exists
	if (Is(FILE_EXISTS, SRCDIR + "MSDE\\Setup.exe") = 0) then
		MessageBox("The MSDE Install cannot be found.", MB_OK | SEVERE);
		return 0;
	endif;
	
	//Initialize the Parameters
	sParams = "/qn SECURITYMODE=SQL ALLOWXDBCHAINING=0";
	if (Upgrade) then 
		sParams = sParams + " UPGRADE=1";
	endif;
	
	SdShowMsg("Installing SQL Server Desktop Engine...", TRUE);
	nResult = LaunchAppAndWait(SRCDIR + "MSDE\\Setup.exe", sParams, WAIT);
	if (nResult < 0) then
		MessageBox("The Installation of the Microsoft Desktop Engine falied.", MB_OK | SEVERE);
	endif;
	SdShowMsg("", FALSE);
end;
///////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////
//Function to Install SQL Tools
function InstallSQLTools()
	STRING sParams;
	number nResult;
begin
	
	// Determine if the Path Exists
	if (Is(PATH_EXISTS, SRCDIR + "SQLServer") = 0) then
		MessageBox("The Directory containing the SQL Server Tools installation cannot be found.", MB_OK);
		return 0;
	endif;
	
	//Initialize the Params
	SdShowMsg("Installing the SQL Server Tools...", TRUE);
	sParams = "\"" + SRCDIR + "SQLServer\\SetupTools.iss\"";
	sParams = "-s -m -SMS -f1 " + sParams;
	nResult = LaunchAppAndWait("\"" + SRCDIR + "SQLServer\\X86\\Setup\\SetupSQL.exe\" ", sParams, WAIT);
	if (nResult < 0) then
		MessageBox("The Installation of the SQL Server Tools failed.", MB_OK | SEVERE);
	endif;
	SdShowMsg("",FALSE);
	
	// Determine if the Path Exists
	if (Is(PATH_EXISTS, SRCDIR + "SQLServer\\SP3") = 0) then
		MessageBox("The Directory containing the SQL Server Tools SP3 installation cannot be found.", MB_OK);
		return 0;
	endif;
	
	//Install SQL Tools SP3
	//Initialize the Params
	SdShowMsg("Installing the SQL Server Tools SP3...", TRUE);
	sParams = "\"" + SRCDIR + "SQLServer\\SetupToolsSP3.iss\"";
	sParams = "-s -m -SMS -f1 " + sParams;
	nResult = LaunchAppAndWait("\"" + SRCDIR + "SQLServer\\SP3\\X86\\Setup\\SetupSQL.exe\"", sParams, WAIT);
	if (nResult < 0) then
		MessageBox("The Installation of the SQL Server Tools SP3 failed.", MB_OK | SEVERE);
	endif;
	SdShowMsg("",FALSE);
	return nResult;
end;
///////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////
//Function to Format a Number
function STRING FormatNum(Num)
	STRING sValue;
begin
	NumToStr(sValue, Num);
	return sValue;
end;
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
//Function to Format a Boolean
function STRING FormatBool(Value)
	STRING sValue;
begin
	NumToStr(sValue, Value);
	return sValue;
end;
///////////////////////////////////////////////////////////////////////////////

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.