Tutorial for MOD installer

Here's what I use in my Inno setup script to handle both retail and steam, without pascal:

Code:
{reg:HKLM\SOFTWARE\WOW6432Node\2K Games\Civilization IV Complete\Sid Meier's Civilization 4 - Beyond The Sword,InstallPath
Can you tell me which installation this registry key corresponds to? a version on Steam but in full edition I imagine . but it does not settle in the same way
 
You people would be far better off just looping the registry for keys containing the word "Beyond the Sword" than hardcoding individual keys.
 
Can you tell me which installation this registry key corresponds to? a version on Steam but in full edition I imagine . but it does not settle in the same way
I'm not quite sure what you're asking. Here's what I posted again, with some whitespace added for clarity (you might have to remove them to use it in the .iss file):
Code:
{reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR
    |{reg:HKLM\SOFTWARE\WOW6432Node\Valve\Steam\,INSTALLPATH}\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword}

It tries to get the value of the key "HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR", which is the BtS path for (most?) retail versions of the game. If that key does not exist, it instead tries "HKLM\SOFTWARE\WOW6432Node\Valve\Steam\,INSTALLPATH". This points to some kind of steam base directory, so we have to append "\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword" to it to get the BtS directory.
 
ok thanks for help me

My question was about the fact that you gave me three registry keys and I only knew two. I know the main key for the BTS DVD game , I also knew the Steam keys for each individual game that redirects to the storage folder of all games. But I didn’t know the key for the steam version Complete edition with the folder 2K games.

#define BTSDIR "{reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR|{reg:HKLM\SOFTWARE\WOW6432Node\2K Games\Civilization IV Complete\Sid Meier's Civilization 4 - Beyond The Sword,InstallPath|{reg:HKLM\SOFTWARE\WOW6432Node\Valve\Steam\,INSTALLPATH}\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword}}"

I managed to make a multi version installation thanks to you.
Thank you again.
My exe file works very well for the two versions I was able to test (I did not have the full edition version).
I will be able to compile cleanly the next update of Beyond The Game the mod that Penny created.

Thanks to your help of the multi-key registry separated by " | ", inno setup also creates the right desktop shortcuts.

Now I just have to work to make sure that I can install in two different places if we have several times the game

have a good day

GGjohanson
 
You people would be far better off just looping the registry for keys containing the word "Beyond the Sword" than hardcoding individual keys.
While I'm not disagreeing with your statement, I have to say that makes it more complex and opens up for new ways to cause issues. The primary target user for an installer should be the steam users and perhaps also the gog users. People with disc versions likely know how to install mods already and nobody should release a mod as installer only.

Having said that, if somebody wants to write code to loop through the registry to find candidates, then I wouldn't complain, particularly not if the code ends up in this thread. I would likely combine it with a check for presence of certain files to ensure it's not a false positive.
 
Top Bottom