I am reading the documentation here about what is new in Inno Setup v6. To quote:
Added new
[Registry]
sectionRoot
valueHKA
. EqualsHKLM
in administrative install mode, andHKCU
otherwise. Also supported by{reg:...}
constants andHKA32
/HKA64
are also supported. Note:HKA
(likeHKCU
) should only be used for settings which are compatible with roaming profiles.Using
[Registry]
sectionRoot
valueHKCR
is no longer recommended, useHKA
with theSubkey
parameter set to"Software\Classes"
instead.
I have the following 4 registry entries:
; AJT v19.0.0 Download Help Documentation
; This registry key value is used by the Help Ribbon Panel.
; We set the preference registry value "DownloadHelpDocumentation"
; to 1 if the "downloadhelp" task was selected.
Root: "HKLM"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
ValueType: dword; \
ValueName: "DownloadHelpDocumentation"; \
ValueData: "1"; \
Flags: uninsdeletevalue; \
Tasks: downloadhelp;
Root: "HKLM64"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
ValueType: dword; \
ValueName: "DownloadHelpDocumentation"; \
ValueData: "1"; \
Flags: uninsdeletevalue; \
Check: IsWin64; \
Tasks: downloadhelp;
; We set the preference registry value "DownloadHelpDocumentation"
; to 0 if the "downloadhelp" task was NOT selected.
Root: "HKLM"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
ValueType: dword; \
ValueName: "DownloadHelpDocumentation"; \
ValueData: "0"; \
Flags: uninsdeletevalue; \
Tasks: not downloadhelp;
Root: "HKLM64"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
ValueType: dword; \
ValueName: "DownloadHelpDocumentation"; \
ValueData: "0"; \
Flags: uninsdeletevalue; \
Check: IsWin64; \
Tasks: not downloadhelp;
I was wondering if I could simplify the script to just two registry entries above or even one if the ValueData
could be programatically determined.
There are two things going on:
HKLM
orHLM64
ValueData
of1
or0
But the quoted article refers to HKA -> HKLM or HKCU. So it is not the same thing. I confess that I don't really understand the difference between using HKLM or HKLM64.
Do I need four entries in the script?
Update
I saw this similar question which covers part of the issue. I have now reduced it to two entries:
; AJT v19.0.0 Download Help Documentation
; This registry key value is used by the Help Ribbon Panel.
; We set the preference registry value "DownloadHelpDocumentation"
; - to 1 if the "downloadhelp" task was selected.
; - to 0 if the "downloadhelp" task was NOT selected.
Root: "HKLM"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
ValueType: dword; \
ValueName: "DownloadHelpDocumentation"; \
ValueData: "{code:DownloadHelpDocumentation_ValueData}"; \
Flags: uninsdeletevalue
Root: "HKLM64"; Subkey: "Software\Community Talks\Public Talks\Preferences"; \
ValueType: dword; \
ValueName: "DownloadHelpDocumentation"; \
ValueData: "{code:DownloadHelpDocumentation_ValueData}"; \
Flags: uninsdeletevalue; \
Check: IsWin64
- I added a
{code:...}
bit for theValueData
. - I removed the
Task: downloadhelp
etc. bits. - I added:
// Converts a Boolean to a String
function BoolToStr(bValue: boolean): string;
begin
if(bValue = true) then
result := '1'
else
result := '0';
end;
// AJT v19.0.0 Returns the selected task state
function DownloadHelpDocumentation_ValueData(Param: string): string;
begin
result := BoolToStr(WizardIsTaskSelected('downloadhelp'));
end;
Update
Looking here it states:
A root key value without a suffix (for example,
HKLM
) is equivalent to the value with a suffix of 32 (for example,HKLM32
) unless the install is running in 64-bit install mode, in which case it is equivalent to the value with a suffix of 64 (for example,HKLM64
).
In my case I not using the ArchitecturesInstallIn64BitMode
in my script. This is because my script installs for both 32 bit and 64 bit.
This is why I am confused. From my point of view the user will be running my software in one of three environments:
- Running 32bit app on 32bit Windows
I understand this to mean the registry will simply be HKLM.
- Running 32bit app on 64bit Windows
I understand this to mean the registry will be HKLM...\WOW6432Node.
- Running 64bit app on 64bit Windows
I understand this to mean the registry will simply be HKLM.
Thus I think I must have the two entries then, so that both bit edition locations are covered.