I am not an expert in IA yet, so I don't really know what may be wrong in your dialog, but in my IA learning journey, I found a sample script named "Serial Number Validador" which is very neat and I am sure in your case this script may give you some ideas for your situation or better yet you can adopt this script in your installation since this one does not need for you to have the pre-define serial numbers in your script at all.
Thanks for your tip regarding the Serial Number sample. That prompted me to take a look at all the samples which are interesting. Unfortunately I did not find a solution to my problem.
The samples all have very simple validations along the lines of
I came across a similar problem. I have an installation code which is a sixteen character hex value. Whilst I could check that somebody had typed the correct length of characters there was no way to ensure that only hex characters where entered, just alphanumerics.
So my solution was to add another dialog screen which tells the user that the code is being validated then shell to a console app which validates the string entered. The result of which being captured and the installer allowed to carry on or gets sent back with a warning.
Thanks thats a good suggestion which gets me part of the way. I still have a problem though:
A: If user enters a valid number, then the Next.Enabled is set to True, which is great.
B: But then the user changes her mind and enters another number which is wrong.
The problem is that Next.Enabled stays set to True from step A. So the user is now allowed to continue with an invalid number.
I must ensure that an invalid number is not allowed to click Next. Any suggestions?
Ira Rainey wrote:... then shell to a console app which validates the string entered. The result of which being captured and the installer allowed to carry on or gets sent back with a warning.
This sounds complicated.
Is this something that I can do step-by-step, or is it very technical?
My requirement is to validate a serial number against a list of 20 possibilities. If it is not one of those, then do not allow Next to be clicked.
Depends on your programming ability. It's pretty simple really. You write an app (for me I use VB.NET, but it could be pretty much anything) which takes in a string as a command line parameter which is the code you want to validate, then it just checks the string against a list of valid alternatives and returns a value representing the result.
This is called in IA by using run program:
Set Variable CODECHECK to -1
Set Variable TMPKEY to $KEY1$$KEY2$$KEY3$$KEY4$
Run Program $SUPPORTDIR$\\checkapp.exe $TMPKEY$ (WAIT)
if Variable CODECHECK Equals 0
MessageBox: Code Error
GoTo Label: Code Entry
end
Where CODECHECK is the variable the run program returns it's result in.
Ira Rainey wrote:Depends on your programming ability. It's pretty simple really. You write an app (for me I use VB.NET, but it could be pretty much anything) which takes in a string as a command line parameter which is the code you want to validate, then it just checks the string against a list of valid alternatives and returns a value representing the result.
This is called in IA by using run program:
Set Variable CODECHECK to -1
Set Variable TMPKEY to $KEY1$$KEY2$$KEY3$$KEY4$
Run Program $SUPPORTDIR$\\checkapp.exe $TMPKEY$ (WAIT)
if Variable CODECHECK Equals 0
MessageBox: Code Error
GoTo Label: Code Entry
end
Where CODECHECK is the variable the run program returns it's result in.
As suggested, I have created the program checkapp.exe that is going to check my serial numbers. I do not know where to run this code - can you tell me where in the script this code can be added?
Label: License Check
Display Dialog: registrationwithserial, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
GoTo Label: <Previous>
else
if Variable WIZARD Equals CANCEL
GoTo Label: Main Install
end
end
Set Variable CODECHECK to -1
Set Variable TMPKEY to $KEY1$$KEY2$$KEY3$$KEY4$
Run Program $SUPPORTDIR$\\checkapp.exe $TMPKEY$ (WAIT)
if Variable CODECHECK Equals 0
MessageBox: Code Error
GoTo Label: License Check
end
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com