I received WiX code which used method from discussion VersionNT MSI property on Windows 10
My Product.wxs:
<!-- begin hack - detect windows 10 -->
<!-- Check if system is windows 10: https://stackoverflow.com/questions/31932646/versionnt-msi-property-on-windows-10 -->
<Property Id="WIN10FOUND">
<DirectorySearch Id="searchSystem" Path="[SystemFolder]" Depth="0">
<FileSearch Id="searchFile" Name="advapi32.dll" MinVersion="6.3.10000.0"/>
</DirectorySearch>
</Property>
<SetProperty Action="SetIsWindow10False" Id="ISWIN10" After="FindRelatedProducts" Value="0"><![CDATA[WIN10FOUND = ""]]></SetProperty>
<SetProperty Action="SetIsWindow10True" Id="ISWIN10" After="FindRelatedProducts" Value="1"><![CDATA[WIN10FOUND <> ""]]></SetProperty>
<!-- end hack - detect windows 10 -->
<SetProperty Action="SetMyDriverPathToInstallDir" Id="MYDRRVPATH" After="FindRelatedProducts" Value=""><![CDATA[ISWIN10 <> 1]]></SetProperty>
<SetProperty Action="SetMyDriverPathToInstallDir_Win10" Id="MYDRVPATH" After="FindRelatedProducts" Value="MyDrvDriverWin10\"><![CDATA[ISWIN10 = 1]]></SetProperty>
...
<InstallExecuteSequence>
...
<Custom Action="InstallMyDriverDriver" Before="InstallFinalize"><![CDATA[(NOT Installed AND NOT REMOVE) AND VDIENV <>"1" AND NOQOS <> "1" AND ISWIN10 = 0]]></Custom>
<Custom Action="InstallMyDriverDriver10" Before="InstallFinalize"><![CDATA[(NOT Installed AND NOT REMOVE) AND VDIENV <>"1" AND NOQOS <> "1" AND ISWIN10 = 1]]></Custom>
...
</InstallExecuteSequence>
But from installer logs I see that order of these properties is inverted
MSI (s) (FC:A4) [16:19:02:683]: Doing action: SetMyDriverPathToInstallDir
MSI (s) (FC:A4) [16:19:02:683]: Note: 1: 2205 2: 3: ActionText
Action ended 16:19:02: SetCredentialFilter. Return value 1.
Action start 16:19:02: SetMyDriverPathToInstallDir.
MSI (s) (FC:A4) [16:19:02:684]: Skipping action: SetMyDriverPathToInstallDir_Win10 (condition is false)
MSI (s) (FC:A4) [16:19:02:684]: Doing action: SetIsWindow10False
MSI (s) (FC:A4) [16:19:02:684]: Note: 1: 2205 2: 3: ActionText
Action ended 16:19:02: SetMyDriverPathToInstallDir. Return value 1.
MSI (s) (FC:A4) [16:19:02:685]: PROPERTY CHANGE: Adding ISWIN10 property. Its value is '0'.
Action start 16:19:02: SetIsWindow10False.
MSI (s) (FC:A4) [16:19:02:685]: Skipping action: SetIsWindow10True (condition is false)
MSI (s) (FC:A4) [16:19:02:685]: Skipping action: SetUpgrading (condition is false)
MSI (s) (FC:A4) [16:19:02:685]: Doing action: SetVersion
MSI (s) (FC:A4) [16:19:02:685]: Note: 1: 2205 2: 3: ActionText
Action ended 16:19:02: SetIsWindow10False. Return value 1.
...
MSI (s) (FC:A4) [16:19:02:695]: PROPERTY CHANGE: Adding WIN10FOUND property. Its value is 'C:\Windows\SysWOW64\advapi32.dll'.
i.e. WIN10FOUND is defined first but called last path for draiver is defined last but called first
So, install path for driver is not corrected for Win10 and there are some problem.
Could someone help me to understand the reason which installer sets properties in incorrect order?