Archive: Ask for sourcepath.


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


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


Thanks


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.


Originally posted by Choum
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

"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.


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


I finally use this kind of code with GetDrives
http://forums.winamp.com/showthread.php?t=316729

Thanks