Reputation: 41
I recently have found some old PC games to play on my Windows 10 64-bit computer. I have looked at various online sources to get the games working. Now I'm interested in creating a custom installer for all the various steps taken to get the games to work properly. I succeeded getting C&C Generals to work with a custom installer via Inno Setup. I however lack the expertise after a bit of research and trial to do the following:
Example:
C:\Program Files (x86)\Programv1.exe
.\modfiles
.Programv1.exe
post patch update with \modfiles\Programv2.exe
Does this go under the [Code]
section?
Can it go under the [Run]
section with a postinstall
flag? Like a simple copy and overwrite command as the last step?
Thanks!
Upvotes: 4
Views: 582
Reputation: 202088
There many ways to achieve this.
You can execute the patch using the AfterInstall
parameter, even before the "mod" is installed. See Inno Setup: Install other installer and run it before continuing my install. Then you can install the mod straight to the installation folder (not to the subfolder):
[Files]
; Install original game
Source: C:\source\TheGame\*; Dest: {app}
; Run patch
Source: C:\patch\PatchTheGame.exe; Dest: {tmp}; AfterInstall: RunPatch
; Install mod
Source: C:\mod\Program.exe; Dest: {app}
Use Run
entry to copy the mod after you install the patch:
[Files]
; Install original game
Source: C:\source\TheGame\*; Dest: {app}
; Extract the patch somewhere
Source: C:\patch\PatchTheGame.exe; Dest: {tmp}
; Extract the mod somewhere
Source: C:\mod\Program.exe; Dest: {tmp}
[Run]
Filename: {tmp}\PatchTheGame.exe
Filename: {cmd}; Parameters: /C copy ""{tmp}\Program.exe"" ""{app}\Program.exe""
You can code it in Pascal Script. See Install customized version of configuration file in Inno Setup after (Firebird) subinstaller finishes
Upvotes: 1