Author Topic: Packaging a Mod: Automatic Installers for End User Ease of Use  (Read 19585 times)

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
As requested a week or so ago, there's some interest in a tutorial on how to package mods so that they have an automatic installer, beyond just zipping up your setup.exe, setup.tp2, and mod folder into a .zip or .rar.  I'll explain how to do this using NSIS; the Nullsoft Super-pimp Installer System.

Here are the files you'll need.  Ones listed in italics are specific to the method of installation, and I'll go into detail further on.  The other you should be familiar with already, or can figure out easily enough.

1) setup-mod.exe
2) setup-mod.tp2
3) mod folder
4) setup-mod.bat
5) The NSIS program, from sourceforge.net
6) A mod.nsi script.

First up, the setup-mod.bat file.  This is basically just a way to get around WeiDU's inability to run setup-mod.tp2 after updating itself to a later version.

Here are the contents of an example mod:

Code: [Select]
@ECHO OFF
COPY setup-IndiNPC.exe backup-setup-IndiNPC.exe
@ECHO ON
@ECHO WeiDU has updated itself automatically.  If you aren't asked to install the mod immediately, hit 'enter' TWICE.
@ECHO OFF
setup-IndiNPC.exe --noselfupdatemsg
FC /LB1 setup-IndiNPC.exe backup-setup-IndiNPC.exe > nul
IF ERRORLEVEL 1 GOTO RETRY
GOTO DONE
:RETRY
PAUSE > nul
CLS
setup-IndiNPC.exe
:DONE
ERASE backup-setup-IndiNPC.exe

Now, don't ask me what any of this means, since Weimer wrote it, and my .bat's just consist of basic DOS commands like cd, del, and copy. ;)  But that's okay, because all you really need to do is change the "setup-IndiNPC" bits to "setup-ModName".  This .bat should be run instead of the normal setup-mod.exe file by our auto-installer, so don't forget that bit. :)

Then there's the .nsi script itself.  This is a text file that's much like a .tp2, but used by NSIS to create a self-extracting .exe file.

Here's another example, as used by the Indira mod.  I'll comment in bold on the bits that actually need to be changed around.


# [Installer Attributes]
# The bits in quotes are what your mod's name is.  This'll be displayed at the top of the setup window.
Name "The Indira NPC for BG1 Tutu"
# The outfile is what your .exe will be named.  I put v(blank).exe at the end, so I can manually enter the version number, rather than changing it in the script file all the time.  Go ahead and fill in the Caption and BrandingText to see what they do.  I haven't tried yet, but there they are, for some reason.
OutFile "IndiraNPC_v.exe"
Caption ""
BrandingText ""

# [Additional Installer Settings ]
# The following are options you can choose.  Apparently they're all default settings for NSIS except the first line, so you can do without them.  The ShowInstDetails bit will have a progress window that listed all the files as they are decompressed.
ShowInstDetails show
AutoCloseWindow false
SilentInstall normal
CRCCheck on
SetCompress auto
SetDatablockOptimize on
SetOverwrite on

# [Background Gradient]
# The background gradient is... uh, yeah, the background gradient.  Search online for some sort of html colour code.  I forget how to do it, but my installers use a dark to light green shading.  Note that FFFFFF is not it.  I just don't want people stealing my colour. ;)  I'm pretty sure FFFFFF is either pure white or pure black.
# The first number is the colour for the top of the screen.  The second is the bottom.  If they're different, there'll be a slow fade between the two.  The third number is the text colour, so it'll need to be different if you want it to be visible.

BGGradient FFFFFF FFFFFF FFFFFF

# [Files]
Section "default"
SetOutPath $INSTDIR
# This stuff is the files and folders that will be compressed in your .exe.  The /r switch means it'll copy the entire folder and its subfolders.   NOTE: When you finally run the .nsi through MakeNSISw, be sure you don't have a backup folder with files in it.  Either move them temporarily, or uninstall your mod via WeiDU before running the .nsi.
# The ExecWait bit is what will be run after all the files have been extracted.  You could use the setup-mod.exe bit here if you wanted to skip making a .bat, or you could have a readme.html, I suppose, or whatever.

