PDA

View Full Version : how to detect the system version?



lilyjing
07-21-2006, 02:17 PM
I am using InstallShield 11.5 Express to build an installer on XP. At the first step of installation, the installer will check the systerm version to determine if it is going to install a system patch file or not. If it is XP SP1, the installer will install the patch file. If it is XP SP2, the installer will not install the patch file.

My question is : how does the installer determine the system is XP SP2 or SP1?

Thanks a lot for the help!

RobertDickau
07-21-2006, 03:00 PM
MSI defines the properties VersionNT and ServicePackLevel, the values of which might be of use in conditions. Please see, for example, this page: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/operating_system_property_values.asp.

Christopher Painter
07-21-2006, 03:02 PM
The VersionNT and ServicePackLevel properties will tell you what level you are at. However, I have to caution you on updating the operating system. I don't know what your doing exactly, but it may not even work due to Windows File Protection.

If there is a Microsoft hotfix available for what you are doing you should consider linking it into a setup.exe bootstrapper. ( I'm not sure if InstallShield 11.5 Express has this feature ). In your prereq editor you define the circumstances that indicate you need the patch ( a dll being less then a certain version or a registry value not existing ... whatever is pertinant to the patch ) and how to install it. This way you use an official MS patch to do the update and not your own install.

lilyjing
07-21-2006, 04:22 PM
Thanks for the response.

I am a beginner with the InstallShield. Does it mean that I need to get the msi file using InstallShield Express at first, and then modify the msi file using Orca?

When I go to add and use the System Search wizard in the InstallShield Express, it doesn't really present me with a good registry option to choose from.

In the registry, the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDBuild will always be unique to each service pack installed on the machine - but I can't use that in this system search wizard.

lilyjing
07-21-2006, 04:25 PM
The VersionNT and ServicePackLevel properties will tell you what level you are at. However, I have to caution you on updating the operating system. I don't know what your doing exactly, but it may not even work due to Windows File Protection.

If there is a Microsoft hotfix available for what you are doing you should consider linking it into a setup.exe bootstrapper. ( I'm not sure if InstallShield 11.5 Express has this feature ). In your prereq editor you define the circumstances that indicate you need the patch ( a dll being less then a certain version or a registry value not existing ... whatever is pertinant to the patch ) and how to install it. This way you use an official MS patch to do the update and not your own install.

Hi, Chris:

Thanks for the suggestion. I am using Microsoft hotfix to do the patch.

Regards,
lilyjing