試圖製作一個多語言安裝程序 - 該過程通常工作,但似乎無法安裝本地化文件。MST爲什麼不包含具有不同內容的文件
每個本地化安裝程序都可以獨立運行並安裝本地化文件,如eula.pdf。
我希望,我只是缺少變換生成步驟的標誌(或者使用了錯誤的工具?)
過程由有一羣爲每種語言安裝1開始。
要構建每個安裝程序,我們使用-b "folder"
和-loc "folder"
選項指定每個語言,其中包含一些替代文件內容,如licence.pdf。
進行本地化的文件有一個共同的源名稱
<File Id='License.pdf' Name='eula.pdf' Source='License(EULA).pdf' KeyPath='yes'/>
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
例如是
en-US/License(EULA).pdf
en-US/License.rtf
en-US/Product.wxl
fr-FR/License(EULA).pdf
fr-FR/License.rtf
fr-FR/Product.wxl
也有一些文件,如文件夾binary.dll和binary.exe未本地化並且對所有msi都一樣 - 不要期望在MST中看到它們。
該過程中的下一步是在基本語言(英語)和其他每種語言之間創建一個MST差異。使用Window SDK中的Windows\v7.1\Bin\MsiTran.exe
對於內容更改,MST看起來有點小。
使用Windows\v7.1\Samples\sysmgmt\msi\scripts\wisubstg.vbs
除英語之外的語言安裝合併所有MST文件到一個單一的安裝程序將顯示整個安裝程序UI包括許可證爲被本地化的RTF版本,但在磁盤上的EULA.pdf是永遠是基礎英語。
使用Ant-DOTNET任務運行構建(如果它有差別) 微星建設任務
<wix mode="light" target="${outlocation}\${lang.folder}\my.msi" wixHome="${wixhome}">
<lightArg line="-b "${location}""/> <!-- provide the location of the signable binaries -->
<lightArg line="-b "${msiwixsource}\Localisation\${lang.folder}""/> <!-- provide the location of the localisation -->
<lightArg line="-sice:ICE57"/>
<lightArg line="-cultures:${lang.culture}"/>
<lightArg line="-loc "${msiwixsource}\Localisation\${lang.folder}\Product.wxl""/>
<lightArg line="-ext "${wixhome}\WixUtilExtension.dll""/>
<lightArg line="-ext "${wixhome}\WixUIExtension.dll""/>
<lightArg line="-ext "${wixhome}\WixFirewallExtension.dll""/>
<lightArg line="-ext "${wixhome}\WixNetFxExtension.dll""/>
<sources dir="${msiwixobjects}">
<include name="*.wixobj"/>
</sources>
<moresources dir="${msiwixsource}\Localisation\${lang.folder}">
<include name="*"/>
</moresources>
<moresources dir="${location}">
<include name="binary.dll,binary.exe"/>
</moresources>
</wix>
變換任務
<exec executable="${windowsSDKBin}">
<arg value="-g"/>
<arg value="${outlocation}\en-US\my.msi"/>
<arg value="${outlocation}\${lang.folder}\my.msi"/>
<arg value="${outlocation}\${lang.folder}\my.mst"/>
</exec>
的重新包裝任務
<exec executable="cscript">
<arg value="${windowsSDKMsi}"/>
<arg value="${outlocation}\my.msi"/>
<arg value="${outlocation}\${lang.folder}\my.mst"/>
<arg value="${lang.id}"/>
</exec>
Product/@ Language =「!(loc.Lang)」在Product.wxl中指定 英文基地我們列出所有1033,1028,1029,1031,1036,1040,1041,1043,1045,1046,2052,3082
其他語言只是具體的如1036
fr-FR