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

Reply
Thread Tools Search this Thread Display Modes
Old 8th November 2005, 07:37   #1
Swapan Das
Senior Member
 
Join Date: Nov 2005
Location: Kolkata (Calcutta),India
Posts: 106
How to add sub-folder with its files inside the installation folder

I want to add my sub-folder say "Samples" inside my main installation folder
(INSTDIR) say "C:\DemoTransport". my sub-folder("Samples")contains around
2o files. My current coding is installing all the files of my sub-folder
to the main installation folder ("C:\DemoTransport") only.
How can I overcome it?


Section "Complete" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "AppFolder\Transport.exe"
CreateDirectory "$SMPROGRAMS\DemoTransport"
;CreateDirectory "$SMPROGRAMS\DemoTransport\Samples"
CreateShortCut "$SMPROGRAMS\DemoTransport\DatabaseManager.lnk" "$INSTDIR\DBMngr.exe"
CreateShortCut "$SMPROGRAMS\DemoTransport\DemoTransport.lnk" "$INSTDIR\Transport.exe"
CreateShortCut "$DESKTOP\DemoTransport.lnk" "$INSTDIR\Transport.exe"
File "AppFolder\DBMngr.exe"
File "AppFolder\SFormat.TXT"
File "AppFolder\DemoTransport.chm"
CreateShortCut "$SMPROGRAMS\DemoTransport\Help.lnk" "$INSTDIR\DemoTransport.chm"
SetOverwrite try
File "AppFolder\Samples\B001.TXT"
File "AppFolder\Samples\B002.TXT"
File "AppFolder\Samples\B005.TXT"
File "AppFolder\Samples\B007.TXT"
Swapan Das is offline   Reply With Quote
Old 8th November 2005, 10:10   #2
Swapan Das
Senior Member
 
Join Date: Nov 2005
Location: Kolkata (Calcutta),India
Posts: 106
Until anyone of you help me out, I've written one crude solution for it. But please let me know the exact method.

The following example helps in creating sub-folder by the name "Samples" and copies all the reqd. files to it.

The crude solution which is working for me is :

Section "-Create Samples Folder"
CreateDirectory "$INSTDIR\Samples"
;MessageBox MB_ICONINFORMATION|MB_OK "$INSTDIR\Samples"
CopyFiles "$INSTDIR\*.FUS*" "$INSTDIR\Samples"
CopyFiles "$INSTDIR\*.XLS*" "$INSTDIR\Samples"
CopyFiles "$INSTDIR\*.BAK*" "$INSTDIR\Samples"
CopyFiles "$INSTDIR\*.INI*" "$INSTDIR\Samples"
Delete $INSTDIR\*.FUS
Delete $INSTDIR\*.XLS
Delete $INSTDIR\*.BAK
Delete $INSTDIR\*.INI
CopyFiles "$INSTDIR\Samples\Sformat.FUS" "$INSTDIR"
SectionEnd
Swapan Das is offline   Reply With Quote
Old 8th November 2005, 12:10   #3
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
You need to change the output path for the source files that would go into the Samples subdirectory:
PHP Code:
SetOutPath "$INSTDIR\\Samples"
SetOverwrite try
File "AppFolder\\Samples\\B001.TXT"
File "AppFolder\\Samples\\B002.TXT"
File "AppFolder\\Samples\\B005.TXT"
File "AppFolder\\Samples\\B007.TXT" 
Animaether is offline   Reply With Quote
Old 9th November 2005, 09:37   #4
Swapan Das
Senior Member
 
Join Date: Nov 2005
Location: Kolkata (Calcutta),India
Posts: 106
Dear Animaether,
Thanks for your help.
It worked!
Swapan Das 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