2014-09-28 43 views
1

我有這樣的關鍵:如何使用WiX在64位機器上的註冊表中記錄32位密鑰?

<Package 
    InstallerVersion="200" 
    Compressed="yes" 
    SummaryCodepage="1251" 
    Platform="x64" 
    InstallScope="perMachine"/> 

<Component Id="RegistryEntries1" Guid="*"> 
    <RegistryKey Root="HKLM" 
       Key="Software\SolidWorks\Addins\{GUID-PLACEHOLDER}" 
       Action="createAndRemoveOnUninstall"> 
     <RegistryValue Type="integer" Value="0"/> 
     <RegistryValue Name="Description" Value="SomeText" Type="string"/> 
     <RegistryValue Name="Title" Value="ProductName" Type="string"/> 
    </RegistryKey> 
</Component> 

此鍵需要被寫入32位註冊表部分,即使Windows版本是64位的。我怎樣才能做到這一點?

+0

如果我將平臺更改爲「x86」並在64位mashine上運行安裝程序,則無論如何請將鍵放入wow64。 – streamdown 2014-09-28 14:16:07

+0

嘗試在組件中設置Win64 =「no」。那麼它將是32位,這是你想要的。組件的位數可能是缺省的包的位數。 – PhilDW 2014-09-28 17:23:39

+0

此選項無效。 – streamdown 2014-09-30 03:41:44

回答

0

正如@PhilDW正確指出的那樣,您的安裝包平臺的目標是x64,但您的註冊表項正在Wow6432Node中創建。此節點對我來說是一個混亂的來源,所以下面是它的定義:

Wow6432Node註冊表項指示您正在運行64位Windows版本。操作系統使用此項顯示在64位Windows版本上運行的32位應用程序的HKEY_LOCAL_MACHINE \ SOFTWARE的單獨視圖。

由於在HKLM\SOFTWARE\Wow6432Node\SolidWorks\Addins\中創建了註冊表項,這意味着它是32位的。如果您想明確創建64位,請將Win64="yes"屬性添加到Component

<Component Id="RegistryEntries1" Guid="*" Win64="yes"> 
    <RegistryKey Root="HKLM" 
       Key="Software\SolidWorks\Addins\{GUID-PLACEHOLDER}" 
       Action="createAndRemoveOnUninstall"> 
     ... 
    </RegistryKey> 
</Component> 
相關問題