WiX 3.7和MATLAB 2012a MCR

时间:2013-02-25 16:51:47

标签: matlab wix windows-installer

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

我正在使用Visual Studio 2012

1 个答案:

答案 0 :(得分: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>