My purpose is to write several different registry keys with the same values. I have two subkeys named en_US and it_IT under the same key "MyCAD"
In inno setup the [Registry] section is:
Root: HKCU; Subkey: {code:GetKey_en_US|''} [values] for en_US
Root: HKCU; Subkey: {code:GetKey_it_IT|''} [values] for it_IT
In [Code] section I have the two functions 'GetKey_en_US' and 'GetKey_it_IT'. Other functions can be defined for other cultures.
More in general wish to test the presence of any culture and do the writing operations for each culture found.
It seems that if a particular culture is not present (e.g. fs_FR or en_EN) the installer do nothing.
In other words, if I have in [Registry] section the following instruction:
Root: HKCU; Subkey: {code:GetKey_fr_FR|''} [values] for fr_FR
, but in registry the subkey 'fr_FR' is not present, the installer do not perform registry setup for that culture, simply skip the above instruction.
In fact it is exactly what I want, but it is the correct way to proceed?
ADDENDUM:
My doubt is about the function {code:GetKey_fr_FR|''}
. Inno setup test the presence of the fr_FR subkey through the function GetKey_fr_FR
.
It seems that for that particular subkey (fr_FR) that's not present in the registry, Inno setup do anything.
Under the key MyCAD i can have several subkeys, related to different cultures. The user can install several versions of the same CAD application, the difference is concerning to the various cultures:
HKCU
--Software
-->MyCAD
-->en_US
-->Applications
-->it_IT
-->Applications
My Inno setup registry section extract:
[Registry]
Root: HKCU; Subkey: {code:GetKey_en_US|''} [values] for en_EN
Root: HKCU; Subkey: {code:GetKey_en_EN|''} [values] for en_US
Root: HKCU; Subkey: {code:GetKey_it_IT|''} [values] for it_IT
Root: HKCU; Subkey: {code:GetKey_fr_FR|''} [values] for fr_FR
Root: HKCU; Subkey: {code:GetKey_es_ES|''} [values] for es_ES
In this case Inno setup executes each of the above instructions, attempting to locate all the keys (en_US, en_EN, it_IT, fr_FR, es_ES).
However, since in the registry there are only subkeys en_US and it_IT the other functions ({code:GetKey_en_EN|''}, {code:GetKey_fr_FR|''}, {code:GetKey_es_ES|''}
) do anything.
Is this the correct way to test the presence of several subkeys?