File "C:\games\bgtutu\Setup-IndiNPC.tp2"
File "C:\games\bgtutu\Setup-IndiNPC.exe"
File "C:\games\bgtutu\Setup-IndiNPC.bat"
File /r "C:\games\bgtutu\IndiNPC"
ExecWait "$INSTDIR\Setup-IndiNPC.bat"
SectionEnd

# [Directory Selection]
# Not sure what this does, honestly.  I think it's superceded by the entry below.
InstallDir "$PROGRAMFILES\BG1Tutu\"

# [Finding the BGII install path]
# This will scan your registry for the BG2Main.exe entry, and thus find the path to BG2.  I'm sure BioWare has the registry keys for the other games online somewhere.  IWD and BG1 and whatnot.
InstallDirRegKey HKLM \
                 "Software\Microsoft\Windows\CurrentVersion\App Paths\BG2Main.Exe" \
                 "Path"


# DirShow show
# This is a message that will be displayed at the "choose your destination" screen.  It'll warn the end user that the path provided might be wrong.  This is probably only an issue for users who've done multiple installs (i.e. one for Tutu, one for BG2 itself).  Assuming they're literate enough to do a multiple install, they're also literate enough to know what the two paths are.  One would hope, anyways.  As the saying goes, when you make assumptions, you make an "ass" out of "u" and... um, "mumptions".
DirText "Your Baldur's Gate Tutu path has been detected.  If it's different from what's shown, you'll have to enter the path manually."

;called when the installer is nearly finished initializing
Function .onInit

;message box
# This'll display whatever you write here when the user first clicks the .exe.
MessageBox MB_YESNO "This will install The Indira NPC for BG1 Tutu. Continue?" IDYES NoAbort
Abort
NoAbort:
FunctionEnd

;called when the user hits the 'cancel' button
Function .onUserAbort
# Change the "Abort install?" to whatever you please.  Pretty self-explanatory.
MessageBox MB_YESNO "Abort install?" IDYES NoCancelAbort
Abort
NoCancelAbort:
FunctionEnd

;called when the install was successful
Function .onInstSuccess
# This whole section isn't
# Here's a critical bit.  Remember that .bat file we made earlier?  This is the file that will get run once installation is complete.  It should automatically call setup-mod.exe, and if setup-mod.exe needs to update itself, the .bat will instruct the end user to hit the enter key twice.  If you don't want to bother with the .bat step, you can put setup-mod.exe in this field, as well.

Exec "$INSTDIR\Setup-IndiNPC.bat"
FunctionEnd

#eof!


And that, as they say, is that.  There's also no need to compress the .exe, as NSIS is also a compression tool.
« Last Edit: January 26, 2005, 08:59:19 PM by Ghreyfain »
Earn Money Sleeping.

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #1 on: January 26, 2005, 05:49:57 PM »
Good stuff - nice to have a tutorial for new users.

However, the NSIS-script in the tutorial is somewhat too complicated, and some of the stuff is not really needed to make a usable .exe. I've got a working .nsi-script half as large as Ghrey's. I can even trim down the basic script with the necessary functions to 12 lines, as opposed to Ghrey's 71. I'll post that at the bottom of this tutorial. But we don't have to go that far - some of the functions I left out are rather nifty. So, I'll go through the script section by section:

Code: [Select]
# [Installer Attributes]
# The bits in quotes are what your mod's name is.  This'll be displayed at the top of the setup window.
Name "The Indira NPC for BG1 Tutu"
# The outfile is what your .exe will be named.  I put v(blank).exe at the end, so I can manually enter the version number, rather than changing it in the script file all the time.
OutFile "IndiraNPC_v.exe"
Caption ""
BrandingText ""

Here, we can drop the two last lines completely. With having [Caption ""] and [BradingText ""], the NSIS-installer will be using the default settings, so this is not necessary.

Code: [Select]
# [Additional Installer Settings ]
ShowInstDetails show
AutoCloseWindow false
SilentInstall normal
CRCCheck on
SetCompress auto
SetDatablockOptimize on
SetOverwrite on

The only thing that is not-default here is the first line; [ShowInstDetails show], which means that the details of the installing-process will be shown. If you want the user to see this, let that line remain, and delete the others, as they are unnecessary.

