|
|
#1 |
|
Junior Member
Join Date: Aug 2010
Posts: 44
|
Destination Folder
I have enabled MUI_PAGE_DIRECTORY to allow the Destination folder to be set, however my problem is I want to only allow the Drive letter of the directory to change not the folder name.
How can this be done? thanks, |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,839
|
A very dirty solution would be to StrCpy $INSTDIR $INSTDIR 2 , but that's guaranteed to go wrong at some point: If the user enters a network path, for example. You could create a custom page with for example a dropdown select box, and populate that by enumerating all results from kernel32::GetLogicalDrives. See here for an example implementation.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2010
Posts: 44
|
So I shouldn't be using the MUI_PAGE_DIRECTORY at all then?
|
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,839
|
If you're going to create a custom page then yes, you wouldn't use the directory page. If you want to use the directory page anyhow, you're probably interested in the GetRoot macro in filefunc.nsh.
|
|
|
|
|
|
#5 |
|
Senior Member
|
Create custom page using nsDialogs like this:
![]() But do not create a Browse button as me and set EditBox for ReadOnly User can select drive in box below path which changes the first letter only, not the whole path. Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.sk Develop NSIS projects directly in Visual Studio 2005-2012: www.unsigned-softworks.sk/visual-installer/ |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Aug 2010
Posts: 44
|
Any code examples?
|
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
There are eight example scripts in the ListView Header zip file which can be found here:
http://nsis.sourceforge.net/Header_file_for_Listview Here is a screenshot from a very slightly modified version of the example.nsi script in that zip file: |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Aug 2010
Posts: 44
|
Yeah I think that one you attached pengyou is what I am looking for minus the browse button.
|
|
|
|
|
|
#9 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
You can remove the browse button quite easily - just delete some lines from the example script.
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Aug 2010
Posts: 44
|
Thanks, exactly what I was looking for, great help!
|
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Oct 2007
Location: Xi'an, China
Posts: 192
|
Examples have been update again just now, please download the latest ones.
An NSIS fan from China, my name is Jia Ke (pinyin). Email: jiake@vip.qq.com Messenger: jiake@live.in QQ (Chinese IM): 550771955 |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Aug 2010
Posts: 44
|
Hey I got rid of the Browse Button, but how do you make the directory read only?
How can you restrict the drive types? ie. no usb etc. Is there a easy way to grab the amount of free space value for the selected drive? Last edited by NSISNUB; 25th March 2011 at 19:18. |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Aug 2010
Posts: 44
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|