Old 26th March 2012, 14:22   #1
Choum
Junior Member
 
Join Date: Mar 2012
Posts: 5
Ask for sourcepath.

Hello,

I'm trying to make a script which copy some file from a random location to the folder choosen by the user.

For the moment I use $exedir as source, but this solution only works if the exe setup is in the folder of the file I want to copy.

I don't find how to ask the user to set the "sourcepath".

thanks
Choum is offline   Reply With Quote
Old 26th March 2012, 20:15   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Simply insert a second directory page. You can customize the directory page by defining MUI_DIRECTORYPAGE_TEXT_TOP etc just before you !insertmacro mui_page_directory. See MUI readme: http://nsis.sourceforge.net/Docs/Mod...02/Readme.html
MSG is offline   Reply With Quote
Old 26th March 2012, 21:32   #3
Choum
Junior Member
 
Join Date: Mar 2012
Posts: 5
Thanks
Choum is offline   Reply With Quote
Old 27th March 2012, 10:39   #4
Choum
Junior Member
 
Join Date: Mar 2012
Posts: 5
Is there a way to force a directory page to accept no writable path like a dvd-rom drive ?

Actually I can't the next button is hiden.
Choum is offline   Reply With Quote
Old 27th March 2012, 10:45   #5
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
Quote:
Originally Posted by Choum View Post
Is there a way to force a directory page to accept no writable path like a dvd-rom drive ?

Actually I can't the next button is hiden.
IsWritable
Yathosho is offline   Reply With Quote
Old 27th March 2012, 11:06   #6
Choum
Junior Member
 
Join Date: Mar 2012
Posts: 5
"A function to avoid users installing software on read-only places."

That not what I'm looking for.

I use 2 directory page (!insertmacro MUI_PAGE_DIRECTORY)

One for to let the user select the source of files to copy (DVD-Rom MEDIA)
One for the installation path.

If i select a dvd-rom drive on the first directory page, i can't continue.
Choum is offline   Reply With Quote
Old 27th March 2012, 11:43   #7
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You can use the dirverify function to implement your own directory verification, but then the next button will never be grayed (you need to throw your own error). I guess this is an installer-wide attribute, so you would need to set a variable in the DVD-directory page prefunction so that you know which page you're leaving from.
http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.1.16

But you can also just make your own custom page asking for the DVD path, using nsDialogs. http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html

Also, you could create an autodetect script that searches all drives for a specific DVD label or specific DVD files, and skip the page if the DVD is already in the drive. See also http://nsis.sourceforge.net/DVD_functions
MSG is offline   Reply With Quote
Old 29th March 2012, 09:48   #8
Choum
Junior Member
 
Join Date: Mar 2012
Posts: 5
I finally use this kind of code with GetDrives
http://forums.winamp.com/showthread.php?t=316729

Thanks
Choum 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