2

我偶然发现了这个文档。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!

4

3 回答 3

1

在 Wix 安装项目中,您可以检查 .net framework 4.0 的存在并向用户发送一条消息,例如您必须在安装此产品之前安装 .net framework 4.0。但是如果你想默默地做(检查.net framework 4.0是否存在......如果有的话,只安装你的产品,如果没有,先安装.net framework 4.0然后安装你的产品)你必须通过wix bootstrapper

于 2013-03-29T12:04:21.593 回答
1

示例 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,它将在安装应用程序设置之前安装框架

于 2014-04-07T09:14:05.273 回答
0

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

于 2021-03-24T17:06:14.730 回答