0
votes

I need to check for .NET version 4.5 installed before proceeding with my installation. This is my .wxs file. I've placed the propertyref and condition under the tag. Why is this check is not working?

Even if .NET 4.5 is not present on the target system, the installation goes ahead anyway.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*"
             Name="SolidFire Hardware Provider"
             Language="1033"
             Version="1.0.0.0"
             Manufacturer="SolidFire"
             UpgradeCode="0c60967f-f184-4b8b-a96a-b1caa4a8879e">
        <Package InstallerVersion="200" 
                 Compressed="yes" 
                 InstallScope="perMachine" />
        <!--Media Id='2' Cabinet='provider.cab' EmbedCab='yes'/-->
        <PropertyRef Id="NETFRAMEWORK45"/>

        <Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again.">
          <![CDATA[Installed OR NETFRAMEWORK45]]>
        </Condition>

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate EmbedCab='yes'/>

        <Feature Id="ProductFeature" Title="InstallProvider" Level="1">
          <ComponentGroupRef Id="ProductComponents" />
        </Feature>
        <!-- IRef Id="WixUI_Minimal"/-->

        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" ></Property>
        <!--Property WixUIDialogBmp = "logo.bmp"></Property-->
        <UIRef Id="WixUI_InstallDir"/>

        <InstallExecuteSequence>
          <Custom Action="RunInstallScript" After="InstallFiles" >NOT Installed</Custom>
        </InstallExecuteSequence>
        <InstallExecuteSequence>
          <Custom Action='BeforeUninstall' Before='RemoveFiles'>REMOVE="ALL"</Custom>
        </InstallExecuteSequence>
        <CustomAction Id="RunInstallScript"
                      ExeCommand="cmd /c install-solidfireprovider.cmd"
                      Directory="INSTALLFOLDER"
                      Execute="deferred"
                      Return="check"/>
        <CustomAction Id="BeforeUninstall"
                      ExeCommand="cmd /c uninstall-solidfireprovider.cmd"
                      Directory="INSTALLFOLDER"
                      Execute="deferred"
                      Return="check"/>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="solidfireinstall" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
            <Component Id="ProductComponent">
                <!-- TODO: Insert files, registry keys, and other resources here. -->
                <File Id="restinterfacedll.dll"
                      Source="..\vssprovider\x64\$(var.build)\RESTInterfacedll.dll"></File>
            </Component>

            <Component Id="vssdll">
                <File Id="vsssolidfireprovider.dll"
                  Source="..\vssprovider\x64\$(var.build)\vsssolidfireprovider.dll"></File>
            </Component>

            <Component Id="installscript">
                <File Id="installscript"
                  Source="install-solidfireprovider.cmd"></File>
            </Component>

            <Component Id="uninstallscript">
                <File Id="uninstallscript"
                  Source="uninstall-solidfireprovider.cmd"></File>
            </Component>

            <Component Id="registerprovider">
                <File Id="registerprovider"
                  Source="register_app.vbs"></File>
            </Component>

            <Component Id="vshadow">
                <File Id="vshadow"
                  Source="vshadow.exe"></File>
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>
1

1 Answers

0
votes

That looks OK so you probably also need to:

"Add the -ext command line parameter when calling light.exe to include the WixNetfxExtension in the MSI linking process."