简体   繁体   中英

WIX Installation Condition

I have very specific condition to set for the WIX installer and every attempt so far failed.

I need to detect

  • if Windows 10 is updated with Anniversary Edition Update
  • if Office 365 version build 12.0.6965.2092 version is installed

RegistrySearch will give values to corresponding Properties but Condition is triggered no matter if the actual conditions are met or not.

<Property Id="OFFICE365DETECT">
    <RegistrySearch Id="Office365Search" Root="HKLM" Key="SOFTWARE\Microsoft\Office\ClickToRun\Configuration" Name="ProductReleaseIds" Type="raw"/>
  </Property>
<Property Id="OFFICE365VERSIONDETECT">
  <RegistrySearch Id="Office365VersionSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Office\ClickToRun\Configuration" Name="ClientVersionToReport" Type="raw" />
</Property>
<!--Windows Anniversary Edition corresponds to CurentBuildNumber 14000 and above-->
<Property Id="WINDOWSANNIVERSARYEDITIONDETECT">
  <RegistrySearch Id="WindowsAnniversarySearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentBuildNumber" Type="raw"/>
</Property>

Condition check supposed to look different, I know, but I couldn't find any guide for this very specific case.

    <![CDATA[((OFFICE365DETECT = "O365ProPlusRetail" OR OFFICE365DETECT = "O365BusinessRetail" OR OFFICE365DETECT = "O365SmallBusPremRetail" ) AND OFFICE365VERSIONDETECT = "16.0.6965.2092" AND WINDOWSANNIVERSARYEDITIONDETECT = "14393")]]>

I would greatly appretiate any suggestions, comments and critics.

You don't need to search the registry for the Windows build number - there's a property WindowsBuild that you can use in the Launch Condition:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa372813(v=vs.85).aspx

The documentation isn't up to date but I believe the value for the Anniversary Edition is 9600. It's more normal to say that you want <= 9600 if W10 Anniversary is the minimum you support, otherwise your setup will not install on later versions of Windows 10.

The Office search - the obvious thing to do is to look in the registry, and I assume you've already seen that the value is there. However your search may need to be in the 64-bit registry (use Win64="yes"). You haven't said what your architecture is and it may be defaulting to the wrong one for the search, described in the WiX documentation.

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