FANDOM


Home - Introduction - Intro to Setup Design - Understanding Setup.ini - Redist Settings - Registry Values How-To - UltraArc - DiskSpan - Usefull/Required Tools - CIUv2 Versions and Downloads

CIUv2: Working With Registry Values

Let's talk about registry values....

In some cases, when creating a conversion for certain games you'll need to included registry values for the game in your setup, these registry values can be to make the game works or just to support installation of game updates from supplier such as GOG.com.

That's what the Registry.iss file is for, it is basically an Inno Setup script that tells CIU to included the registry values within it when installing the game from your setup, there are many options to registry values in the Registry.iss file, I'll try to cover as many as I can.

That said, I cannot cover everything, sorry.

Let us begin then....

To start off, here's a basic example of a ready Registry.iss file:

[Registry]
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Skyrim Special Edition"; ValueType: string; ValueName: "Installed Path"; ValueData: {app}\; Flags: uninsdeletevalue uninsdeletekeyifempty

Here's another example if the game registry's have different languages:

[Registry]
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; Subkey: "SOFTWARE\Bethesda Softworks\Oblivion"; ValueType: string; ValueName: "installed path"; ValueData: "{app}\"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion\1.00.0000"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Construction Set"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Construction Set\1.00.0000"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Horse Armor Pack"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Knights of the Nine"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Mehrunes Razor"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Orrery"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Shivering Isles English"; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: Language('EnglishUK');
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Shivering Isles English"; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('ENUS', '', '');
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Shivering Isles German"; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('DE', '', '');
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Shivering Isles Italian"; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('IT', '', '');
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Shivering Isles Spanish"; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('ES', '', '');
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Shivering Isles French"; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('FR', '', '');
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Spell Tomes"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Thieves Den"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Vile Lair"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: "SOFTWARE\Bethesda Softworks\Oblivion - Wizard's Tower"; Flags: uninsdeletevalue uninsdeletekeyifempty

And another example for Components and different languages:

[Registry]
Root: HKLM; SubKey: SOFTWARE\Electronic Arts; Flags: uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\EA Games; Flags: uninsdeletekeyifempty

