I know i have hardly any posts at the time of making this but trust me when i say i got plenty of experience in modding have done a little of everything but
Skinning is my primary Forte. I Will go through Step by Step very Detailed and without a giant wall of text!! i know its un-heard of in a scripting tutorial
this will Work for Everything, i will explain sending different Files to different locations in Segment 3
Want to see an Example of what im talking about First..
Check out my mod that i learned this for Nvenoms Custom Interface
Okay on with the Goods,
We Will be Scripting our Installer using something im sure all true modders will Love, i learned this because i was working on a mod, finished and releasing at the time of this post called Nvenoms Custom Interface it contained a little over 4000 Files But when installing you needed a little more than 200, why you ask...because it had !!!!!MULTIPLE CHOICE'S!!!!!!!
I Searched for eons for a proper installer that had this, i could not find any so here we go super simple (for everyone i hope)
Now Dont go opening up Nsis just yet, First we are Going to make our Script.
Start up Notepad++ and begin a new File, Our Readme/License
Type what ever you want in it dosent have to be special can be something as simple as Hello World
Once You are done Save it on your DESKTOP as ReadLNew.nsi/// .NSI Make sure you save it as that
Now We Start our Scripting Open up another new txt in Notepad++ by using File> New in the top left ( Shouldint have to say this)
;This is What your Mods Name is
Name "Your Mods Name"
;This is what the EXE that they will use to install it will be called
OutFile "Your Mods Name.exe"
;This is Were those Files will be dumped that you put in the installer
;License Text is just a base name for it;License Data is the File it will read
;This Will make it ask for Administrative Rights to overwrite any Files
;this is the end of are first Segment Always end it with a block like this
; Pages are the Second Segment Fairly short and simple for a Selection installer. Pages execute Forms (just Giberish) in order so you want to keep them just like mine. they do nifty stuff like forcing people to agree to your terms if they want Your mod
;This is the Page that executes that Readme/License That you made, And it does it first so they cant go any further without reading it
;This Opens a page you cant see, what it does is tells the program its going to be reading some Section Variables (More Giberish)
;This Tells the installer that it will be giving options instead of Forcing choice's they cant see
;This Takes are application to its Final Page Unloading are files to Said Destination and even giving an option if there override folder is somewere else
;And we end the second Segment with our Block
;The Third Segment Consists of the Files that will be unloaded into the override folder, Im guessing you already have your files in order
;The Section is what your option will be called so lets say ur doing a choice of 5 weapon packs they can install
Section "Name your choice (e.g weapon pack 1)
;This Is the directory confirmation if you change it, it will put the file somewere else, ill give you a example
SetOutPath $INSTDIR ;Sends the files to that locations you set in segment 1
;Change it to this however it will will drop the file in your modules folder
;Now we are onto were you List the files that will be compiled and eventually used, Goes just like this you must enter each file individualy in long lists depending on what folder they are going into ill give example at the end of this but for now ill just give a short one and i even have a handy trick to getting tons of file names instantly into one little text file *Yes cj is my name, and if ur wondering im 16.. i know not a big suprise*
;And just like that we are finished, to add more choices simply add a new Section and dont forget to always end with SectionEnd it closes it off so the compiler knows its ither finished or ready to move onto the next Section, dont have to end Sections with Blocks but you can if you want, if you look into Segment 4 You will see what we have done now and i will move onto compiling it with 2 easy clicks (maybe more i never actually counted):¬:
File C:\Users\CJ\Desktop\MainColors\Black\lbl_optback.t ga
File C:\Users\CJ\Desktop\MainColors\Black\lbl_optingame .tga
;Once you have yours with as many Sections as you would like save it to DESKTOP as modname.nsi//.NSI!!!!!
Open up Nsis and click Compile Nsi Script
Moving on to Segment 5 just to make things a little less Crowded
1. Recompile: it reloads your .nsi files if you have made any changes to it
2.Test Installer: Click this once your recompile has gone through, if it fails it wont allow you to click it (we will talk about errors in Tips Segment
3.Open:This is what your going to click to Open your modname.nsiFile
4.Script:> Set compressor is in there if you set it to LMZA it will squish your file down to the smalist size possible usually cutting it in half or more, will take longer depending on how good your computer is
So to Recap What your going to do to compile your mod is first use 3# and open your modname.nsiFile than you are going to let it run till the blue button #1 Goes Full Blue (allows you to click it) than once it is done you will ither get Success
or some Form of This Script has Failed if it failed Go to Tip's Segment if it succeded you will be able to click #2 Test program button and try out your application looking like this
If all went well a .EXE will be on your desktop that you can distribute to the modding community
I Know, it just keeps going on and on lol, anyways here is my tricks i used to make it through the rough times.
First of all If ur getting an error about it Not finding Files Try putting your files in a folder with no spaces
If you experienced an error while compiling it should say something at the bottom like
Error in script "C:\Users\CJ\Desktop\Nvenoms Tutorial.nsi" on line 37 -- aborting creation process
Just Link the Error in Script that it is giving you in the Thread and Your Script and ill help ya out
For Modders Wanting to Edit other Parts of Files!! As Qui-Gon Glenn informed me My Installer lacks a sense of editing .2da files and of other sorts that only TSL patcher can do.. Here is a workaround. Time for another Segment for you .2da editors *May seem pointless to some*
;Okay so you have your Script all typed up and its looks awsomly formal and contains all of your files, But for some reason you need to change a file that only TSL patcher has the capability to do But you want to keep your Options. Here is what we are going to add to the very end or Sections and it does all the Work XD
;Im Using Fraps as an example.
ExecWait '"Fraps" /i "$INSTDIR /passive'
;So how does this Help, well it can actually package a TSLpatcher you have created to edit just that .2da file into your installer and When your installer is done with unloading all of your files into Override it will open up that TSLinstaller and install your .2da data
;Now Say you want to make it so they have no choice but to install that part of your mod, we are gunna add just one string of text to it
;And that is my Workaround. Post in the thread if you need any Help.
*Works With Any .exe not just installers, However if you put a program in it to run, it wont work unless u also inclue all the files that program needs to run*
;Like So>> And i know, why go through all this if you can just use tsl patcher in the first place, Mostly Because TSL patcher dosent let us give people a choice of what they want to install, Instead it just asks them were it wants to dump tons of files they know nothing about at
In Final I Want to Say thanks for Reading and i really hope you got it, Without this my modding would have been pointless and far to complicated for anyone to want too bother with. *side note* One of the easiest Scripting languages i have ever try to learn XD