Thursday, October 30, 2008

Handling Windows Operating System Version Mess



Operating System (OS) like any other software should have a version. So do new OSes from Microsoft.

Sometimes OS version is crucial for the installation software development process. Some products can work on XP and Vista, but cannot work on Windows Server 2003. MSI (Microsoft Installer) has special properties called VersionNT and WindowsBuild to ensure OS version.

Quite logically, eh?

Official documentation gives a reference table with OS versions and build numbers.

Using information from table we can define following WiX condition:

<Condition Message='This software requires the Windows Server
2003 to operate correctly'><![CDATA[VersionNT = "502"]]>
</Condition>
At the bottom of this table we can see strange thing: Vista and Windows Server 2008 have the same VersionNT and WindowsBuild numbers.

...
Windows Vista6006000Not applicable
Windows Vista Service Pack 1 (SP1)60060011
Windows Server 20086006001Not applicable
...


So, at this time to determine whether your installer runs on Windows Server 2008 you have to rely on ServicePackLevel property. It is bad, very bad - because when Microsoft will release service pack for the Server 2008 your WIX condition will not be telling truth...

Nontheless, here's how to include Windows Server 2008 launch condition into WIX script:
<Condition Message='This software requires the Windows Server
2003 or 2008 to operate correctly'><![CDATA[Installed OR (VersionNT = 502
OR VersionNT = "600" AND MsiNTProductType > 1)]]>
</Condition>

Update: In the launch condition above property MsiNTProductType was used to differentiate server from workstation

1 comment:

  1. My friend and I were recently discussing about how modern society has evolved to become so integrated with technology. Reading this post makes me think back to that debate we had, and just how inseparable from electronics we have all become.


    I don't mean this in a bad way, of course! Ethical concerns aside... I just hope that as technology further develops, the possibility of transferring our brains onto a digital medium becomes a true reality. It's a fantasy that I daydream about all the time.


    (Posted on Nintendo DS running [url=http://quizilla.teennick.com/stories/16129580/does-the-r4-or-r4i-work-with-the-new-ds]R4i[/url] DS SeKu)

    ReplyDelete