2015-04-02 79 views
0

我正在使用Wix Toolset設置項目。我需要將文件添加到我的安裝程序包中。有這麼多的DLL,我個人包括他們。如何在wix工具集中的一個組件中導入多個文件

<DirectoryRef Id="APPLICATIONROOTDIRECTORY"> 
    <Component Id="MyApplication" Guid="53BF1BB4-FEC5-4D6C-AEA3-2D7DE0021695"> 
     <File Id="MyApplication" Source= "$(var.ServiceAppSourceDir)\MyApp.dll" KeyPath="yes" Checksum="yes"/> 
    </Component> 
    <Component Id="ExampleFile" Guid="5C7CF06D-420E-44E0-91EC-DE8D55D1E6E8"> 
     <File Id="ExampleFile" Source="$(var.ServiceAppSourceDir)\ExampleFile.dll" KeyPath="yes" Checksum="yes"/> 
    </Component> 
</DirectoryRef> 

<Feature Id="MainApplication" Title="Main Application" Level="1"> 
    <ComponentRef Id="MyApplication" /> 
    <ComponentRef Id="ExampleFile" /> 
</Feature> 

我只包括2個,但我有超過30個DLL導入我們的應用程序。我怎樣才能導入所有的DLL在一個組件? 我試過使用「* .dll」沒有工作。任何建議?

+1

請不要走這條路線,閱讀這個問題的更多細節: http://stackoverflow.com/questions/1602831/wix-one-file-per-component-or-several-files-per-component – Isaiah4110 2015-04-02 14:56:45

+0

也如果您正在尋找更簡單的方式來導入文件,則可以使用WixEdit工具。它有一個簡單的GUI,可以幫助你創建WIX腳本。 http://wixedit.sourceforge.net/ – Isaiah4110 2015-04-02 14:57:51

+0

看看這個答案https://stackoverflow.com/questions/1295539/using-wix-to-package-an-installer-with-many-files/1295648 #1295648 – CheGueVerra 2015-04-02 15:01:07

回答

1

如果你的問題是,你正在尋找一個自動化的方式將文件添加到您的安裝,我想看看維克斯的收割機工具(heat.exe) - http://wixtoolset.org/documentation/manual/v3/overview/heat.html

的基本思路是,您可以將heat.exe指向構建輸出目錄樹,並且它將生成一個.wxs文件,並且構建樹中的每個文件都有其自己的組件。這樣,如果將來添加更多文件,您將不必更改安裝程序源代碼或構建過程來選擇它們。

+0

謝謝,我正在研究它。 – Everest 2015-04-06 14:05:59

相關問題