2013-05-15 16 views
2

我使用wix製作了我的加載項目的安裝文件。它有一些依賴像dotNet和VSTO運行時。所以我使用Wix bootstrapper來確認在安裝產品之前必須安裝依賴關係。但是我需要依賴項的條件安裝,如果安裝了dotNet和VSTO運行時,則不要查找安裝這些項目。我也嘗試過註冊表搜索,但沒有得到成功,這裏是我的啓動代碼告訴我,我需要修改我的代碼。如何確定是否在WIX引導程序中安裝了dotnet和VSTORuntime

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
    xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> 
    <Bundle Name="FinalSetup" Version="1.0.0.0" Manufacturer="Ramesh" UpgradeCode="5704ca64-b7bc-487b-8867-cabb51621c0e"> 
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" > 
     <bal:WixStandardBootstrapperApplication LicenseFile="mylicense.rtf" 
               SuppressOptionsUI="yes" /> 
    </BootstrapperApplicationRef> 

     <Chain> 
     <ExePackage Id="dotNetFx40_Full_x86_x64" SourceFile="dotNetFx40_Full_x86_x64.exe" PerMachine="yes" Cache="no" 
        Compressed="no" 
        DownloadUrl="http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe" 
        Permanent="yes" 
        InstallCommand="/q /norestart" 
        DetectCondition="VSTOR40_Installed" 
        InstallCondition="1" /> 
     <ExePackage Id="VSTORuntime" SourceFile="vstor_redist.exe" Permanent="yes" Vital="yes" Cache="no" Compressed="no" 
        DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917" 
        PerMachine="yes" 
        InstallCommand="/q /norestart" 
        DetectCondition="VSTOR40_Installed" 
        InstallCondition="NOT VSTOR40_Installed" /> 
     <MsiPackage SourceFile="$(var.Setup.TargetPath)" Vital="yes" Compressed="yes" Id="WordAddIns" After="VSTORuntime"/> 
    </Chain> 
    </Bundle> 
</Wix> 

另一個問題我已經是,我連着其中有一些虛擬的內容mylicense.rft。但設置不顯示安裝過程中的許可證內容,看看附加的快照 enter image description here

回答

3

問題是我忘了使用值屬性導致此問題。這是rtf文件的問題,在更改文件後按預期工作。 這是代碼的工作版本。

工作版本在這裏

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
    xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> 
    <Bundle Name="FinalSetup" Version="1.0.0.0" Manufacturer="Ramesh" UpgradeCode="5704ca64-b7bc-487b-8867-cabb51621c0e"> 
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" > 
     <bal:WixStandardBootstrapperApplication LicenseFile="mylicense.rtf" 
               SuppressOptionsUI="yes" /> 
    </BootstrapperApplicationRef> 
    <util:RegistrySearch Id="VSTORuntimeTest" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="VSTORFeature_CLR40" Variable="VSTORFeature"/> 
    <util:RegistrySearch Id="VSTORuntimeVersionV4R" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R\" Value="Version" Variable="VSTORVersionV4R"/> 
    <util:RegistrySearch Id="VSTORuntimeVersionV4" Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4\" Value="Version" Variable="VSTORVersionV4"/> 

    <util:RegistrySearch Id="DotNetTest" Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Install" Variable="DotNetInstall"/> 
    <util:RegistrySearch Id="DotNetVersion" Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="DotNetVersion"/> 

    <Chain> 
     <ExePackage Id="dotNetFx40_Full_x86_x64" SourceFile="dotNetFx40_Full_x86_x64.exe" PerMachine="yes" Cache="no" 
        Compressed="no" 
        DownloadUrl="http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe" 
        Permanent="yes" 
        InstallCommand="/q /norestart" 
        DetectCondition="NOT DotNetInstall" 
        InstallCondition="NOT DotNetInstall OR NOT (DotNetVersion >=v4.0.30319)" /> 
     <ExePackage Id="VSTORuntime" SourceFile="vstor_redist.exe" Permanent="yes" Vital="yes" Cache="no" Compressed="no" 
        DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917" 
        PerMachine="yes" 
        InstallCommand="/q /norestart" 
        DetectCondition="VSTORFeature" 
        InstallCondition="NOT VSTORFeature OR NOT (VSTORVersionV4R >=v10.0.40303) OR NOT (VSTORVersionV4 >=v10.0.21022)" /> 
     <MsiPackage SourceFile="$(var.Setup.TargetPath)" Vital="yes" Compressed="yes" Id="WordAddIns"/> 
    </Chain> 
    </Bundle> 
</Wix> 
+4

對於dotnet4依賴你其實可以參考WixNetFxExtension,包括在鏈:http://wix.sourceforge.net/manual -wix3/wixnetfxextension.htm,這將自動確定是否安裝了dotnet4。 –

+0

謝謝@caveman_dick它的工作原理:) –

+0

這節省了我幾天的工作。謝謝!我不得不啓用WixUtilExtension在.wixproj如下: \t \t \t $(WixExtDir)\ WixUtilExtension.dll \t \t \t WixUtilExtension \t \t \t seguso

相關問題