PDA

View Full Version : Why is validating a few fields so hard?



Josh Korn
07-13-2006, 01:11 PM
I have to admit I'm disappointed by this first InstallShield experience.

Given the product's massive market share and hype, I had expected that InstallShield would have covered the basics with considerable elegance.

Instead, it took several days' worth of trial and error (plus 175 lines of javascript code) to be able to competently validate three fields on a custom dialog. And we're not talking about complex stuff here -- one field is a network address, the other two are port numbers between 1000 and 9999.

Searching both helpnet and the community forum yielded no useful documentation, and not a single example. What they did yield was several years' worth of messages from people who were stumped by similar problems. Most of those messages went unanswered.

I asked a couple of people with more InstallShield experience than I have, whether this is the norm when working with InstallShield. To a person, they said that yep, this is the InstallShield landscape.

I can't understand why something as routine as validating controls on a dialog requires so much effort. Please enlighten me.

Josh

RobertDickau
07-13-2006, 05:10 PM
What type of project are you using? For InstallScript, there's the Example Custom Password Dialog example that ships with the product (click "Browse sample projects" on the Start page). For Basic MSI, the MaskedEdit control comes closest to helping with this, but yes, the default MSI UI capabilities aren't all that spectacular (see KB article Q108570 for other limitations).

Josh Korn
07-17-2006, 10:15 AM
What type of project are you using?
Basic MSI.


For Basic MSI, the MaskedEdit control comes closest to helping with this, but yes, the default MSI UI capabilities aren't all that spectacular (see KB article Q108570 for other limitations).

I didn't find the MaskedEdit control terribly useful because it only allows fairly primitive masks. Allowing a jscript regEx would make MaskedEdit considerably more useful for (I think) very little development effort from Macrovision. Also, some extra predefined RE's would be even better. For example, the following represents a syntactically correct network address (IP Address or DNS name)


/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|([A-Za-z][A-Za-z0-9\-]*(\.[A-Za-z][A-Za-z0-9\-]*)+)$/

It took several hours ( :( more than I'd care to admit) to get this to work correctly, and there were also a few lines of code to disallow numbers outside the [0, 255] range of an IP address. Obviously, I would have preferred to have the whole construct just a click away.

Josh