Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/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
Visual studio 2012 WiX引导程序应用程序_Visual Studio 2012_Installation_Wix_Packaging_Bootstrapper - Fatal编程技术网

Visual studio 2012 WiX引导程序应用程序

Visual studio 2012 WiX引导程序应用程序,visual-studio-2012,installation,wix,packaging,bootstrapper,Visual Studio 2012,Installation,Wix,Packaging,Bootstrapper,我希望引导程序在安装之前安装4.5(如果不可用)。如果机器有.NET 4.5,则我只想安装产品setup.msi 以下是我的代码: <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> <Bundle Name="AAA" Version="1.0.0.0" UpgradeCode=

我希望引导程序在安装之前安装4.5(如果不可用)。如果机器有.NET 4.5,则我只想安装产品setup.msi

以下是我的代码:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

    <Bundle Name="AAA" Version="1.0.0.0"  UpgradeCode="8DA460D6-B4CB-4ED0-A1FE-44F269070647">
        <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
        </BootstrapperApplicationRef>

        <Chain>
            <PackageGroupRef Id="Netfx45FullP"/>

            <MsiPackage Compressed="yes" Vital="yes"  Id="PMService" Cache="yes" Visible="no"
                SourceFile="C:\Users\abc.msi">
            </MsiPackage>
        </Chain>
    </Bundle>

    <Fragment>
        <WixVariable Id="WixMbaPrereqPackageId" Value="Netfx45Full" />
        <WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />

        <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
        <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion" Win64="yes" />

        <PackageGroup Id="Netfx45FullP">
            <ExePackage Id="Netfx45" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
                        InstallCommand="/q"
                        SourceFile="dotNetFx45_Full_x86_x64.exe"
                        DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))"
                        InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))"/>
        </PackageGroup>
    </Fragment>
</Wix>

您需要删除安装条件中的
和(而不是(Netfx4FullVersion=“4.5.50709”或Netfx4x64FullVersion=“4.5.50709”)
部分

检测条件将处理告知是否已安装.NET Framework的情况。如果检测到已安装,则不会再次安装

安装条件将决定是否允许该软件包在计算机上。如果计算结果为false,则将从计算机上卸载该软件包


通过将检测条件添加到安装条件中,您基本上无法实现软件包可以安装在计算机上并保留在计算机上。:/p>感谢您的回复Rob Mensching我需要检测条件,因为我的要求是…如果计算机中未安装.net framework,我的引导程序希望安装.net frmaework,然后安装产品。如果机器已经有了.net框架,那么…它只想安装产品安装程序..我有点困惑..你能澄清这一点吗?但它仍然不能正常工作