View Full Version : Conditional install

06-01-2004, 11:57 AM

I have a setup.exe that I want only to install on following serves:

Windows NT 4.0
Windows 2000
Windows 2003

I have found info on how to distinguish Server from Workstation, but here is where I am having some trouble.

Product install condition:
(VersionNT=400 And WindowsBuild>=1381 And ServicePackLevel>=6)OR(VersionNT=500 And WindowsBuild>=2195 And ServicePackLevel>=2)OR(VersionNT=502 And WindowsBuild>2600)

I tried to run it on WinNT 4.0 SP6a and I am being blocked from the installation. I guess it happened because of my condition. How do I set a condition to install the product if at least one condition is met successfully?

Thanks for your help.

06-02-2004, 07:12 AM
I can not find any errors in your condition.

Have you any problem with SP6?

SP6 and SP6a have little difference:
"Programs can detect whether Service Pack 6a is installed by checking to see if the following registry value is set to 1:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\Q246009\Installed"

Try to decrease your condition from

VersionNT=400 And WindowsBuild>=1381 And ServicePackLevel>=6


VersionNT=400 And ServicePackLevel>5
VersionNT=400 And WindowsBuild>=1381

BR, Alex

06-02-2004, 07:26 AM
Since I had unexpected results by using condition editor I have decided to go with script. MSI provides bunch of predefined functions and properties. After 15 minutes of looking, I have found that combination of MsiNTProductType, VersionNT, and ServicePackLevel properties will allow me to define exactly what I needed (with some modification to my needs [No WinNT4])
Here is the code:

STRING szServer, szVersion, szServicePack;
NUMBER nBuff, nProd, nVer, nSP;

nBuff = 255;
MsiGetProperty(ISMSI_HANDLE,"VersionNT",szVersion, nBuff);
nBuff = 255;
MsiGetProperty(ISMSI_HANDLE,"MsiNTProductType",szServer, nBuff);
nBuff = 255;
MsiGetProperty(ISMSI_HANDLE,"ServicePackLevel",szServicePack, nBuff);

StrToNum (nProd, szServer);
StrToNum (nVer, szVersion);
StrToNum (nSP, szServicePack);

// Is it DomainControler= or Server?
if (nProd<2) then
return 0;

// Must be minimum 2000 Server with SP2, otherwise do not install
if ((nVer<500) || (nVer=500 && nSP <2)) then
return 0;

// Seccesful return
return 1;


I hope this can help others as well, after seeing so many post that talk about similar issue. Also, search MSDN library for MSI properties to find out much, much, more.

Best regards,
Mariusz K.