2

I'm trying to add .Net 4.7 as part of the installation process. However, for Windows 10, .Net 4.7 only supports Anniversary update or later.

Unfortunately, in Burn, there is no built-in property I can use to check for Windows Build.

Is there any way to specify that the installer will only proceed when it is Anniversary update or later?

5 Answers 5

4

You can use the bal:Condition element to block installation of bundles based off a condition. You can combine this with an util:RegistrySearch element to search for a registry key that stores the current version of Windows:

<util:RegistrySearch Id="CurrentBuild" Variable="CBNumber" Result="value" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Value="CurrentBuildNumber"/>

<bal:Condition Message="Windows 10 Anniversary update or later is required.">
  CBNumber &gt; 14390
</bal:Condition>

Here, the CBNumber property of any Windows 10 build later than the Anniversary edition, which has a build number of 14393, will allow the setup to proceed, but any earlier versions will be blocked. You'll also need to add references to the WiX bal and util extensions at the top of your source file:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
 xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
 xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. What's the difference between <bal:Condition> and <Bundle Condition="">?
I don't think <Bundle Condition="..."> can reference custom RegistrySeach results.
I see. I was actually trying to use RegistrySearch in <Bundle Condition=""> before but It wasn't working. So I thought there's something wrong with how I used RegistrySearch. Anyway, with the new update model for Windows 10, I think Wix should include the build number as a built-in properties or something easier to use.
1

Win10 version checking can be implemented with a <Condition..> coupled to a <RegistrySearch..> property within the <Product..> tag in the wxs file. Example Win10 version 1809 check:

<Property Id="WINDOWSBUILDNUMBER" Secure="yes">
  <RegistrySearch Id="BuildNumberSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Name="CurrentBuildNumber" Type="raw" />
</Property>
<Condition Message="This application require Windows 10 version 1809 (build 17763) or newer.">
  <![CDATA[Installed OR (WINDOWSBUILDNUMBER >= 17763)]]>
</Condition>

Related resources:

According to https://github.com/wixtoolset/issues/issues/6026 there's no inbuilt support in Wix to simplify the Win10 version checking.

Comments

0
  <Product>
    <Condition Message="Windows 10 Anniversary update or later is required.">
      WindowsBuild &lt; 14390
    </Condition>
  </Product>

Comments

0

This works for WiX 4:

<Property Id="WINDOWSBUILDNUMBER" Secure="yes">
    <RegistrySearch
        Id="BuildNumberSearch"
        Root="HKLM"
        Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion"
        Name="CurrentBuildNumber"
        Type="raw" />
</Property>
<Launch
    Message="This application require Windows 10 version 1809 (build 17763) or newer."
    Condition="WINDOWSBUILDNUMBER &gt;= 17763" />

Comments

0

Newer WIX6 is a bit picky in this matter. Here's the WIX6 working version, place it inside the `Bundle` tag:

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" 
     xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util" 
     xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
 
   <util:RegistrySearch Id="CurrentBuild" Variable="CBNumber" Result="value" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion" Value="CurrentBuildNumber"/>
   <bal:Condition Message="Windows 10 Anniversary update or later is required." Condition="CBNumber > 14390"/>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.