【问题标题】:Wix installer install .net if not installed如果未安装 Wix 安装程序,请安装 .net
【发布时间】:2013-02-11 17:10:28
【问题描述】:

我偶然发现了这份文档。 http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htm.

如果 .net4full 未安装,我不知道如何安装它。

目前我的 wix xml 看起来像这样:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
    <Product Id="*"
      .....
      .........
    >
        <PropertyRef Id="NETFRAMEWORK40FULL"/>
        <Condition Message="This application requires .NET Framework 4 FULL. Please install the .NET Framework then run this installer again.">
        <![CDATA[Installed OR NETFRAMEWORK40FULL]]>
        </Condition>
        .....
        .........
        ............
        .........
        ............
    </Product>

    .......................
    ..............................
    ................................
    .........................
</Wix>

顺便说一句,我使用的是 wix 3.7!

【问题讨论】:

标签: wix windows-installer prerequisites


【解决方案1】:

在 Wix 安装项目中,您可以检查 .net framework 4.0 的存在并向用户提示您必须在安装此产品之前安装 .net framework 4.0。 但是,如果您想静默进行(检查 .net framework 4.0 是否存在...如果可用,则仅安装您的产品,如果没有,请先安装 .net framework 4.0 然后安装您的产品)您必须通过 wix bootstrapper 进行操作

【讨论】:

  • 我可以在不使用 Wix Bootstrapper 的情况下通过下载 url 静默安装 .Net Framework 吗?
  • 请告诉我这样做的方法。
  • 没有 Bootstrapper 可以吗?
  • 如果没有引导程序就不可能,那么是否有必要在我的设置中提供 .NetFramework msi。我可以提供一个下载 url 和我的设置从那里静默安装 .netframework。
  • 您可以在您的设置中附加所需的框架.exe,或者您可以提及下载链接。我在第一种情况下添加了代码。无论如何,您需要一个引导程序来检查和安装框架/预请求
【解决方案2】:

Bootstarpper 示例代码如下

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

   <Bundle
     Name="My Application" Version="1.0.0.0"  UpgradeCode="8DA460D6-B4CB-4ED0-A1FE- 44F269070647" Manufacturer="ABC">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
  <bal:WixStandardBootstrapperApplication LicenseFile="Agreement.rtf"
           LogoFile="App.ico"/>
</BootstrapperApplicationRef>
<Chain> 
<PackageGroupRef Id="Netfx45Xxx"/>
     <MsiPackage SourceFile="D\MySetup.msi" Compressed="yes" EnableFeatureSelection="yes" Vital="yes">
     <MsiProperty Name='INSTALLFOLDER' Value='[InstallFolder]'/>      
  </MsiPackage> 
</Chain>
 <Variable Name='InstallFolder' Value='[ProgramFilesFolder]MyApp' />    

 <Fragment>
<PackageGroup Id="Netfx45Xxx" >
  <ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" 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>

此代码附加了 .net 版本。如果机器中没有 .net 4.5,它将在安装应用程序设置之前安装框架

【讨论】:

  • 是的..如果您仅使用引导程序附加您的应用程序设置,它可以在安装框架后安装:)
【解决方案3】:

对我来说,使用 .NET 5 的解决方案是将 [ApplicationName].runtimeconfig.json 包含在应用程序文件夹中。

【讨论】:

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