Code: [Select]
# [Background Gradient]
# The background gradient is... uh, yeah, the background gradient.  Search online for some sort of html colour code.  I forget how to do it, but my installers use a dark to light green shading.  Not that FFFFFF is not it.  I just don't want people stealing my colour.   I'm pretty sure FFFFFF is either pure white or pure black.
BGGradient FFFFFF FFFFFF FFFFFF

This isn't really necessary either, but provides a nice touch. As Ghrey hinted, this will set the background (i.e. cover the whole screen) with some sort of colour. To explain what Ghrey forgot, the first row of colour-code is the TOP colour, the second row of colour-code is the BOTTOM colour. So, if you have two different colours here, the first colour on top will gradient down to the second colour at the bottom. The third row of colour-code is the colour of the TEXT viewed (by default in the upper left corner). The text is the same as the [Name] from the beginning of the script, i.e. The Indira NPC for BG1 Tutu for this tutorial.

If you don't add this line, there will be no background, and only the little grey box containing all the necessary info will be show. It's just a matter of preference.

Code: [Select]
# [Files]
Section "default"
SetOutPath $INSTDIR
# This stuff is the files and folders that will be compressed in your .exe.  The /r switch means it'll copy the entire folder and its subfolders.   NOTE: When you finally run the .nsi through MakeNSISw, be sure you don't have a backup folder with files in it.  Either move them temporarily, or uninstall your mod via WeiDU before running the .nsi.
File "C:\games\bgtutu\Setup-IndiNPC.tp2"
File "C:\games\bgtutu\Setup-IndiNPC.exe"
File "C:\games\bgtutu\Setup-IndiNPC.bat"
File /r "C:\games\bgtutu\IndiNPC"
SectionEnd

This section is rather important. Leave it as it is. :)

Code: [Select]
# [Directory Selection]
# Not sure what this does, honestly.  I think it's superceded by the entry below.
InstallDir "$PROGRAMFILES\BG1Tutu\"

As Ghrey suggests, this is superceded by the next section. Cut.

Code: [Select]
# [Finding the BGII install path]
# This will scan your registry for the BG2Main.exe entry, and thus find the path to BG2.  I'm sure BioWare has the registry keys for the other games online somewhere.  IWD and BG1 and whatnot.
InstallDirRegKey HKLM \
                 "Software\Microsoft\Windows\CurrentVersion\App Paths\BG2Main.Exe" \
                 "Path"

I've used [InstallDirRegKey HKLM "SOFTWARE\Microsoft\DirectPlay\Applications\Baldur's Gate2" "Path"] instead of searching for BG2Main.exe. They do the exact same thing, they both find the BGII-dir, only mine's a bit shorter. :)

Code: [Select]
# DirShow show
# This is a message that will be displayed at the "choose your destination" screen.  It'll warn the end user that the path provided might be wrong.  This is probably only an issue for users who've done multiple installs (i.e. one for Tutu, one for BG2 itself).  Assuming they're literate enough to do a multiple install, they're also literate enough to know what the two paths are.  One would hope, anyways.  As the saying goes, when you make assumptions, you make an "ass" out of "u" and... um, "mumptions".
DirText "Your Baldur's Gate Tutu path has been detected.  If it's different from what's shown, you'll have to enter the path manually."

Not much to say here, either. If you leave this out, the installer won't ask for a directory, but install to the default install-directory immediatly. So, please - do - not - remove - this. :)

Code: [Select]
;called when the installer is nearly finished initializing
Function .onInit

;message box
# This'll display whatever you write here when the user first clicks the .exe.
MessageBox MB_YESNO "This will install The Indira NPC for BG1 Tutu. Continue?" IDYES NoAbort
Abort
NoAbort:
FunctionEnd

One of those nifty functions I talked about earlier. Keep it. Not vital, however.

Code: [Select]
;called when the user hits the 'cancel' button
Function .onUserAbort
# Change the "Abort install?" to whatever you please.  Pretty self-explanatory.
MessageBox MB_YESNO "Abort install?" IDYES NoCancelAbort
Abort
NoCancelAbort:
FunctionEnd

Also an useful function, however less nifty than the previous. Definently not necessary, though.

