KrisAster
10th October 2006 19:51 UTC
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
11th October 2006 00:41 UTC
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
11th October 2006 13:27 UTC
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.
jpodtbc
2nd November 2006 18:00 UTC
^^
dang.
me too.
onad
12th November 2006 13:09 UTC
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
14th November 2006 18:51 UTC
validate_filename is already exposed to plug-ins. Which other function do you think you'd need?
Comm@nder21
15th November 2006 18:16 UTC
he mentioned the free-space validation...
kichik
17th November 2006 11:59 UTC
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