简体   繁体   中英

I want to install certain set of files based on OS version and another set of files based on another OS version using wix file

I need to install one set of files based on OS version and another set if some other OS is there,I have written a condition also but that condition doesn't work properly .

<Component Id="actionBin_Win7"  Guid="6b73cbe1-4017-48d7-9cdc-784517b2d7a9" DiskId="1">
  <Condition><![CDATA[(VersionNT >= 600)]]></Condition>
  <File Id="file30" Name="AXINTE_2.DLL" LongName="AxInterop.MSTSCLib.dll" src="$(var.agentroot)\bin\AxInterop.MSTSCLib_Win7.dll" />
  <File Id="file31" Name="ZENRDP_2.EXE" LongName="ZENRdpClient.exe" src="$(var.agentroot)\bin\ZENRdpClient_Win7.exe" />
  <File Id="file32" Name="INTERO_2.DLL" LongName="Interop.MSTSCLib.dll" src="$(var.agentroot)\bin\Interop.MSTSCLib_Win7.dll" />
</Component>
<Component Id="actionBin"  Guid="7388F2C9-5CDD-49a8-80F7-7DF5829AE87E" DiskId="1">
  <Condition><![CDATA[(VersionNT < 600)]]></Condition>
  <File Id="file10" Name="AXINTE_1.DLL" LongName="AxInterop.MSTSCLib.dll" src="$(var.agentroot)\bin\AxInterop.MSTSCLib.dll" />
  <File Id="file11" Name="msrdp.ocx" LongName="msrdp.ocx" SelfRegCost="1" src="$(var.agentroot)\bin\msrdp.ocx" />
  <File Id="file12" Name="ZENRDP_1.EXE" LongName="ZENRdpClient.exe" src="$(var.agentroot)\bin\ZENRdpClient.exe" />
  <File Id="file13" Name="INTERO_1.DLL" LongName="Interop.MSTSCLib.dll" src="$(var.agentroot)\bin\Interop.MSTSCLib.dll" />
  <File Id="file14" Name="shortcut.vbs" LongName="shortcut.vbs" src="$(var.agentroot)\bin\shortcut.vbs" />
</Component>

Feature :

<Feature Id="AllComponents" Title="AllComponents" Level="1">
  <ComponentRef Id="actionBin" />
  <ComponentRef Id="actionBin_Win7" />
</Feature>

Any idea what is going wrong here? Even when OS is windows 7, MSI takes files which I intend for WinXP...

Thanks in advance.

As far as i know about WIX, CDATA is used of ASCII comparison and not for integer comparison.

You can use custom action to compare OS version and then assign true or false value to some session variable and then you can use that session variable in wxs file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM