Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正在检查WiX安装程序中是否安装了.NET?在哪里放置条件?_Wix - Fatal编程技术网

正在检查WiX安装程序中是否安装了.NET?在哪里放置条件?

正在检查WiX安装程序中是否安装了.NET?在哪里放置条件?,wix,Wix,在继续安装之前,我需要检查是否安装了.NET 4.5版。这是我的.wxs文件。我已将propertyref和条件放在标记下。为什么这张支票不起作用 即使目标系统上不存在.NET 4.5,安装也会继续进行 <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="

在继续安装之前,我需要检查是否安装了.NET 4.5版。这是我的.wxs文件。我已将propertyref和条件放在标记下。为什么这张支票不起作用

即使目标系统上不存在.NET 4.5,安装也会继续进行

<?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>

未安装
REMOVE=“全部”

看起来不错,所以您可能还需要:

“在调用light.exe以在MSI链接过程中包含WixNetfxExtension时,添加-ext命令行参数。”