sapha
4th October 2003 15:27 UTC
Installation path control
Hi, I'm a newbie here...
This is my problem:
I need an installer that can check if the length of the installation path entered by the user is <= of a defined number. Now, this is easy, but how can i permit to the user to repeat the path entry?
For now, i use a message box and then i quit the installer...
Thanks!
n0On3
4th October 2003 16:17 UTC
you can put the messagebox in a callback.
from docs:
4.5.3 Callbacks
[...] the leave-function is called right after the user has pressed the next button and before the page is left.
if that's not enough, post again ;)
Vytautas
4th October 2003 16:24 UTC
You can use the abort command in the leave function to avoid the user continuing to the next page.
Also you could use the .onVerifyInstDir function to check the path as the user is selecting it and if it is incorrect automatically disable the next button.
Vytautas
sapha
4th October 2003 16:28 UTC
i will try
Thanks, i will try that!
However, i thimk it will be hard cause i've used the MUI and i've not used Pages...
Bye
Vytautas
4th October 2003 16:37 UTC
You don't need to use MUI, although you can. I will post an example of the .onVerifyInstDir function from the docs. Hope it helps.
Function .onVerifyInstDir
IfFileExists $INSTDIR\Winamp.exe PathGood
Abort ; if $INSTDIR is not a winamp directory, don't let us install there
PathGood:
FunctionEnd
Vytautas
sapha
4th October 2003 16:45 UTC
I feel so little... :)
THANK YOU ALL
Will i need to back? :)
Vytautas
4th October 2003 16:51 UTC
If you use the .onVerifyInstDir function the user will not be able to click next if the path is of wrong length. (The function is called every time the path changes, so as they say in the docs "don't do anything silly in this function, e.g. don't use message boxes, etc.")
So no you will not have to click back.
Vytautas :)
sapha
5th October 2003 15:27 UTC
THANKS!!!
It worked! Thank you!
Bye
PS: sorry if my english :)
n0On3
5th October 2003 16:45 UTC
mmm... I learnt some things today ;)