FANDOM


Navigation
TopHomeIntroductionIntro To Setup DesignUnderstanding Setup.iniRedist SettingsRegistry Values How-ToSplit & Merge Large Files Useful/Required Tools


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 CIUvw 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.iss example taken from REV0's Far Cry 4 conversion:

[Registry]
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: UninstallString; ValueData: {uninstallexe}; ValueType: string; Flags: UninsDeleteKey;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: DisplayName; ValueData: FarCry 4; ValueType: string; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: DisplayVersion; ValueData: 1; ValueType: string; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: EstimatedSize; ValueData: 32354407; ValueType: dword; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: Inno Setup: App Path; ValueData: {app}; ValueType: string; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: Inno Setup: Language; ValueData: english; ValueType: string; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: Inno Setup: Selected Tasks; ValueData: desktopicon,starticon; ValueType: string; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: Inno Setup: Setup Version; ValueData: 5.5.4 (u); ValueType: string; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: MajorVersion; ValueData: 1; ValueType: dword; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: MinorVersion; ValueData: 0; ValueType: dword; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: NoModify; ValueData: 1; ValueType: dword; Flags: uninsdeletevalue uninsdeletekeyifempty;
Root: HKLM; SubKey: "SOFTWARE\{code:GetAppPublisher}\{code:GetAppName}"; ValueName: NoRepair; ValueData: 1; ValueType: dword; Flags: uninsdeletevalue uninsdeletekeyifempty;

Here's another example in a picture format (Click to enlarge):

RegistryISSexample

Registry.iss for X64 & X86 systems

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
{code:GetAppName} This will automatically get & use the Application name you set in Setup.ini file
{code:GetGameVersion} This will automatically get & use the Game version you set in Setup.ini file
{code:GetLangFull} or {code:GetLangShort} or {code:GetLangISO} Used to get Language codes, e.g. {code:GetLangISO} will get a value depending on setup language, for english en-US, for polish pl-PL and so on
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: ComponentsCheckFA('1'); This value is used to tell the setup to perform a check to see if component number 1 has been selected to install and only install that registry value if it was, the number '1' can be changed to any component number as set in Setup.ini

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, for more help feel free to visit our forum and ask a question.

Navigation
TopHomeIntroductionIntro To Setup DesignUnderstanding Setup.iniRedist SettingsRegistry Values How-ToSplit & Merge Large Files Useful/Required Tools

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.