View Full Version : Ask for sourcepath.
Choum
26th March 2012, 14:22
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
MSG
26th March 2012, 20:15
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/Modern%20UI%202/Readme.html
Choum
26th March 2012, 21:32
Thanks
Choum
27th March 2012, 10:39
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.
Yathosho
27th March 2012, 10:45
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 (http://nsis.sourceforge.net/IsWritable)
Choum
27th March 2012, 11:06
"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.
MSG
27th March 2012, 11:43
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
Choum
29th March 2012, 09:48
I finally use this kind of code with GetDrives
http://forums.winamp.com/showthread.php?t=316729
Thanks
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.