Jump to content
Sign in to follow this  
mr.g-c

NSIS - Nullsoft Installer System, or others? Advice needed!

Recommended Posts

Mr. G-c Pm me and ill help you. I cant help you with the shortcut though, only with the installer finding the correct install path of arma so it can install your files in the correct place. Not everyone has the same install path. Its kinda hard for you to understand by just putting registry keys and paths on the forums and you trying to figure out how to use it.

Share this post


Link to post
Share on other sites

Something along the lines of this could work

function GetInstallDir(def: string): string;

var

InstallDir : string;

begin

Result := 'MyDefaultInstallDir';

if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\My Software\InstallDir',

'', InstallDir) then

begin

// Successfully read the value.

Result := InstallDir;

end;

end;

The trick is to add a [Code] section.

Share this post


Link to post
Share on other sites

This would be an example for an NSIS - Script I use to deploy a patchable AddOn - Pack to my clanmates.

For the first steps I used the HM NIS Edit Script Wizard and edited the *.nsi file manually later on.

(Sorry for not wrapping the following in CODE - tags, but I would like to use some proper text formating here)

With this script I would generate a patch for a previously deployed version (v2.02) of this addon pack:

///////// code start

; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines

!define PRODUCT_NAME "COOP Pack for ACE"

!define PRODUCT_VERSION "v2.03"

!define PRODUCT_PUBLISHER "radical.ghost"

!define PRODUCT_WEB_SITE "webaddress.here"

SetCompressor lzma

; MUI 1.67 compatible ------

!include "MUI2.nsh"

; MUI Settings

!define MUI_ABORTWARNING

!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"

;!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

; Language Selection Dialog Settings

;!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"

;!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"

!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

; Welcome page

!define MUI_WELCOMEPAGE_TITLE_3LINES

;!define MUI_WELCOMEPAGE_TITLE "WelcomPage Title Text: TestTest"

;!define MUI_WELCOMEPAGE_TEXT "WelcomPage Text: TEST 123"

!insertmacro MUI_PAGE_WELCOME

; License page

!define MUI_LICENSEPAGE_RADIOBUTTONS

!insertmacro MUI_PAGE_LICENSE "License.txt"

; Directory page

!insertmacro MUI_PAGE_DIRECTORY

; Instfiles page

!insertmacro MUI_PAGE_INSTFILES

; Finish page

!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\@COOP-ACE\COOP Pack readme.txt"

!insertmacro MUI_PAGE_FINISH

; Uninstaller pages

;!insertmacro MUI_UNPAGE_INSTFILES

; Language files

!insertmacro MUI_LANGUAGE "English"

!insertmacro MUI_LANGUAGE "German"

; Reserve files

;!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"

OutFile "COOP Pack for ACE v2.02 to v2.03.exe"

InstallDir "$PROGRAMFILES\ArmA\"

;Get installation folder from registry if available

InstallDirRegKey HKLM "Software\Bohemia Interactive Studio\ArmA" "MAIN"

ShowInstDetails show

ShowUnInstDetails show

Function .onInit

!insertmacro MUI_LANGDLL_DISPLAY

FunctionEnd

Section "Hauptgruppe" SEC01

; Check if Directory "@ACE" exists, if yes go to 'CheckPreviousVersion', if no go to 'ACEmissing'

IfFileExists "$InstDir\@ACE\*.*" CheckPreviousVersion ACEmissing

CheckPreviousVersion:

; Check if Directory "@COOP-ACE" exists already. If yes go to 'DirExists', if no go to 'InstallMod'

IfFileExists "$InstDir\@COOP-ACE\*.*" CheckVersionFile DirMissing

CheckVersionFile:

; Check the name of the *.ver - file that should be found inside the AddOns - directory (I put it there in previous deployments of the pack) if filename differs or file does not exist, go to 'WrongPreviousVersion' else go to 'Patch'.

IfFileExists "$InstDir\@COOP-ACE\addons\_v2.02.ver" Patch WrongPreviousVersion

Patch:

; Install files and directories, then go to 'End'

SetOverwrite on

SetOutPath "$INSTDIR\@COOP-ACE\addons\"

; here we go and replace the old *.ver file with the newer one

delete "$InstDir\@COOP-ACE\addons\_v2.02.ver"

File "addons\_v2.03.ver"

