![]()
|
InstallShield 12
To use the InstallShield MSDE 2000 Object for NT Platforms in an InstallScript MSI project, you must add code to your installation script. This is because a limitation of MSDE 2000 is that it cannot be installed as a nested .msi file; so an installation cannot run the MSDE 2000 installation from the InstallExecute sequence but must run it from the Install UI sequence, which in InstallScript MSI projects is executed by the script. You must add two new functions, one to install MSDE 2000 and the other to uninstall it, and then call them in your script, as described in the following steps.
TASK
To use the InstallShield MSDE 2000 Object for NT Platforms in an InstallScript MSI project:
prototype int Msi.MsiGetPropertyA(int, byval string, byref string, byref int);
prototype InstallMSDE();
prototype UninstallMSDE();
function InstallMSDE()
string szPropVal, svResult;
number nBuffer, nResult, nvResult;
BOOL bFeatVal;
begin
nBuffer = MAX_PATH;
bFeatVal = FeatureIsItemSelected ( MEDIA ,
"YourMSDEFeatureName" );
MsiDoAction(ISMSI_HANDLE,
"CheckInstance.DEAEC3E7_8F5C_4115_ABD3_E5742E47D469");
nResult =
Msi.MsiGetPropertyA(ISMSI_HANDLE,"INSTANCEFOUND",szPropVal,nBuffer
);
GetSystemInfo (OS, nvResult, svResult);
if ((szPropVal="")&&(bFeatVal=TRUE)) then
if (nvResult=IS_WINDOWS9X) then
MessageBox("Can't install MSDE on Windows 9X machines.
" +
"Please contact your setup provider for more
information. " +
"Setup will now exit.", WARNING);
abort;
else
MessageBox("Preparing the MSDE 2000 setup. " +
"This may take a few minutes...", INFORMATION);
nResult = MsiDoAction(ISMSI_HANDLE,
"InstallMSDE.DEAEC3E7_8F5C_4115_ABD3_E5742E47D469");
if (nResult!=0) then
MessageBox("MSDE 2000 Installation failed. " +
"Setup will now stop.", WARNING);
abort;
else
nResult = Msi.MsiGetPropertyA(ISMSI_HANDLE,
"REBOOTISMSDE2000",szPropVal,nBuffer);
if (szPropVal="") then
MsiDoAction(ISMSI_HANDLE,
"SetReboot.DEAEC3E7_8F5C_4115_ABD3_E5742E47D469");
endif;
endif;
endif;
endif;
end;
function UninstallMSDE()
string szUninstKey, svUninstVal, svRemMSDE, szProdCode;
number BufSize, nvType, nResult;
begin
nvType = REGDB_STRING;
BufSize = MAX_PATH;
nResult =
Msi.MsiGetPropertyA(ISMSI_HANDLE,"ProductCode",szProdCode,BufSize)
;
szUninstKey =
"SOFTWARE\\InstallShield\\ObjectRuntime\\ISMSDE2000\\" +
szProdCode;
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
RegDBGetKeyValueEx ( szUninstKey, "UninstallKey" , nvType,
svUninstVal , BufSize);
nResult =
Msi.MsiGetPropertyA(ISMSI_HANDLE,"REMOVEMSDE",svRemMSDE,BufSize);
if ((svRemMSDE!="")&&(svUninstVal!="")) then
MsiDoAction(ISMSI_HANDLE,
"UninstallMSDE.DEAEC3E7_8F5C_4115_ABD3_E5742E47D469");
endif;
end;
|
|
copyright contact |