2011-09-19 116 views
7

我有一個32位WIX安裝程序,用於安裝基於.NET的Windows服務。我需要使用一個外部的.dll,它有32位和64位版本。有沒有什麼辦法可以讓32位安裝程序檢測到它在64位機器上運行?然後,我想要有條件地安裝32位或64位.dll。從32位WIX安裝程序中檢測64位系統

回答

-1

用ProcessorArchitecture創建一個屬性,並從註冊表中獲取這個值。基於此屬性創建一個有條件的功能。

+3

這個答案是相當模糊和缺少很多細節。你願意擴大它嗎? – Marek

2

試試這個:

<Component Id="Component1" Guid="*"> 
    <![CDATA[Not VersionNT64]]> 
    <File Id="File1" Name="1.dll" Source="c:\dlls\1.dll"/> 
</Component> 
<Component Id="Component2" Guid="*"> 
    <![CDATA[VersionNT64]]> 
    <File Id="File2" Name="2.dll" Source="c:\dlls\2.dll"/> 
</Component> 
4

擴展莫滕的回答,我這樣做是在維克斯3.6

 <Component Directory="INSTALLLOCATION"> 
     <File Id="msvcp100.dll_x64" Source="$(var.x64)\msvcp100.dll" KeyPath="yes" /> 
     <Condition><![CDATA[VersionNT64]]></Condition> 
    </Component> 
    <Component Directory="INSTALLLOCATION"> 
     <File Id="msvcp100.dll_x86" Source="$(var.x86)\msvcp100.dll" KeyPath="yes" /> 
     <Condition><![CDATA[Not VersionNT64]]></Condition> 
    </Component> 
相關問題