[英]WIX Installer - Differentiate 32bit from 64bits
我是wix的新手,我可以快速修復...
這是我的問題,我有一個安裝程序,安裝和注冊一些DLL,但我們不想在64位架構上安裝第二個DLL。
這是我們的安裝程序文件的架構:......
我試圖添加一個條件,像這樣
<Directory Id="INSTALLDIR" .....>
<Component Id="IDDLL" Guid="20E4601C-D93C-4A86-A0D9-31145D5443E6">
<File Id="common.dll" Name="common.DLL" .... SelfRegCost="1"/>
<File Id="for32bits.dll" Name="for32bits.DLL" .... SelfRegCost="1"/>
<Condition> %PROCESSOR_ARCHITECTURE="x86" </Condition>
</Component>
<Component Id="IDDLL" Guid="20E4601C-D93C-4A86-A0D9-31145D5443E6">
<File Id="common.dll" Name="common.DLL" .... SelfRegCost="1"/>
<Condition> %PROCESSOR_ARCHITECTURE~="x86" </Condition>
</Component>
</Directory>
這不起作用(重復符號錯誤)
我也試過if語句,但它看起來在編譯時被處理,所以它也沒有用:
<Directory Id="INSTALLDIR" .....>
<Component Id="IDDLL" Guid="20E4601C-D93C-4A86-A0D9-31145D5443E6">
<File Id="common.dll" Name="common.DLL" .... SelfRegCost="1"/>
<? if %PROCESSOR_ARCHITECTURE = "x86" ?>
<File Id="for32bits.dll" Name="for32bits.DLL" .... SelfRegCost="1"/>
<?endif?>
</Component>
</Directory>
有人能給我一個如何做到這一點的線索嗎?
我的經驗是%PROCESSOR_ARCHITECTURE不可靠。 我使用VersionNT64來一致地處理32位和64位。
以下示例根據本地體系結構有選擇地安裝注冊表項:
<Component Id="RegistryAppPathsFoxit64" Guid="{FD5740AC-FE2C-4043-926B-DCE7422D77AE}">
<Condition>VersionNT64</Condition>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\FoxitReader.exe" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe" />
</RegistryKey>
</Component>
<Component Id="RegistryAppPathsFoxit32" Guid="{7E78E125-CF56-46FC-BAF5-00B748052153}">
<Condition>NOT VersionNT64</Condition>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\FoxitReader.exe" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" />
</RegistryKey>
</Component>
在每個架構中處理每個架構,每個架構都有一個唯一的GUID:
<Directory Id="INSTALLDIR" .....>
<Component Id="IDDLL32" Guid="20E4601C-D93C-4A86-A0D9-31145D5443E6">
<File Id="for32bits.dll" Name="for32bits.DLL" .... SelfRegCost="1"/>
<Condition> %PROCESSOR_ARCHITECTURE="x86" </Condition>
</Component>
<Component Id="IDDLL64" Guid="20E4601C-D93C-4A64-A0D9-31145D5443E6">
<File Id="common.dll" Name="common.DLL" .... SelfRegCost="1"/>
<Condition> %PROCESSOR_ARCHITECTURE~="x86" </Condition>
</Component>
</Directory>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.