Code: [Select]
;called when the install was successful
Function .onInstSuccess
# Here's a critical bit.  Remember that .bat file we made earlier?  This is the file that will get run once installation is complete.  It should automatically call setup-mod.exe, and if setup-mod.exe needs to update itself, the .bat will instruct the end user to hit the enter key twice.  If you don't want to bother with the .bat step, you can put setup-mod.exe in this field, as well.
Exec "$INSTDIR\Setup-IndiNPC.bat"
FunctionEnd

Critical bit? Yes. Has to be done this way? No.

This is how I do it; instead of putting this in a new function, I put the [Exec "$INSTDIR\Setup-IndiNPC.bat"] in the Section we previously had called "Default". Remember that one, with all the files? Yes, there. The difference is little, but noticeble: With Ghrey's .onInstSuccess-function, the installer will execute the .bat when the user presses "Close" on the installer. With my method, the installer will execute it right after it has copied all the files over to the game-directory. It's really just a matter of preferences. My way is simpler, shorter and makes it feel as if the WeiDU-installation is a part of the general installation, i.e. the IndiraNPC_v.exe-installation. So, I've chosed to do it my way. :)

While we're on it, there's three another optional functions I'd like to recommend, that Ghrey hasn't brought up. First, we have:

Code: [Select]
LicenseText "Readme:"
LicenseData readme.txt

I've usually put this after the OutFile-entry.

This opens up a nice little 'Licence'-box, where the text from readme.txt is displayed, and the user must press an 'I agree'-button before they can proceed. Great for showing shorter readme's or other instructions.

Then, we have:

Code: [Select]
ComponentText "This will install the following features on your computer."
This, I usually put after the Licence-stuff.

Now, what does this do? Well, it creates a checklist with all the different [Sections] we have in the script. This is very useful for larger scripts with different optional sections. To put it short, the user can check and uncheck the different contents of the installer, and choose what to install. The name displayed will be what Ghreyfain has named "default", in other words the word or sentenced specified after the [Section] in the script.

Then, we have:

Code: [Select]
MessageBox MB_OK "Woooo!!! Install successful!!! Enjoy!!!"
Put this after the [Exec "$INSTDIR\Setup-IndiNPC.bat"] if you have this line in a section (as I described above), or in an .onInstSuccess-function.

This will show a nice little messagebox with an "Okay"-button saying "Woooo!!! Install successful!!! Enjoy!!!" when the install is complete.

Naturally, there's a lot of more available functions and features and other fun and usefull stuff. But this is the basics. ;)

So, to move on to the 12-lined script I promised earlier. This is a basic script covering all the necessary stuff for the installer. All other things are optional and not really needed, this is enough to get a working installer. :)

Code: [Select]
Name "SConrad's supermod with a NSIS-installer!"
OutFile "Foo.exe"
DirText "Choose your game directory:"
InstallDirRegKey HKLM "SOFTWARE\Microsoft\DirectPlay\Applications\Baldur's Gate2" "Path"
Section "default"
  SetOutPath $INSTDIR
  File /r "Foo"
  File "Setup-Foo.exe"
  File "Setup-Foo.tp2"
  File "Setup-Foo.bat"
  ExecWait "$INSTDIR\SETUP-Foo.bat"
SectionEnd

Note that in order to get this script to be functional by NSIS, you must put the .nsi-script in the same folder as where you have all the files, and then run the script with the MakeNSISW from that location. :)

Now, what will this little thing do?

Well, when the user clicks the Foo.exe, they will be asked to specify their game-directory, with the one from the registry as default. When they click 'Install', the installer will copy over all files to the game-directory and then automatically execute the .bat-file. The WeiDU-installation will follow, and when that is done, all that is left is the NSIS-installer, which will say 'Completed' and the user can close it. Install is finished!

Do you really, desperatly, need anything more than that?
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #2 on: January 26, 2005, 09:07:17 PM »
Okay, I've made a few changes that you've touched upon, mainly the bit about where setup-mod.bat should be called from.  I didn't realise it could be done in a Section block, since back in the day I'd just used some front-end program to populate the .nsi for me automatically, edited out a few bits that I didn't need/want, and stuck with that.

