2013-02-11 208 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

相關問題