在安装过程中,我必须安装一个外部驱动程序,该驱动程序取决于PC的操作系统.我知道我可以为每个操作系统构建多个安装程序包,但我必须在一个安装程序中完成.那可能吗?
我的第一个问题是找出PC上存在哪个操作系统.通过以下条件?
<Condition Message="Your Operating system is ... .">
VersionNT = 500
<?define PCPlatform = "Win2000" ?>
OR VersionNT = 501
<?define PCPlatform = "XP" ?>
OR VersionNT = 600
<?define PCPlatform = "Vista" ?>
OR VersionNT = 601
<?define PCPlatform = "Win7" ?>
</Condition>
Run Code Online (Sandbox Code Playgroud)
然后如何告诉安装程序要执行哪个文件?
<Component Id="Win32_W2K" Guid="...">
<File Id="vbsetup7" Source="..\driver\32Bit\W2K\vbsetup7.exe" Name="vbsetup7.exe" KeyPath="yes" DiskId="1"/>
</Component>
<Component Id="Win32_XP" Guid="...">
<File Id="vbsetup7" Source="..\driver\32Bit\XP\vbsetup7.exe" Name="vbsetup7.exe" KeyPath="yes" DiskId="1"/>
</Component>
<Component Id="Win32_Vista" Guid="...">
<File Id="vbsetup7" Source="..\driver\32Bit\Vista\vbsetup7.exe" Name="vbsetup7.exe" KeyPath="yes" DiskId="1"/>
</Component>
<Component Id="Win32_Win7" Guid="...">
<File …Run Code Online (Sandbox Code Playgroud) wix ×1