[英]How to copy folder/files1..to..files5 during the installation of wix installer
我使用WIX創建了安裝程序項目,在項目目錄下有文件夾和文件,在安裝過程中需要將文件夾和文件復制到安裝路徑。
這兩個目錄結構是1.somefolder/file1..to file5 2.some folder/subfolder/subfile1..tosubfile5
這兩個目錄都在我的項目目錄中。在安裝過程中,我需要在安裝文件夾中復制相同的目錄,例如此Program Files/InstallationFolder/subfolder/subfile1..tosubfile5
。
在安裝過程中如何將目錄從項目路徑復制到安裝路徑。
這是一個相當簡單的問題,答案很復雜。
您定義了功能嗎? 您是否定義了組件? 您是否定義了目錄結構?
這是我的建議...
<Feature id="FilesFeature" Level="1" AllowAdvertise="no">
<ComponentRef Id="C__File1_exe"/>
<ComponentRef ID="C__File2_dll"/>
....
</Feature>
<DirectoryRef ID="TARGETDIR"> //This is the director you defined somewhere else that is where you want to install to
<Component Id="C__File1_exe" Guid={SOME_UNIQUE_GUID}">
<File Id="__File1_exe" Name="File1.exe" KeyPath="yes" Source="{PATH_TO_YOUR_FILE}"/>
</Component>
<Component Id="C__File2_dll" Guid={SOME_UNIQUE_GUID}">
<File Id="__File2_dll" Name="File2.dll" KeyPath="yes" Source="{PATH_TO_YOUR_FILE}"/>
</Component>
....
</DirectoryRef>
有關此信息的權威來源: http : //wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/add_a_file.html
關於如何執行此操作的優秀WiX教程: http : //wix.tramontana.co.hu/tutorial
專門針對文件及其處理方式: http : //wix.tramontana.co.hu/tutorial/getting-started/the-files-inside
編輯:您將需要具有這樣定義的目錄結構:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="SOMEFOLDER" Name="SomeFolder>
<Directory Id="SUBFOLDER" Name="SubFolder">
</Directory>
</Directory>
</Directory>
請閱讀: http : //wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/add_a_file.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.