Haven't put in anything on LicenseText "Readme:", LicenseData readme.txt, orComponentText "This will install the following features on your computer.", since I don't know how they work, and you didn't put them in your example script at the end of the post.
Earn Money Sleeping.

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #3 on: January 26, 2005, 09:32:36 PM »
Okay, I've made a few changes that you've touched upon, mainly the bit about where setup-mod.bat should be called from.  I didn't realise it could be done in a Section block, since back in the day I'd just used some front-end program to populate the .nsi for me automatically, edited out a few bits that I didn't need/want, and stuck with that.
Well, you probably did this a long time ago when the new functions of NSIS hadn't been made yet. ;)

Haven't put in anything on LicenseText "Readme:", LicenseData readme.txt, orComponentText "This will install the following features on your computer.", since I don't know how they work, and you didn't put them in your example script at the end of the post.
I'll post an example of a KotOR-mod I packaged with NSIS waaay back:

Code: [Select]
Name "KOTOR PC Customization Pack IV v1.0"

OutFile "PCCustPackIV.exe"

LicenseText "Readme:"
LicenseData readme.txt

ComponentText "This will install the KOTOR PC Customization Pack IV to your computer."
DirText "Choose your KOTOR game directory:"

InstallDirRegKey HKLM SOFTWARE\BioWare\SW\KOTOR "Path"

Section "KOTOR PC Customization Pack IV"
  SetOutPath $INSTDIR
  File /r "CustPackIV_temp"
  File "kiss.exe"
  File "createuninstaller.exe"
  File "custpackiv.ks"
  File "installcp4.bat"
  ExecWait "$INSTDIR\installcp4.bat"
  ExecWait "$INSTDIR\createuninstaller.exe"
  Delete "$INSTDIR\kiss.exe"
  Delete "$INSTDIR\createuninstaller.exe"
  Delete "$INSTDIR\custpackiii.ks"
  Delete "$INSTDIR\installcp4.bat"
  MessageBox MB_OK "Make sure to keep a close eye on http://kotor.spellholdstudios.net for the next packs!"
SectionEnd

In this example, the text I've put into readme.txt will be shown in the License-window, with 'Readme:' as title.

The ComponentText will be shown when the user has the option to choose the different components. Here, there's only one component, but in the event of multiple components, you'll just add multiple sections in the script. The component-name will be the one you specify in the scrip; [Section "KOTOR PC Customization Pack IV"].
« Last Edit: July 01, 2005, 08:16:04 AM by Bons »
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #4 on: January 27, 2005, 05:03:32 AM »
It bears repeating here that Mac-users cannot even extract a mod in this type of installer.  An optional .zip or .rar installer would be nice (at least until a Mac version is available).

Offline igi

  • IESDP Guardian
  • Planewalker
  • *****
  • Posts: 124
  • IESDP Guardian
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #5 on: January 27, 2005, 07:13:46 AM »
As well as saying "Mr. User, just double click this", it's now being advocated '"Mr Modder, just run this, to let Mr User just double click that".
Even Ghrey, who posted the initial post, didnt understand what it all did. Great.

And people say the world is dumbing down...
NPC: Arg || Galoomp || Thash
Mods: Dark Heart of the Xvart || GbG
Tweak Pack: iiTweak

mcwrench.com
mcwrench.com forums

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #6 on: January 27, 2005, 11:27:20 AM »
It bears repeating here that Mac-users cannot even extract a mod in this type of installer. An optional .zip or .rar installer would be nice (at least until a Mac version is available).

Yeah, I thought about that, too, but figured if someone wanted to make a Mac installer they could just contact the creator or whatever.  Then I realised that the Mac person might just be wanting to play the mod, so, heh.  Yes, make sure there are .zips/.rars available, too, then.

Quote
And people say the world is dumbing down...

Doesn't seem to be getting any more tactful or honest, either.  Go humanity!
Earn Money Sleeping.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #7 on: January 27, 2005, 11:31:53 AM »
We could just publish our mods as reams of type-in hex codes, like the 8-bit computer magazines of old did.

But I'm guessing most people would rather have a nice, smooth path between "downloading a mod" and "playing a mod."
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #8 on: January 27, 2005, 11:35:44 AM »
Hehehe!  I remember when I was just a wee tyke my dad had to do something like that to install Miss Pacman on our Apple II.  Good times, good times.  Maybe igi's right.  People enjoyed things more when they required hours and hours of cursing and frustration and hair-pulling and then more cursing.  (Is that the appeal of-- Okay, never mind, I've decided to take a dose of my own medicine and be tactful enough not to bring even more people into this.  Damn, it's bitter-sweet.)

