|
|
#1 |
|
Junior Member
Join Date: Nov 2011
Posts: 2
|
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! Last edited by devguy; 13th November 2011 at 18:51. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
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...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2011
Posts: 2
|
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" "" |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|