Archive: Mui_page_drive


Mui_page_drive
  Hello, its me again

There is a way to use something like MUI_PAGE_DIRECTORY but not to select directories, I need to select the disc drive letter where im going to install ( something like I put in the subject of this post )?

TIA


Build a custom page with DirRequest. See InstallOptions manual and examine included InstallOptions examples.


you could simply customize the directory page.

first, you'll need to do "AllowRootDirInstall true", then you need to write a function:


onVerifyInstDir

IfFileExists $INSTDIR
*.* 0 invalid
StrLen$0 $INSTDIR
IntCmpU$0 3 0 0 invalid
Return
invalid:
Abort
FunctionEnd
>
this will make users to select valid drives only :)

Thanks RW & Comm@nder21

I will try


Excellent Comm@nder21
Works like i need

Thanks again


:) you're welcome!


I didn't realise that you were talking about the standard directory page, sorry, I thought you're trying to achieve a custom directory request.
For the standard directory page you don't need the .onVerifyInstDir function, because when you browse/type for a directory, the standard directory page automatically checks if the directory is valid and if there is enough disk space, and then enables the next/install button. It's not possible to proceed if you browse/type for an invalid/out of space directory. All you need is the "allowrootdirinstall true", in order to install on the root of a valid drive.
The .onVerifyInstDir function as described in NSIS manual (4.7.2.1.10 .onVerifyInstDir) is suitable for some special actions, e.g. if you want to verify that the selected directory contains some specific file(s). This means that the function does not verify the selected directory, instead at the time when users have browse/type a directory, the function verifies either the existence of a specific file or the entire directory.
You may add the function of the following example to set the directory dialog pointing on target's system drive.

outfile test.exe
showinstdetails show
allowrootdirinstall true

!include WinMessages.nsh

page directory "" dir_show
page instfiles


section
SetOutPAth '$INSTDIR'
file ; your file here
file ; your file here
SetOutPAth '$INSTDIR\Boo'
File ; your file here
sectionend

Function dir_show
ExpandEnvStrings $R0 '%SYSTEMDRIVE%'
FindWindow $R1 "#32770" "" $HWNDPARENT
GetDlgItem $R2 $R1 '1019'
SendMessage $R2 ${WM_SETTEXT} 1 "STR:$R0\"
FunctionEnd

Happy Holidays!

you did not understand what he wanted to achieve.

he does not want to LET the user install the program on a partition root, but FORCE him to :)

therefore you need .onVerifyInstDir

and you're wrong. the function is named correctly, because in this function, you can define your own method of verifying if the user chose a correct/valid installation directory.
this can happen by check for existing files, but also by checking for a special layout of the path, e.g. it would be possible to let the user install only to pathnames that include the character 'g' in it :)


you did not understand what he wanted to achieve.

he does not want to LET the user install the program on a partition root, but FORCE him to
Ah! apologies... that was very dumb of me.

and you're wrong. the function is named correctly, because in this function, you can define your own method of verifying if the user chose a correct/valid installation directory.
Even with my sad english...
Did I mention something different up there?

Happy Holidays!

The .onVerifyInstDir function as described in NSIS manual (4.7.2.1.10 .onVerifyInstDir) is suitable for some special actions, e.g. if you want to verify that the selected directory contains some specific file(s). This means that the function does not verify the selected directory, instead at the time when users have browse/type a directory, the function verifies either the existence of a specific file or the entire directory.
Sorry... Wrong expression! instead -> indeed.
Again Happy Holidays

This means that the function does not verify the selected directory, instead at the time when users have browse/type a directory,
this is what iritated me :)

but yes, merry christmas!!!

Hi,
I want a similar environment. The only difference is the User just selects the Hard-drive and that's it. he cant select any other directories only the root hard-drives..

thanks