Skip to content
⌘ NSIS Forum Archive

Verifying a directory without using a 'directory' Page

8 posts

KrisAster#

Verifying a directory without using a 'directory' Page

I have a situation that I'm trying to resolve. I have come up with my own 'custom' page instead of using the standard 'directory' page. This is all fine and good. The problem comes when I try to validate the directory path that I get from the custom page. I cannot use DirVerify (because it is not a 'directory' page... (is this getting redundant?)).

So, as I see it, I'm left with one of two options: 1) manually verify if the directory is valid (check for available storage space, read-only dir, etc.) 2) find some way of flagging my custom page as a directory page.

If anyone has any ideas on either 1 or 2, or is far more clever than me and has option 3 that would work. I'd be most appreciative.

Thanks,
Kris
JasonFriday13#
Technically, option 1 is the only option you can use.

Use the leave function of your custom page to verify the path and whatnot.
KrisAster#
That has been my observation as well. It's just frustrating to know that there is a bunch of already existing and fully tested directory validation code that I'm not able to use. I'm still searching for a solution.

Thanks for your input Jason.
Kris.
onad#
IMHO it is advised to put a feature request in the sourceforge NSIS developent pages. I have to admit, extending the use of dir validation looks like a valid and handy feature to me.
kichik#
validate_filename is already exposed to plug-ins. Which other function do you think you'd need?
kichik#
That's simple enough to do without the internal check. The internal check is just comparing two numbers and is not located in any function to avoid the overhead.

I forgot to mention that you could also trigger validate_filename with $EXEDIR.
Push "C:\Program *Files   "
Exch $EXEDIR
Exch $EXEDIR
Pop $0
DetailPrint $0