Tutorial for MOD installer

P&nny

Warlord
Joined
Sep 1, 2007
Messages
195
Hey guys, looking around everywhere on this but surprised not to find...

How do you make a clean 'pro-looking' installer for your MOD ?

I'm sure you're well aware but it's much nice to have a clean looking installer, importantly because I would like :
- The installer to detect exactly where the game is installed because name of the MOD has to be rigorous (because of specific theme files)
- The installer cannot be put in the "mydocs" folder (same reason)
- I would like the MOD to also find the game path for Steam users
- I would like to copy more files than "just" the files in /MOD. Like a dedicated exe.

This is the last piece for me to move my MOD to its new format : https://forums.civfanatics.com/threads/beyond-the-play-community-mod.648750/page-2

The goal is to have a niece installer like FFH's ;)
Am Happy to write down tutorial when I know how to do it !

The goal ! :


--------------------------------------------------------------------------------------------
Answer --> Relatively quickly giving in first page here, Inno Setup did answer all our needs.
https://forums.civfanatics.com/threads/inno-install-script-tutorial.340885/


For future reference, here is what we use :

Normal Version
Spoiler InnoSetup Code :

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Sid Meier's Civilization 4 - Beyond the Game"
#define MyAppVersion "2.20"
#define MyAppPublisher "Penny & Friends"
#define MyAppURL "https://forums.civfanatics.com/threads/beyond-the-play-community-mod.648750/"
[InstallDelete]
Type: filesandordirs; Name: {reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\Mods\Beyond The Game
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{948BDE4A-45DC-4E98-BEBD-E11998DFA94E}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
UninstallDisplayName={#MyAppName}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=D:\Bureau\Installer Mod
OutputBaseFilename=BeyondTheGame
SetupIconFile=D:\Bureau\Installer Mod\Fichier du jeu\BTG.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
DirExistsWarning=no
UninstallDisplayIcon={app}\BTG.exe
[Types]
Name: "full"; Description: "Default installation"
//Type of installation... I don't mess with this.
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags:
[Files]
Source: "D:\Bureau\Installer Mod\Fichier du jeu\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{userdesktop}\Beyond The Game"; Filename: "{reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\BTG.exe"; Parameters: "mod=\Beyond The Game"; Tasks: desktopicon; IconFilename: "{app}\BTG.ico"
[Run]
Filename: "{reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\BTG.exe"; Parameters: "mod=\Beyond The Game"; Description: "{cm:LaunchProgram,Beyond The Game}"; Flags: nowait postinstall skipifsilent


Steam Version
Spoiler InnoSetup Code :

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Sid Meier's Civilization IV Beyond the Game"
#define MyAppVersion "2.20"
#define MyAppPublisher "Penny & Friends"
#define MyAppURL "https://forums.civfanatics.com/threads/beyond-the-play-community-mod.648750/"
[InstallDelete]
Type: filesandordirs; Name: {reg:HKLM\SOFTWARE\WOW6432Node\Valve\Steam\,INSTALLPATH}\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Mods\Beyond The Game
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{7C83C135-5126-491A-9F35-031B5F62481D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
UninstallDisplayName=Sid Meier's Civilization IV: Beyond the Game
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={reg:HKLM\SOFTWARE\WOW6432Node\Valve\Steam\,INSTALLPATH}\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=D:\Bureau\Installer Mod
OutputBaseFilename=BeyondTheGame - STEAM
SetupIconFile=D:\Bureau\Installer Mod\Fichier du jeu\BTG.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern
DirExistsWarning=no
UninstallDisplayIcon={app}\BTG.exe
[Types]
Name: "full"; Description: "Default installation"
//Type of installation... I don't mess with this.
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags:
[Files]
Source: "D:\Bureau\Installer Mod\Fichier du jeu\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{userdesktop}\BTG - STEAM"; Filename: "{reg:HKLM\SOFTWARE\WOW6432Node\Valve\Steam\,INSTALLPATH}\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\BTG.exe"; Parameters: "mod=\Beyond The Game"; Tasks: desktopicon; IconFilename: "{app}\BTG.ico"
Name: "{userdesktop}\BTG - STEAM LOBBY"; Filename: "{reg:HKLM\SOFTWARE\WOW6432Node\Valve\Steam\,INSTALLPATH}\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Civ4BeyondSword.exe"; Parameters: "mod=\Beyond The Game"; Tasks: desktopicon; IconFilename: "{app}\BTG.ico"

 
Last edited:
I am also curious because I have never succeeded. The farthest I got was creating one with 7-Zip but it doesn't have cool options like creating a desktop shortcut and such.
 
I am using Inno Setup, and I think that's what most people are doing.
 
Maybe it's just me but honestly I always disliked it when CIV4 mods came with an installer program. I always preferred it when it was just a zip that I could unpack and paste into my mods folder. It's just cleaner that way.
 
Maybe it's just me but honestly I always disliked it when CIV4 mods came with an installer program. I always preferred it when it was just a zip that I could unpack and paste into my mods folder. It's just cleaner that way.
I agree. I pick zip (or rar, 7z or whatever) whenever possible. Particularly for an installer as simple as a mod, which is "place folder in MODS". Some people prefer an installer though. If you aren't tech savvy, then the file system can apparently be scary.
 
I agree. I pick zip (or rar, 7z or whatever) whenever possible. Particularly for an installer as simple as a mod, which is "place folder in MODS". Some people prefer an installer though. If you aren't tech savvy, then the file system can apparently be scary.
If you can't even navigate the file system than you have no business using a computer. I mean that's literally like saying you like reading books but are afraid of flipping pages. There simply comes a certain point where we savvy people have to put our foot down and tell the rest to go learn for their own sake.
 
Thanks team, much appreciated !

In fact I double-checked with my teammate who's helping on this (he was aware of Inno Setup, thanks Leoreth!); and our main question remain :

We don't know how to make it that the installer detects where the installation is made
I suppose it has to understand and read the registry to understand that.


I read you you guys well on the fact that we, savvy, might actually genually prefer a .zip file (I do too),
But there is a couple of things at play here...
First and foremost, I use to give the MOD in .zip before multiplayer championship and people wouldn't look so much before the games and there is that 5-10% of people who'd never get there. And it would be hours lost in chat trying to help...
Second, I think the path for the Steam version is not that obvious relatively (and our installer as to work for that too)
Third, I/we might put files that are not in the main /MOD Folder. I'm thinking of the .exe we use already. It wouldn't be just "unzip the MOD folder", it would also be '...and put this file there and this other one here etc.'
 
Call me an elitist but my idea of "support" for people that can't use the file system would be to openly and plainly tell them we are better off without them.
 
I and other FfH modders, probably including black_imperator, use the Inno install script described in this tutorial. I'm not entirely sure how well it works for Steam, though.
I also found another thread recommending NSIS.

Call me an elitist but my idea of "support" for people that can't use the file system would be to openly and plainly tell them we are better off without them.
I think there is something in between "cannot use the file system at all" and "is able to unpack an archive to the correct location (as easily as using an installer)". For my mod, you additionally have to copy another mod (FfH) into the correct folder first, and you must not get the mod folder name wrong. The installer seems to be much more popular, probably for a reason.
I do understand when developers don't want to go through the hassle of making the installer, though, it was quite annoying to me.
 
I do understand when developers don't want to go through the hassle of making the installer, though, it was quite annoying to me.
It's more of a personal pet peeve of mine. Basically I hate the modern trend that's happening with software where everything is localized to a million languages and dumbed down until we'll all end up using a plastic monitor with a single big red button in the middle just because god forbid people have to learn standardized names or how to use computers. God forbid someone actually has to acquire skill to use something productively.

And the reason I dislike it is because as a developer I know that this is a fundamental falsehood. You aren't making things easy for people. You are just making them think it's easy until they hit the first hurdle and than they'll curl up in a ball and call you to explain where the "any" key is.


Admittedly installers are a pretty stupid example of this and one where usability actually favors having them. But like I saw the thread, was in a bad mood and got carried away. Blame having 3 projects due until new year.
 
Well, yeah. You can either uphold the purity of your beliefs about installers or troubleshoot 2-3 people a month who put their mod folder in the wrong location, or accept that they won't be playing the mod. At least that was my calculation when transitioning to an installer. Not to mention that as soon as modules enter the picture it genuinely becomes complicated for people who do not understand how modules work.
 
On the other hand, I find it rather frustrating when the only way to install a mod is by using an installer that may or may not do what it's supposed to on my system. Wine is pretty good at handling stuff like this nowadays, but there's always cases when it won't work for whatever reason. Plus extracting an archive is certainly safer than running some random executable file I got from the Internet.

I suppose the best approach is to have both an installer and some alternative standard method of getting your mod like a zip file.
 
I suppose the best approach is to have both an installer and some alternative standard method of getting your mod like a zip file.
I agree. Lack of a zip isn't nice because you have no way of fixing issues if it doesn't work.

We did have an issue with installing WTP. City catchment radius was either 1 or 2 plots and it was a compile time setting, meaning people had to pick a DLL to add. The number of people running into problems with this even after reading the guide and being told what to do online came as a surprise. It's now a map option instead, but it sure took much longer to code the ability to change settings, which vanilla assumed wasn't going to change, hence fairly fixed at compile time.
 
Oh yeah, for sure. Archive files should always be an option.
 
Worst comes to worst you can just build your own. I mean, realistically you guys don't need a full on installer. You need a glorified self extracting zip file. That is to say a zip and and and a script that unzips it to the right location packaged into what appears to be an exe. Cobbling a program together that does this shouldn't be that hard.
 
I didn't realize I was starting a near-philosophical discussion on whether or not we should do installers... but it's quite interesting, at least I will now think of presenting both !

In this case I will give the multiple location of files an excuse for the community to justify the installer...

BTW Black Imperator came back very quickly with this advise :
your best bet is not Inno, but NSIS i'd say. This post gives you the link to the nsis project to compile the installer, and examples of scripts you can use as a template for your mod :

https://forums.civfanatics.com/threads/quick-modding-questions-thread.351519/page-209#post-14037096

I had a bit of MOD development hangover so haven't look yet, but I will try this and Igfr's INNO solution this week

Thanks a ton team.
 
Not to mention that as soon as modules enter the picture it genuinely becomes complicated for people who do not understand how modules work.
This is why I'm especially happy that AND2 has it's own launcher that can handle other optional things too, like enabling/disabling modules and automatically audio entries of modules into mod audio defines. But this launcher is not universal: It should work with other mods but has certain features hardcoded that will cause confusion at least.
upload_2020-12-22_12-39-25.png


So it would be really handy if someone could create a universal launcher that can:
  • launch the mod in which folder it is added
  • enable/disable modules
  • insert audio entries of modules
  • (maybe) select which dll should be active (copy it from a subfolder to Assets folder)
I don't really want to make it a request but maybe someone would like to do it...
 
Top Bottom