【问题标题】:Installing .NET Framework from Wix从 Wix 安装 .NET Framework
【发布时间】:2013-08-08 21:06:17
【问题描述】:

我正在使用 WiX 工具集 v3.7 和 Visual Studio 2013 为 Excel 插件创建安装程序包。

该插件依赖于 .NET Framework 4.5,我希望安装程序自动检测目标计算机上是否存在所需的框架,如果不存在,请安装它。

谷歌搜索将我带到此页面:http://wix.sourceforge.net/manual-wix3/install_dotnet.htm,但该页面上有关如何创建 Bundle 的说明的链接已损坏。

我尝试将元素添加到我的根元素,但最终出现错误。我还尝试了一些我在网上找到的示例,但它们似乎都不能与在 VS2013 中创建项目期间为我生成的默认 WiX 清单一起正常工作。

我需要在清单中添加什么来启用 .NET Framework 4.5 的自动安装?

非常感谢您提供的任何帮助!我的清单如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product Id="*" Name="Awesome Excel Add-in 1.0" Language="1033" Version="1.0" Manufacturer="Farhan Ahmed" UpgradeCode="7ffd5a6d-d38e-4d6b-b554-098d95791222">

    <Package Description="Awesome Excel Add-in Installer" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <Condition Message="You need to be an administrator to install this product.">
      Privileged
    </Condition>

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

    <Feature Id="ProductFeature" Title="AwesomeExcelSetup" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>

    <CustomAction Id='LaunchInstallerFile' FileKey='fAddinInstaller' ExeCommand='/I /64' Return='asyncWait' />
    <CustomAction Id='LaunchRemoverFile' FileKey='fAddinInstaller' ExeCommand='/U' Return='check' />

    <InstallExecuteSequence>
      <Custom Action='LaunchInstallerFile' After='InstallFinalize'>NOT Installed</Custom>
      <Custom Action='LaunchRemoverFile' Before='RemoveFiles'>Installed AND NOT REINSTALL</Custom>
    </InstallExecuteSequence>

    <UI>
      <UIRef Id="WixUI_Minimal" />
    </UI>

    <Icon Id="icon.ico" SourceFile="$(var.AwesomeExcelAddin.TargetDir)\Awesome.ico"/>
    <Property Id="ARPPRODUCTICON" Value="icon.ico" />

  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder" Name="PFiles">
        <Directory Id="INSTALLPARENT" Name="Awesome" >
          <Directory Id="INSTALLFOLDER" Name="Excel Add-in 1.0" />
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <Component Id="ProductComponent" Guid="DDD3F332-0DF1-47F0-B8D0-5E1E09BF69BE">
        <File Id="f32bitXLL" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeAddinPacked32.xll" />
        <File Id="f64bitXLL" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeAddinPacked64.xll" />
        <File Id="fAddinDll" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeExcelAddin.dll" />
        <File Id="fAddinInstaller" Source="$(var.AwesomeExcelAddinInstaller.TargetDir)\AwesomeExcelAddinInstaller.exe" />
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>

【问题讨论】:

  • 没错,有些网址丢失了/manual-wix3,比如this
  • 您需要为此创建两个 wix 项目,一个用于您的插件,一个用于捆绑包(将使用刻录)。另外,提示:每个组件使用一个文件,在遵循组件规则时可以省去很多麻烦。

标签: windows wix installation


【解决方案1】:

感谢Netfangled的评论,我得以继续前进。

就像他(她?)提到的那样,诀窍是为 Bootstrapper 创建另一个项目,然后在该清单中引用 .NET Fx 和 MSI。

虽然我确实遇到了“未定义环境变量”的问题,但我能够通过使用解决方案目录作为基础指定源文件来解决该问题。

这是新的清单:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Bundle Name="Awesome Excel Plugin Setup" Version="1.0.0.0" Manufacturer="Awesome Software" UpgradeCode="1f605e3b-2954-403c-b9cb-ca1f0e8bf65b">

    <WixVariable Id="WixStdbaLogo" Value="Logo.png" />

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
    <WixVariable Id="WixStdbaLicenseRtf" Value="License.rtf" />

      <Chain>
      <PackageGroupRef Id="NetFx45Redist"/>
      <MsiPackage Id="AwesomeExcelSetupMSI"
                  SourceFile="$(var.SolutionDir)\AwesomeExcelSetup\bin\release\AwesomeExcelSetup.msi"
                  Vital="yes"
                  Compressed="yes"/>
    </Chain>
    </Bundle>
</Wix>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多