9
votes

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
Have you explicitly specified the PrivilegesRequired directive value ? I'm asking because if you changed it to something different from admin value, InonSetup doesn't run the setup elevated, thus it might not have rights to write to the HKLM root. Could you include this information into your question ?TLama
@TLama The problem was in registry virtualization of 32 bit applications. I have added an answer.Libor
@TLama Sorry I forgot to answer you. As I wrote in the question: "the UAC is turned off", hence the problem was not in missing admin privileges.Libor
No problem. But it's not about "UAC is turned off", when you'd run the setup with PrivilegesRequired below admin, the setup wouldn't even run with admin elevation (no matter UAC is on or off), thus you wouldn't have those rights at all. That's why that response was mandatory...TLama

1 Answers

20
votes

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. I think the syntax should be:

Root: HKLM64; ... <Subkey, Flags, etc.> ... Check: IsWin64