Wix v3.7 - Error Writing Registry Values

不打扰是莪最后的温柔 提交于 2019-12-12 02:34:41

问题


I'm creating an installer using wix and I'm having problems writing to the registry. Here is my RegistryValue element:

<Component Id="CMP_odbcreg" Guid="{115B002E-F4C9-48CD-8E1C-E8803B16AE69}">
        <RegistryValue Id="rg_psql" 
                       Root="HKLM" 
                       Key="SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" 
                       Name="PostgreSQL" 
                       Value="Installed" 
                       Type="string" 
                       KeyPath="yes" 
                       Action="write"/>
</Component>

Nothing is being written to the registry. This component is in my main install feature, so it should always write to the registry. I looked at my log file and found this:

MSI (s) (60:1C) [00:00:07:080]: Doing action: WriteRegistryValues
MSI (s) (60:1C) [00:00:07:080]: Note: 1: 2205 2:  3: ActionText 
Action 0:00:07: WriteRegistryValues. Writing system registry values
Action start 0:00:07: WriteRegistryValues.
WriteRegistryValues: Key: Writing system registry values, Name: , Value: 
Action ended 0:00:07: WriteRegistryValues. Return value 1.

I don't know if I'm interpreting that right, but it seems like nothing is being written to the registry at all. I have several other components generated using heat that contain RegistryValue elements which should have been executed in addition to CMP_odbcreg. I checked my Windows Registry and confirmed that no values are being written.

I have a wix manual which contains an example of writing to the registry. I tried copying and pasting it into my installer and adding it to the main install feature. That didn't work either

Please Help!


回答1:


So it turns out I was looking at the wrong registry. Windows 7 machines have a 32 bit AND a 64 bit registry, so I should have been looking at the regedit.exe found in Windows\SysWOW64.




回答2:


Since nowadays 64 bit systems are widely spread I recommend a small lecture on Registry Redirection, I am sure you will find the info useful for the future. This applies to any application accessing the registry, not just to an installer.

In your case, if you need to disable the redirection for the installer, you can have a look at this SO thread.



来源:https://stackoverflow.com/questions/18437649/wix-v3-7-error-writing-registry-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!