Archive: install each folder in different locations


install each folder in different locations
Hello I've been given the task of editing an existing nsis script and I am totaly new to all this and under a tight timeline constraint.

I have a layout where I have two folders: 'Data' and 'Executable'

Right now everything is getting copied to 'program files/MyCoolApp'
My section code looks something like this:

Section "MainSection" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer

File /r /x "*.nsi" ""

CreateDirectory "$SMPROGRAMS\MyCoolApp"
SectionEnd

The change I have to make is:

1) install everything in the current folder and under "Executable" folder to 'program files/MyCoolApp'

2) nstall the Data folder and all it's contents to the application data location on windows under a sub-folder 'MyCoolApp'

Can someone please help me with what needs to be changed. I would like to do both operations from inside the same section.

Thanks!


Installing to $programfiles AND appdata is problematic because of UAC, you should install the default data in $programfiles\yourapp\data or the all users profile and then your application should copy that data to the users appdata folder on first run...


OK I figured out that I can use a hidden section to perform the copy of the Data folder, something like this will work

Section -AddData
SetOutPath "c:\MyCoolApp"
SetOverwrite ifnewer
File /r Data
SectionEnd

Also with section MainSection, I just had to add a exclude rule to the File op, like so:
File /r /x Data /x "*.nsi" ""