cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Superfreak3
Level 11

Install Conditions - Server vs Workstation OSs.

Hi All,

I'm wondering what conditions I could use as Install Conditions to only allow installation on Server 2008, 2008 R2 and 2012 R2. I've used the VersionNT/VersionNT64 properties and their OS values before, but the problem is that the value and the WindowsBuild values can be the same for both the server and accompanying workstation OS. ServicePackLevel may not work either.

Is this doable?

I'm not sure if it was early versions of InstallShield or a different product I used back in the day, but I thought at one time you simply picked the OS you wanted to allow installation on via checkboxes. That would be cool, but I guess that would fall behind the times when a new OS is released - forcing the resort to generating my own condition again.

Anyway, if I can find a way to filter out workstations OSs that would be Great!

If I can't do it with Windows Installer properties I guess I would write a front end widget to set a property based on OS.

Thanks for the help in advance!!
Labels (1)
0 Kudos
(2) Replies
Superfreak3
Level 11

I found this which I'm going to use in conjunction with VersionNT...

using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
{
foreach (ManagementObject managementObject in searcher.Get())
{
// ProductType will be one of:
// 1: Workstation
// 2: Domain Controller
// 3: Server
uint productType = (uint)managementObject.GetPropertyValue("ProductType");

if (productType != 1)
{
'Set the ISSERVEROS property
}
}
}


I'll run this CA code up front then use VersionNT>=600 AND ISSERVEROS as the launch condition.

If there's an easier way with Windows Installer properties, I'm certainly up for that.
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

0 Kudos