WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Force user to select only drive letter
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
ionut_y
Junior Member

Registered: Jan 2007
From:

Force user to select only drive letter

I have an application that works on a drive folder like
c:\myapp, d:\myapp, e:\myapp ..... how can I replace MUI_PAGE_DIRECTORY with a combobox for selecting only drives letter available.I'm new with nsis and please I want a small script file to see that.For 2 days I'm looking for a solution.
Many thanks !!

Quick Link | Report this post to a moderator | IP: Logged

ionut_y is offline Old Post 01-03-2007 07:35 AM
Click Here to See the Profile for ionut_y Click here to Send ionut_y a Private Message Click Here to Email ionut_y Find more posts by ionut_y Add ionut_y to your buddy list Edit/Delete Message Reply w/Quote
Red Wine
Forum King

Registered: Mar 2006
From: Ath. GR

Already discussed here:
http://forums.winamp.com/showthread...threadid=262165

__________________
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Quick Link | Report this post to a moderator | IP: Logged

Red Wine is offline Old Post 01-03-2007 07:45 AM
Click Here to See the Profile for Red Wine Click here to Send Red Wine a Private Message Find more posts by Red Wine Add Red Wine to your buddy list Edit/Delete Message Reply w/Quote
ionut_y
Junior Member

Registered: Jan 2007
From:

quote:
Originally posted by Red Wine
Already discussed here:
URL submitted by user.



Thanks for answer.... but this is not what i'm looking for, user can also chose a subdir ...and i want to force it to choose only drive letter from a combo.

Quick Link | Report this post to a moderator | IP: Logged

ionut_y is offline Old Post 01-03-2007 07:59 AM
Click Here to See the Profile for ionut_y Click here to Send ionut_y a Private Message Click Here to Email ionut_y Find more posts by ionut_y Add ionut_y to your buddy list Edit/Delete Message Reply w/Quote
Red Wine
Forum King

Registered: Mar 2006
From: Ath. GR

Nope, this is exactly what you're looking, though, feel free to build a custom page with a combo, find all available HDD with GetDrives, and add them to ListItems.

__________________
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Quick Link | Report this post to a moderator | IP: Logged

Red Wine is offline Old Post 01-03-2007 08:07 AM
Click Here to See the Profile for Red Wine Click here to Send Red Wine a Private Message Find more posts by Red Wine Add Red Wine to your buddy list Edit/Delete Message Reply w/Quote
ionut_y
Junior Member

Registered: Jan 2007
From:

quote:
Originally posted by Red Wine
Nope, this is exactly what you're looking, though, feel free to build a custom page with a combo, find all available HDD with GetDrives, and add them to ListItems.


Thanks again ...this is my problem...i don't know how i can do it.I use nsis for 3 days,I wand i script for exemple.Thanks !

Quick Link | Report this post to a moderator | IP: Logged

ionut_y is offline Old Post 01-03-2007 08:18 AM
Click Here to See the Profile for ionut_y Click here to Send ionut_y a Private Message Click Here to Email ionut_y Find more posts by ionut_y Add ionut_y to your buddy list Edit/Delete Message Reply w/Quote
Backland
Senior Member

Registered: Sep 2006
From:

I dont think there is one available, but the concept is very simple:

Enumerate the drives with the plugin, and add them to your custom page's combo with the WriteINIStr. You should probably start by looking through the InstallOptions examples provided with NSIS. It looks a bit daunting at first, but its quite simple.

Quick Link | Report this post to a moderator | IP: Logged

Backland is offline Old Post 01-03-2007 11:45 AM
Click Here to See the Profile for Backland Click here to Send Backland a Private Message Click Here to Email Backland Find more posts by Backland Add Backland to your buddy list Edit/Delete Message Reply w/Quote
Red Wine
Forum King

Registered: Mar 2006
From: Ath. GR

Take this as a starting point :-)

code:
!define APPNAME "My Application" Name '${APPNAME}' OutFile 'test.exe' LicenseData '${NSISDIR}\License.txt' LicenseBkColor 0xFFFFFF ShowInstDetails show AllowRootDirInstall true !include FileFunc.nsh !insertmacro GetDrives Page License Page Custom CustomCreate CustomLeave Page InstFiles Section "boo" SetOutPath '$INSTDIR' SectionEnd Function CustomCreate WriteIniStr '$PLUGINSDIR\custom.ini' 'Settings' 'NumFields' '2' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Type' 'Label' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Left' '5' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Top' '5' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Right' '-6' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Bottom' '17' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Text' \ 'Select Installation drive:' StrCpy $R2 0 StrCpy $R0 '' ${GetDrives} "HDD" GetDrivesCallBack WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Type' 'DropList' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Left' '30' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Top' '25' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Right' '-31' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Bottom' '105' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'State' '$R1' WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'ListItems' '$R0' push $0 InstallOptions::Dialog '$PLUGINSDIR\custom.ini' pop $0 pop $0 FunctionEnd Function CustomLeave ReadIniStr $0 '$PLUGINSDIR\custom.ini' 'Field 2' 'State' StrCpy '$INSTDIR' '$0' FunctionEnd Function GetDrivesCallBack IntCmp $R2 '0' def next next def: StrCpy $R1 '$9${APPNAME}' next: IntOp $R2 $R2 + 1 StrCpy $R0 '$R0$9${APPNAME}|' Push $0 FunctionEnd Function .onInit InitPluginsDir GetTempFileName $0 Rename $0 '$PLUGINSDIR\custom.ini' FunctionEnd

__________________
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Quick Link | Report this post to a moderator | IP: Logged

Red Wine is offline Old Post 01-03-2007 12:37 PM
Click Here to See the Profile for Red Wine Click here to Send Red Wine a Private Message Find more posts by Red Wine Add Red Wine to your buddy list Edit/Delete Message Reply w/Quote
ionut_y
Junior Member

Registered: Jan 2007
From:

quote:
Originally posted by Red Wine
Take this as a starting point :-)
code:
!define APPNAME "My Application" Name '${APPNAME}' OutFile 'test.exe' ......................



Thanks very much ... is seems ok. I'll start learnig nsis deeply.

Quick Link | Report this post to a moderator | IP: Logged

ionut_y is offline Old Post 01-03-2007 01:32 PM
Click Here to See the Profile for ionut_y Click here to Send ionut_y a Private Message Click Here to Email ionut_y Find more posts by ionut_y Add ionut_y to your buddy list Edit/Delete Message Reply w/Quote
Red Wine
Forum King

Registered: Mar 2006
From: Ath. GR

You're welcome!
Just added a wiki page with the complete example that calculates the free space of every drive and adds only those drives that they have enough space for the uncompressed installation.

__________________
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Quick Link | Report this post to a moderator | IP: Logged

Red Wine is offline Old Post 01-03-2007 05:41 PM
Click Here to See the Profile for Red Wine Click here to Send Red Wine a Private Message Find more posts by Red Wine Add Red Wine to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 09:49 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Force user to select only drive letter
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON