1

是否有创建WiX安装程序的教程,可以检查 MCR 是否已经安装,如果没有可以安装它?

我正在使用Visual Studio 2012

4

1 回答 1

1

这是我对 MCR 2012a 和 .NET 4.5 的解决方案,如果有更好的方法,请发表评论:这是用于文档

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:netfx='http://schemas.microsoft.com/wix/NetFxExtension'>

    <Bundle Name="MYAPP"
            Version="0.6"
            Manufacturer="MY Corporation"
            UpgradeCode="f380ae43-5df1-4cfe-9297-526e3e638e57">
        <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
        <Chain>
            <!-- TODO: Define the list of chained packages. -->
            <PackageGroupRef
                Id="Netfx45FullPackage"/>
        </Chain>
    </Bundle>

    <Fragment>
        <util:RegistrySearch
            Id="MatlabPath"
            Variable="UniqueId"
            Root="HKLM"
            Key="SOFTWARE\Matworks\MATLAB\4.17\"
            Result="exists"/>
        <PackageGroup Id="Netfx45FullPackage">
            <ExePackage
                Id="Netfx45Xxx"
                Cache="no"
                Compressed="no"
                PerMachine="yes"
                Permanent="yes"
                Vital="no"
                InstallCommand="/q"
                SourceFile="..\SetupProject\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;))"/>
            <ExePackage
                Id="MatlabMCR2012a64"
                Cache="no"
                Compressed="no"
                PerMachine="yes"
                Permanent="yes"
                Vital="no" 
                InstallCommand="/q"
                SourceFile="..\SetupProject\MCR_R2012a_win64_installer.exe"
                InstallCondition="(NOT MatlabPath)"/>
        <MsiPackage
            Id="MYAPP"
            Cache="no"
            Compressed="no"
            Vital="yes"
            SourceFile="..\SetupProject\bin\Release\MYAPPSetup.msi"/>
        </PackageGroup>
    </Fragment>
</Wix>
于 2013-03-04T18:13:00.367 回答