Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 18th January 2011, 08:18   #1
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
How to install in more directories with one installer/one script?

Hey,

At first i am new at using NSIS codes, and i have been trying it out in one day, this is my second day using it so there is a lot i still do not understand!

I work for a firm who has asked me to try and make an installer to an application we have made, it's a application that need files placed some different places on the computer.

I have tried my way, but have not been able to find a solution to my problem, i found this but that is way to advanced for me i really do not understand it, http://nsis.sourceforge.net/Two_inst..._one_installer....

Is there a more easy way to do it, at this point i have made the simple tutorials from NSIS Wiki, and i had an idea that you could make something with the sections, maybe split them up with different installDIRs like this:
outFile "TestInstaller.exe"

section "InstallFirstDok"

installdir $DESKTOP

setOutPath $INSTDIR

file HM NIS Edit.exe

sectionEnd

section "InstallSecoundDok"

installdir $DESKTOP\TEST

setOutPath $INSTDIR

file Kaa.id

sectionEnd

section "InstallThirdDok"

installdir $PROGRAMFILES\TEST2

setOutPath $INSTDIR

file Linux projekt.docx

sectionEnd

section "InstallFourthDok"

installdir $DESKTOP

setOutPath $INSTDIR

file test.txt

sectionEnd

I know that the installdir can't be placed in the sections, but this is some of what i have tried.

If any can help me it would be a big relieve, i think it is really cool to try and program an installer but i have just hit a bump and can't find out what to do !

-Aaskilde
Aaskilde is offline   Reply With Quote
Old 18th January 2011, 09:26   #2
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
You don't need to set InstallDir before the file command.
So if you want to have the files on a fixed location:
code:
section "InstallFirstDok"
setOutPath $DESKTOP
file HM NIS Edit.exe
sectionEnd

section "InstallSecoundDok"
setOutPath $DESKTOP\TEST
file Kaa.id
sectionEnd

section "InstallThirdDok"
setOutPath $PROGRAMFILES\TEST2
file Linux projekt.docx
sectionEnd

section "InstallFourthDok"
setOutPath $DESKTOP
file test.txt
sectionEnd

If you need the user to select multiple installdirs by himself:
http://nsis.sourceforge.net/Setting_...Directory_Page
jpderuiter is offline   Reply With Quote
Old 18th January 2011, 10:25   #3
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
Okay thanks mate, i will give that a try! (:
Aaskilde is offline   Reply With Quote
Old 18th January 2011, 10:38   #4
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
Okay what you said is working correctly, but i need to include a path that goes by the Windows Registry, something like this maybe?

I have got the Registry path to work with a single file in it's own installer: $InstallDirRegKey HKLM SOFTWARE\Lotusnotes\Domino\1\ "DataPath", is it possible to include that in a section with the others?

outFile "TestInstaller2"

section "TEST1"

setOutPath $DESKTOP\TEST\TEST1

file Kaa.id

sectionEnd

section "TEST2"

setOutPath $DESKTOP\TEST\TEST2

file Linuxprojekt.docx

sectionEnd

section "TEST3"

setOutPath $DESKTOP\TEST\TEST3

file test.txt

sectionEnd

section "Regedit"

setOutPath $HKLM SOFTWARE\Lotusnotes\Domino\1\ "DataPath"

file Skype.lnk

sectionEnd
Aaskilde is offline   Reply With Quote
Old 18th January 2011, 12:06   #5
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
code:
section "Regedit"
ReadRegStr $0 HKLM "SOFTWARE\Lotusnotes\Domino\1" "DataPath"
setOutPath $0
file Skype.lnk
sectionEnd

it's all in the manual...
jpderuiter is offline   Reply With Quote
Old 20th January 2011, 09:12   #6
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
Okay thanks a lot that really helped me! I know that pretty much everything is in the manual but i don't think it is that easy to understand just how they want the code written.

I got one more question if you will; Is it possible to move directories with the installer, i got a lot of smaller files that i need the installer to unpack in some different locations, its 4 or 4 directories that i need to copy into another directory, is that possible or am i going to write code for all the single files?
Aaskilde is offline   Reply With Quote
Old 20th January 2011, 10:41   #7
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
file /r NeoDashboard43_html\*.* made it work
Aaskilde is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump