Skip to content
⌘ NSIS Forum Archive

Ask for sourcepath.

8 posts

Choum#

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
MSG#
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
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.
Yathosho#
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
Choum#
"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#
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.


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#
I finally use this kind of code with GetDrives
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


Thanks