; here we delete obsolete files from our pack

delete "$InstDir\@COOP-ACE\addons\obsoleteaddon.pbo"

delete "$InstDir\@COOP-ACE\addons\obsoleteaddon.pboCOOP_ACE.bisign"

; now we add a new addon to our pack

File "addons\addon1.pbo"

File "addons\addon1.pbo.COOP_ACE.bisign"

; this is for adding the new readme file to a different directory

SetOutPath "$InstDir\@COOP-ACE\docs\"

File "docs\AddOn1 readme.txt"

SetOutPath "$INSTDIR\@COOP-ACE\"

delete "$InstDir\@COOP-ACE\COOP Pack readme.txt"

File "COOP Pack readme.txt"

Goto End

ACEmissing:

; Create Message with Yes und No - Option. Click on Yes: go to 'CheckPreviousVersion', click on No: go to 'Abort'

MessageBox MB_YesNo|MB_IconExclamation "Directory @ACE not found, ACE - Mod v1.01 installation is mandatory for proper function of the COOP Pack. Proceed anyways?." IDYes CheckPreviousVersion IDNo Abort

DirMissing:

; Create Message with 'OK' - Button, then go to 'Abort'

MessageBox MB_Ok|MB_IconExclamation "Directory @COOP-ACE not found, COOP Pack v2.02 needed for patch installation."

Goto Abort

WrongPreviousVersion:

; Create Message with 'OK' - Button, then go to 'Abort'

MessageBox MB_Ok|MB_IconExclamation "Wrong COOP Pack version detected. COOP Pack v2.02 needed for patch installation."

Goto Abort

Abort:

quit

End:

SectionEnd

///////// code end

thanks for your attention,

r:g

Edited by radical.ghost

Share this post


Link to post
Share on other sites

However Snakeman's reaction is a bit overreacting, he has a point.

I dont like installers to do some simple task as copying a few files to my arma, and then cluttering my start menu with shortcuts and putting stuff in the register and uninstall menu.

Its fine if there are two versions of a mod, or if its unpackable by winrar or smth. But its very unfriendly for the more experienced users to make it mess up your system without an alternative.

And Professional/unprofessional isnt important here. ACE mod for example has the installer so the less capable players can install it and the ACE mod gets more popular. Its just an additional effort to support the mod. Shame there isnt a clean pbo download...

And yoma, the comparision with applications isnt valid, since most times they need registery components installed to work, wich the installer creates. ArmA addons certainly dont need any other than a mod folder.

Share this post


Link to post
Share on other sites
NSIS exe can simply be extracted with 7z in addition to install..

Reading isnt THAT hard. :D

Share this post


Link to post
Share on other sites

IMO;

Installers for singular or small compilations of Addons is basically unnecessary, fully agreed.

I can also find myself in wanting to unpack things manually and have control over things; But this is for medium/advanced users. Not for beginners/peeps that just play a game once a while.

Installers become useful when you have bigger compilations of Addons.

Community Server Mod Packs are great with installer and updater; why have 50 players screw around with rar packages, manual operations, -mod line shortcuts, manual this, manual that, while you can simply push a button 'update'?

It's basically also a method of reducing support; 6thSense.eu Gaming Community Mod Management, Updating etc etc has saved about 95% of all the work when we switched to Installer/Updater combo.

Installers I use can be unpacked with 7zip, so for 'advanced' users, there is no downside of having an installer. Unless someone wants to claim that the added 300 KB of the installer, weighs *anything* compared to the 400 MB data that was included.

Shorcuts are optional. Registry adjustments can be made also; don't want to use it? Then don't use it :)

Unfortunately Sickboy don't answer me for some reason....:(
Extremely busy as usual. If you like I can send you the installer.nsi. One issue though; I have no time to support you whatsoever.

Share this post


Link to post
Share on other sites

Yes Sickboy, that would be great! Thanks!

Also Thanks to Radical.Ghost!

Share this post


Link to post
Share on other sites
Reading isnt THAT hard. :D

I read it and tested it with winrar on the ACE installer, wich didnt work so I assumed 7zip couldnt do that either.

Share this post


Link to post
Share on other sites
NSIS exe can simply be extracted with 7z in addition to install

http://www.7-zip.org/ :D

Haven't used winrar for ages. winrar is commercial and 7z does the job very well.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×