Inno Setup does not seem to write to the registry

2019-01-25 14:22发布

问题:

I have a very simple Inno Setup script containing this [Registry] section:

[Registry]
Root: HKLM; Subkey: SOFTWARE; Flags: createvalueifdoesntexist; ValueType: string; ValueName: ABC; ValueData: abc

However, when I check the HKLM\SOFTWARE subkey, there is no value added.

I tried different subkeys under the HKLM\SOFTWARE and Pascal scripting, but Inno Setup simply refuses to create a new subkey or value.

I am running a 64bit Windows 7, the UAC is turned off.

回答1:

Finally solved it.

Inno Setup was running as 32bit on a 64bit machine, hence HKLM correspond to HKLM\Wow6432Node.

I need to add check for IsWin64 and use HKLM64 in that case.