Page 1 of 1
Mod Installer Template
Posted: Tue Mar 01, 2011 3:17 am
by GSH
Modern mods need an installer to deal with administrative permissions, setting up shortcuts, etc. See
http://matesfamily.org/bz2/BZ2_ModInsta ... late_v3.7z for a template for using Inno Setup (free, open source) to create a modern installer. Sample files included. Programmer art also included at no extra charge. See the readme.txt inside for how to get the installer meker, and customize this template.
(UPDATE: version 3 posted, url changed above. See below for details on version 3)
-- GSH
Re: Mod Installer Template
Posted: Tue Mar 01, 2011 5:05 am
by Zax
Your attention to open source makes me happy. Thank you for that, GSH.
Re: Mod Installer Template
Posted: Tue Mar 01, 2011 5:18 am
by ViperWC
Zax wrote:Your attention to open source makes me happy. Thank you for that, GSH.
Agreed!

Re: Mod Installer Template
Posted: Tue Mar 01, 2011 9:04 am
by Ded10c
Zax wrote:Your attention to open source makes me happy. Thank you for that, GSH.
Should indeed by useful. Thanks

Re: Mod Installer Template
Posted: Tue Mar 01, 2011 3:07 pm
by GSH
There's also
http://wix.sourceforge.net/ and
http://www.jrsoftware.org/isinfo.php , which are also free and open source for building installers. That's 3 options for people looking for installers. Just wish that others had taken the time to make a template like this; I shouldn't have to do most of the heavy lifting around here.
-- GSH
Re: Mod Installer Template
Posted: Sun Jun 19, 2011 2:17 am
by GSH
Fixed up some bugs. See
http://matesfamily.org/bz2/ModInstallerTemplate_v2.7z for a template for using NSIS (free, open source) to create a modern installer. Sample files included. Programmer art also included at no extra charge. See the readme.txt inside for how to get NSIS, and customize this template.
-- GSH
Re: Mod Installer Template
Posted: Tue Aug 30, 2011 8:14 pm
by TheJamsh
This should be stickied. Its actually bloody good.
I also suggest purchasing the Graphical Installer if you get a bit more advanced with it, it only costs $1 USD if you're a cheapskate like me, and you can pretty much re-design the installer with pretty images and whatnot.
Re: Mod Installer Template
Posted: Sat Feb 04, 2012 3:44 am
by GSH
Posted a version 3. Versions 1 & 2 used NSIS (Nullsoft Scripted Install System), but that had a single uninstall file per folder. Thus, if you had 2 mods installed using v1/v2, whichever one was installed last would always (and only) be uninstalled.
Switched to Inno Setup, which manages to create multiple uninstallers even if things are installed to the same folder. I don't have automatic uninstall of the old version running reliably, but the template shows how to nuke the old loose files directory, which should be sufficient to avoid bad assets.
-- GSH
Re: Mod Installer Template
Posted: Sun Jan 27, 2013 11:20 pm
by Zero Angel
A generic BZ2 innosetup file with slightly more advanced features including BZ2 install detection. To be used with the installer template that GSH has linked to.
Code: Select all
; -- MyMod.iss --
; Demonstrates a BZ2 mod installer with BZ2 install detection and some additional enableable features commented out.
; SEE THE InnoSetup DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
; See also the Readme.txt installed with the BZ2 ModInstallerTemplate
#define MyAppName "My Mod"
#define MyAppVersion "Alpha 1"
#define MyAppPublisher "A Battlezone 2 Modder"
#define MyAppURL "http://bzforum.matesfamily.org"
[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={{82B2BA27-13A8-4CA6-88F2-C341D45BFDB6}
; Note for BZ2 Installer Creators: It is HIGHLY recommended that you run
; [ Inno Script -> Insert GUID ] inside of the InnoIDE program to generate
; a unique GUID for your mod installer (CHANGE THE GUID SHOWN IN THE ABOVE
; APPID ENTRY, IT IS SHOWN ONLY AS AN EXAMPLE).
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={reg:HKLM\Software\Activision\Battlezone II,Install121Dir|{pf32}\Battlezone II}
DefaultGroupName=Battlezone II\{#MyAppName}\
UninstallDisplayIcon=un_install.ico
; Where the Inno Setup Compiler writes the installer exe that was made. By default, place in same directory as .iss file
OutputDir=.
SetupIconFile=install.ico
OutputBaseFilename=MyModSetup
DirExistsWarning=no
Compression=lzma2
SolidCompression=yes
; Prevent installer from trying to append extra folders onto the chosen install directory.
AppendDefaultDirName=false
; Where to put the uninstaller.
UninstallFilesDir={win}\Installer
; Uncomment below line if you want to disallow creation of start menu install/uninstall shortcuts
; AllowNoIcons=true
; Uncomment below line if you want to use a text file to introduce your installer/mod before the user installs it
; InfoBeforeFile=mymod-introduction.txt
; Uncomment below line if you don't want the end user to change the start menu location where the mod shortcuts go
; Doing so will get remove one (usually unnecessary) step from the installer
; DisableProgramGroupPage=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
; Install mymod.cfg to the dest
Source: "MyModFiles\mymod.cfg"; DestDir: "{app}"; Flags: ignoreversion
; Install everything under MyModAddonDir to that dest dir
Source: "MyModFiles\MyModAddonDir\*"; DestDir: "{app}\MyModAddonDir"; Flags: ignoreversion recursesubdirs createallsubdirs
; Uncomment this when you have a .pak file
; Source: "MyModFiles\mymod.pak"; DestDir: "{app}"; Flags: ignoreversion
Source: "MyModFiles\Readme - MyMod.txt"; DestDir: "{app}"; Flags: isreadme
[InstallDelete]
; Remove any previous files/folders in the install dir\MyModAddonDir folder
; Basically, the .cfg and .pak overwrite any previous install. But, the
; loose files directory needs to be cleaned out to help reduce the chance
; of bad assets.
Type: filesandordirs; Name: "{app}\MyModAddonDir"
[Messages]
SetupWindowTitle=Setup - %1 - {#MyAppVersion}
SelectDirBrowseLabel=If this is the Battlezone II folder you would like to install {#MyAppName} in, click Next. Otherwise click Browse to select a different Battlezone II folder.
[Icons]
; Create Desktop Shortcut
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\bzone.exe"; Parameters: "/config mymod.cfg";
; Create Start Menu icons
Name: "{group}\Battlezone II with {#MyAppName}"; Filename: "{app}\bzone.exe"; Parameters: "/config mymod.cfg"
Name: "{group}\Battlezone II (editor) with {#MyAppName}"; Filename: "{app}\bz2edit.exe"; Parameters: "/config mymod.cfg"
[Code]
{ Below code warns end user if he tries to install into a folder that does not contain bzone.exe. Useful if user tries to install into addon or any non-BZ2 folder. }
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Log('NextButtonClick(' + IntToStr(CurPageID) + ') called');
case CurPageID of
wpSelectDir:
if not FileExists(ExpandConstant('{app}\bzone.exe')) then begin
MsgBox('Setup has detected that that this is not the main program folder of a Battlezone II install, and the created shortcuts to launch {#MyAppName} will not work.' #13#13 'You should probably go back and browse for a valid Battlezone II folder (and not any subfolders like addon).', mbInformation, MB_OK);
end;
wpReady:
end;
Result := True;
end;
Re: Mod Installer Template
Posted: Mon Jan 28, 2013 12:41 am
by Zero Angel
Below is the innosetup file for VSR Beta 4.2. The above template I made was based on this one but designed to work with the files that GSH included with his template.
Code: Select all
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "VSR Recycler Variant"
#define MyAppVersion "Beta 4.2"
#define MyAppPublisher "David Bobb"
#define MyAppURL "http://www.bz2maps.us"
#define MyAppInternalName = "vsr"
#define MyAppShortVersion = "beta4.2"
[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={{82B2BA27-13A8-4CA6-88F2-C341D45BFDB6}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={reg:HKLM\Software\Activision\Battlezone II,STInstallDir|reg:HKLM\Software\Activision\Battlezone II,Install121Dir|{pf32}\Battlezone II}
DefaultGroupName=Battlezone II
AllowNoIcons=true
InfoBeforeFile=VSR Installer Files\VSR Release Notes.txt
OutputDir=vsr-installer
OutputBaseFilename=vsr-{#MyAppShortVersion}-setup
Compression=lzma/Max
DirExistsWarning=no
SolidCompression=true
AppendDefaultDirName=false
DisableProgramGroupPage=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "VSR Installer Files\*"; DestDir: "{app}"; Excludes: "*.xsi,*.tga,*.png,*.pic,*~,*.bmp"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[InstallDelete]
; Delete files from the old VSR testing folder when upgrading
Name: "{app}\vsr-testing"; Type: filesandordirs;
; Delete old prerelease shortcuts
Name: "{userdesktop}\VSR Private Beta.lnk"; Type: files;
Name: "{userdesktop}\VSR Beta ? Pre ?.lnk"; Type: files;
Name: "{userdesktop}\VSR Beta ? Pre ??.lnk"; Type: files;
Name: "{userdesktop}\VSR Beta 4 Release Candidate.lnk"; Type: files;
Name: "{app}\addon\VSR Variant"; Type: filesandordirs;
Name: "{app}\addon\VSR"; Type: filesandordirs;
Name: "{app}\addon\missions\multiplayer\VSR Maps\STDusk\Assets\T80.dxtbz2"; Type: filesandordirs;
Name: "{app}\addon\missions\multiplayer\VSR Maps\STStoneCircle\Assets\sky29.dxtbz2"; Type: filesandordirs;
Name: "{app}\addon\autoreg\ivrecyvsr.autoreg"; Type: files;
[UninstallDelete]
; Uninstaller will automatically remove files added by the installer
[Messages]
SetupWindowTitle=Setup - %1 - {#MyAppVersion}
SelectDirBrowseLabel=If this is the Battlezone II folder you would like to install VSR in, click Next. Otherwise click Browse to select a different Battlezone II folder.
WelcomeLabel2=This will install {#MyAppName} {#MyAppVersion} on your computer.%n%nIt is recommended that you close any running Battlezone II installations before continuing.
[Icons]
; We use a 'testing' shortcut only for pre-release versions of VSR.
; Name: "{userdesktop}\VSR {#MyAppVersion}"; Filename: "{app}\bzone.exe"; Parameters: "/nointro /config vsr-testing.cfg";
[Run]
; Uncomment below if you want the installer to give the end user the option to launch the mod at the 'installation complete' screen.
Filename: "{app}\bzone.exe"; Parameters: "/nointro"; Description: "Launch Battlezone II"; Flags: nowait postinstall skipifsilent
[Code]
{ Below code warns end user if he tries to install into a folder that does not contain bzone.exe. Useful if user tries to install into addon or any non-BZ2 folder. }
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Log('NextButtonClick(' + IntToStr(CurPageID) + ') called');
case CurPageID of
wpSelectDir:
if not FileExists(ExpandConstant('{app}\bzone.exe')) then begin
MsgBox('Setup has detected that that this is not the main program folder of a Battlezone II install, and the created shortcuts to launch {#MyAppName} will not work.' #13#13 'You should probably go back and browse for a valid Battlezone II folder (and not any subfolders like addon).', mbError, MB_OK);
end;
wpReady:
end;
Result := True;
end;