Root: HKLM; SubKey: SOFTWARE\Electronic Arts\Electronic Arts; Flags: uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\Electronic Arts\Bring Down the Sky; Flags: uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\Electronic Arts\Bring Down the Sky\ergc; ValueType: string; ValueData: C4EWR6NZP9EP422VLYMY; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\Electronic Arts\Mass Effect (tm); Flags: uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\Electronic Arts\Mass Effect (tm)\ergc; ValueType: string; ValueData: 1QQGHKKTK9K979K9KVTY; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\Electronic Arts\Mass Effect Pinnacle Station; Flags: uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\Electronic Arts\Mass Effect Pinnacle Station\ergc; ValueType: string; ValueData: W29RA4GJAPJHDFGD7UZG; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect; ValueType: string; ValueName: Flavour; ValueData: DVD; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect; ValueType: string; ValueName: GameExplorer; ValueData: {{EC88CC5B-9C28-4A15-96B6-DF0335F2DB46}; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect; ValueType: string; ValueName: GUID; ValueData: {{1B0FBB9A-995D-47cd-87CD-13E68B676E4F}; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '1', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect; ValueType: string; ValueName: Path; ValueData: {app}\Mass Effect; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '1', '');

Root: HKLM; SubKey: SOFTWARE\Electronic Arts\EA Games\Mass Effect 2; Flags: uninsdeletekeyifempty; Check: IsValid('', '2', '');
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\EA Games\Mass Effect 2\ergc; ValueType: string; ValueData: 6W2J2623FUCKXP2P2PPT; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: en; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('HU', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: cz; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('CZ', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: ru; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('RU', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: es; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('ES', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: pl; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('PL', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: it; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('DE', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: fr; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('FR', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: en; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('EN', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Language; ValueData: de; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('DE', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Flavour; ValueData: DVD; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: GameExplorer; ValueData: {{2BA1C16F-5B55-4DD5-85C0-F6A80DD2C6FF}; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: GUID; ValueData: {{75D84EF7-0D8C-4e70-B3FA-7B42A5D4E0EB}; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: Path; ValueData: {app}\Mass Effect 2; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '2', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 2; ValueType: string; ValueName: ProductName; ValueData: Mass Effect 2; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '2', '');

Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Install Dir; ValueData: {app}\Mass Effect 3; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: en_US; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('HU', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: cz_CZ; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('CZ', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: ru_RU; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('RU', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: pl_PL; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('PL', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: es_ES; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('ES', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: it_IT; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('IT', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: fr_FR; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('FR', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: en_US; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('EN', '3', '');
Root: HKLM; SubKey: SOFTWARE\BioWare\Mass Effect 3; ValueType: string; ValueName: Locale; ValueData: de_DE; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsValid('DE', '3', '');


Let's take a look at the various options available to us when filling in the Registry.iss file:

Registry.iss Basic Usage
Option Usage
Root: Specify the root level of the windows registry, this is a constant which must always be there
HKLM; Specify the Registry tree to insert the value in, available options are as follows:

HKCR

HKCR32

HKCR64

HKCU

HKCU32

HKCU64

HKLM

HKLM32

HKLM64

HKU

HKU32

HKU64

HKCC

HKCC32

HKCC64

Explanation: HKCR=HKEY_CLASSES_ROOT, HKCU=HKEY_CURRENT_USER, HKLM=HKEY_LOCAL_MACHINE, HKU=HKEY_USERS & HKCC=HKEY_CURRENT_CONFIG, the 32 & 64 after are for either 32bit or 64bit, if you are not sure which it is best to use the option without the 32/64 which let windows choose the right automatically. HKLM is the most commonly used.

SubKey: This is where you specify the path & name of the Registry Key you wish to add, usually when using HKLM for tree it will be "SOFTWARE" followed by game company name\game name, you can use the following codes for that:
{code:GetAppPublisher} This will automatically get & use the name of the publisher you set in the Setup.ini file.

TIP: You can also just type it manually like in the example above.

{code:GetAppName} This will automatically get & use the Application name you set in Setup.ini file

TIP: You can also just type it manually like in the example above.

{code:GetGameVersion} This will automatically get & use the Game version you set in Setup.ini file

TIP: You can also just type it manually like in the example above.

{code:GetLangFull} or {code:GetLangShort} or {code:GetLangISO} Used to get Language codes.

{code:GetLangFull} = english, polish, french, etc..

{code:GetLangShort} = en, pl, fr, etc...

{code:GetLangISO} = en-US, pl-PL, fr-FR, etc..

TIP: You can also just type it manually like in the example above.

ValueName: This is where you set the name for the value itself within the key, for example, to set a specific name to show on the uninstall programs list in windows you will put DisplayName here, these value name can differ between games so check the game's original Registry keys with RegEdit command to know what to put here
ValueData: his is where you put the actual content for the value, depending on the type of value this can be a number, name of application, language name and many other things, once again, you may need to check original game regkeys to know what goes here, to specify Uninstallation executable you can just use the placeholder {uninstallexe}
ValueType: This sets the type of value, this can be on of the following: String, DWORD, QWORD, Binary. The most commonly used are String & DWORD
Flags: This is where you set post & Pre processing flags, used mostly to make the Uninstallation remove the RegKey when the game is removed, the most commonly used flags are UninsDeleteKey, uninsdeletevalue & uninsdeletekeyifempty, the last two are usually used together, you can find a full list of available flag on the Inno Setup help page by clicking here
Check: IsValid('x', 'y', 'z'); This value is used to tell the setup to perform a check to see if Language, Components and OS Architecture is set.

x = language (en, de, fr, ...)

y = Component ID (1, 2, 3, 4, ...)

z = OS Architecture (64, 32)

To avoid problems when editing the Registry.iss it is recommended to use some GUI tool for editing the file, InnoIDE will work very well & is highly recommended, you can visit our wiki Useful/Required Tools page to get it.

This pretty much covers most of what you need to know about using registry values with CIUv2.