2013-02-11 261 views
2

我偶然发现了这个文档。 http://wix.sourceforge.net/manual-wix3/wixnetfxextension.htmWix安装程序安装.net如果没有安装

我不知道如何安装,例如.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!

+1

http://stackoverflow.com/questions/6991789/how-to-install-net-framework-4-0 - 部分安装检查了这一点 – Gilad 2013-02-11 19:00:35

+0

Wix 3.7不适用于VS2008。尝试构建时崩溃VS。 – 2013-06-25 16:04:42

回答

1

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

+0

我是否可以通过下载URL安装.Net Framework而不使用Wix Bootstrapper? – User 2014-04-07 07:01:36

+0

是的,你可以静静地安装.net框架 – Programmer 2014-04-07 08:13:36

+0

请告诉我这样做的方式。 – User 2014-04-07 09:00:05

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在机器中不可用,它将在安装应用程序设置之前安装该框架

+0

谢谢,但SourceFile属性是强制性的定义? – User 2014-04-07 11:51:59

+0

是的。如果您只将应用程序设置与引导程序相关联,则可以在安装框架之后安装它:) – Programmer 2014-04-08 04:44:20