To Check Windows Embedded Standard Installed in Device using WiX

The following code shows how to check WES7 before installing using WiX.

<Property Id="CHECKWES7">
    <RegistrySearch Id="CheckWES7"
                      Root="HKLM"
                      Key="Software\Microsoft\Windows NT\CurrentVersion"     
                      Name="ProductName"
                      Type="raw" />
</Property>
<Condition Message="This device requires Windows Embedded Standard 7. Please install Windows Embedded Standard 7 then run this installer again.">
      <![CDATA[Installed OR CHECKWES7="Windows Embedded Standard"]]>
</Condition>

The RegistrySearch element specifies a unique id, the root in the registry to search, and the key to look under. The name attribute specifies the specific value to query. The type attribute specifies how the value should be treated. Raw indicates that the value should be prefixed according to the data type of the value.

The above sample will set the  CHECKWES7 property to "Windows Embedded Standard" if the registry key was found with this data value.

Installed is a Windows Installer property that ensures the check is only done when the user is installing the application, rather than on a repair or remove. The CHECKWES7 part of the condition will pass if the property was set with the value we are checking. If it is not set the installer will display the error message then abort the installation process.
Ebook Download
View all
Learn
View all