Writing 32/64-bit specific registry key in Inno Setup

北战南征 提交于 2020-01-01 11:49:35

问题


I want when I install program, the setup will create the registry in: SOFTWARE\Wow6432Node\Publisher\App with {app} main location on 64-bit systems. And I want do same for 32bit in "32 bit" location but i don't know where it is. The setup will check version of Windows and create registry depending on the system.


回答1:


You want to write to:

  • on 64-bit systems: SOFTWARE\Wow6432Node

  • on 32-bit systems: SOFTWARE

For that, you do not need to do anything special. Windows registry redirector handles that. It automatically redirects SOFTWARE to SOFTWARE\Wow6432Node for 32-bit applications running on 64-bit systems. And Inno Setup installers are 32-bit applications.

So a simple [Registry] section entry like below will do, what you want. No need for any 32-bit or 64-bit specific code:

[Registry]
Root: HKLM; Subkey: "SOFTWARE\My Company\My Program\Settings"; ...

Of course, unless you use 64-bit installation mode.


See also Writing 32/64-bit specific registry key at the end of the installation in Inno Setup.



来源:https://stackoverflow.com/questions/46258689/writing-32-64-bit-specific-registry-key-in-inno-setup

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