Oh, oh, and I think pilots should have to build their own jets before they can fly them!  And people should just shout back and forth if they don't understand the internal workings of a phone!  Yeah!
Earn Money Sleeping.

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #9 on: January 27, 2005, 11:55:37 AM »
As well as saying "Mr. User, just double click this", it's now being advocated '"Mr Modder, just run this, to let Mr User just double click that".
Even Ghrey, who posted the initial post, didnt understand what it all did. Great.

Well, to Ghrey's defense, he said that he didn't really set out to write a tutorial, just to post some templates. If there's interest for a more thorough tutorial, I could take a few hours and write it. :)
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

Offline igi

  • IESDP Guardian
  • Planewalker
  • *****
  • Posts: 124
  • IESDP Guardian
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #10 on: January 27, 2005, 12:59:10 PM »
We could just publish our mods as reams of type-in hex codes, like the 8-bit computer magazines of old did.

Yes. Because that's almost identical to learning how to use a basic utility and some simple concepts about compression, isnt it?
NPC: Arg || Galoomp || Thash
Mods: Dark Heart of the Xvart || GbG
Tweak Pack: iiTweak

mcwrench.com
mcwrench.com forums

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #11 on: January 27, 2005, 01:08:38 PM »
In this situation, yes.  Neither one is necessary in any way for the end-user, if all they want is to install and play the mod.  What exactly is your argument against auto-installers, anyways?  Beyond how knowledge of winzip should be a learning experience that should apparently be taught alongside math and grammar in school.
Earn Money Sleeping.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #12 on: January 27, 2005, 07:43:04 PM »
Honestly, it seems that most, if not all, of the people so against things like NSIS setups are modders.  Frankly, I make mods for players.  I don't give a damn if the modder is miffed at the installation routine.  :)
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #13 on: February 19, 2006, 10:52:26 AM »
The .bat file has been improved in that the user doesn't need to press enter before really starting the setup:

Code: [Select]
@echo off
echo "The setup program is updating itself, please be patient..."
Setup-Xan.exe --update-all > nul
cls
echo "some_string" | pause > nul
Setup-Xan.exe

"some_string" may be replaced with any string of your choice, EG
echo "setup-gbg --uninstall" | pause > nul
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #14 on: March 23, 2008, 06:31:59 AM »
Update: since Weidu 204, the .bat script above is redundant. All you need is a link to Setup-Yourmod.exe.

And another goodie: thanks to the_bigg, here's a brand new way of installing your audio, currently used in Assassinations. This way, Weidu will not fill your .debug file with "Unable to unlink" errors on uninstall.

Code: [Select]
@echo off
cd MyMod\Audio
oggdec a#cr*.ogg
move *.wav ..\..\override


Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #15 on: May 21, 2008, 02:51:36 AM »
I have a question - I think it will be useful for other IWD modders, as well: how do I find IWD path? And will it differ for HoW/TotL/non-HoW installs?

Code: [Select]
# [Finding the BGII install path]
# This will scan your registry for the BG2Main.exe entry, and thus find the path to BG2.  I'm sure BioWare has the registry keys for the other games online somewhere.  IWD and BG1 and whatnot.
InstallDirRegKey HKLM \
                 "Software\Microsoft\Windows\CurrentVersion\App Paths\BG2Main.Exe" \
                 "Path"

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #16 on: May 21, 2008, 07:03:51 AM »
According to Weimer (WeiDU/src/reg.c),

CAMLprim value get_bg2main_path(void)
{
  result = RegQueryValueA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\BG2Main.Exe", buf, &size);
}

CAMLprim value get_bgmain_path(void)
{
  result = RegQueryValueA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\BGMain.Exe", buf, &size);
}

CAMLprim value get_iwdmain_path(void)
{
  result = RegQueryValueA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\IDMain.Exe", buf, &size);
}

CAMLprim value get_pstmain_path(void)
{
  result = RegQueryValueA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Torment.Exe", buf, &size);
}

CAMLprim value get_iwd2main_path(void)
{
  result = RegQueryValueA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\IWD2.Exe", buf, &size);
}
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #17 on: May 21, 2008, 07:13:55 AM »
Oh! Thanks. Will test as soon as we finish with Teri and Nella. :)

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #18 on: March 02, 2013, 03:29:33 AM »
An important point about subfolders I have discovered only today, thanks to Silent:
If you put
File /r "C:\Games\BGII\Folder"
into your .nsi script, it may take ALL subfolders with the name Folder, no matter how deep they are. For example, Coran NPC(Folder=Coran) accidentally took RE/Coran subfolder into itself. So be careful which folders you have in the main BG2 directory while NSIS-packaging.

And, naturally, since NSIS is rather dormant right now, all links to a new self-extracting software with a pretty screen that would automatically unpack into BG2 directory are also welcome.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #19 on: June 23, 2013, 07:38:28 AM »
And there's a new update for NSIS - v3, updated on May 19, 2013.
http://nsis.sourceforge.net

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #20 on: July 31, 2013, 01:34:26 AM »
Another update on NSIS on July 14th - quite useful, since I'm going to repackage Assassinations and package new Xan/RE/Sellswords/another mod.
http://nsis.sourceforge.net/Download

Incidentally, Happy Harry Potter Day!

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #21 on: February 21, 2014, 12:28:18 AM »
Now that we've got BG2EE and BG2EE versions of the mods for our players, I've been wondering - is it possible to make NSIS install the mod straight into BG2EE directory? And is it possible to insert several regpaths to NSIS installer, so it could choose BG2EE or BG2(if BG2EE isn't installed and regular good old BG2 is)?

Offline The Imp

  • Planewalker
  • *****
  • Posts: 203
  • Gender: Male
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #22 on: February 22, 2014, 05:23:01 PM »
Now that we've got BG2EE and BG2EE versions of the mods for our players, I've been wondering - is it possible to make NSIS install the mod straight into BG2EE directory? And is it possible to insert several regpaths to NSIS installer, so it could choose BG2EE or BG2(if BG2EE isn't installed and regular good old BG2 is)?
You know, you could just go and package the mods to a .zip format as the unarchiving tool comes in all the Windows'es... and you wouldn't need to package them into hostile combat formats. The Assassinations_v10.zip package is probably the stupidest packaged mod ever... why is it packaged in a two layers ? The two readme's ... the one should be in the mod folder and opened with the .tp2 action at the start of the install if so desired ... its saving grease is that it doesn't contain an ALWAYS block. Including one in a NSIS installer is a capital offense. Well, unless it's there just to make sure the weidu.exe is updated, but for anything else... it's like a death sentence.

There are particular reasons why the site upload tools only accept particular file formats... one is that the programs that a browser uses to autorun the downloaded files can be set, but it can also get autoset which leads to bad situations when the program is not user selected. One particular case involved the Fallout Mod Manager for cheese sake.
« Last Edit: February 23, 2014, 02:32:29 AM by The Imp »

Offline Creepin

  • Planewalker
  • *****
  • Posts: 128
  • Gender: Male
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #23 on: April 08, 2014, 03:49:49 PM »
Umm... is it a right place to ask to please, pretty please with cherry on top not to package mods in anything but rar/zip? :)

I just hate so much that when I want to simply doubleclick the archive and check the readme or read tp2 or just drag-n-drop mod to already opened window I'm forced instead first bother to create a dummy folder, then bother to show mod installer the path thereto, then had to wait while all the occasional oggdecs that might be included run their course, then I had to further bother to find that dummy folder and only then I could finally had my readme! Oh, and if I just wanted to unpack the mod to the game folder, then add manually erasing debug file created by forced and obviously aborted install attempt, and only then am I allowed to copy mod content to where I wanted it in the first place :( Compare this abomination with standard rar archive: doublclick, ctrl-a, drag-n-drop.

BTW, the topic name is hilarious: "End User Ease of Use", really? ;D

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6232
  • Gender: Female
  • The perfect moment is now.
Re: Packaging a Mod: Automatic Installers for End User Ease of Use
« Reply #24 on: April 08, 2014, 04:12:04 PM »
Remember, you're not supposed to be a clever person who's capable of reading .tp2 files. :) The "non-modder" end user just clicks the exe file(or reads the readme first), chooses their BG2 directory and presses install - Weidu does the rest. Um, I think.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: