PDA

View Full Version : Seems simple but....



jweber
03-16-2006, 05:07 PM
Please excuse this dumb question, but its been 5+ years since I have coded a non multiplatform installer.

Using a basic MSI Project, how does one validate user input in an Edit Field. I understand that I have too write a custom action. But how do i pass the value of the Edit Field to the custom action? I want to use JScript or VBScript.


Thanks,

Jeremy

JStone
03-17-2006, 08:36 AM
Hi,

You can store the user input in a property and validate it in an installscript custom action or a vbscript custom action.

If you are using an installscript custom action, use MsiGetProerpty. For more information, please refer the below article.

http://support.installshield.com/kb/view.asp?articleid=Q105229

If you are using a vbscript custom action, you can use the session object. For more info, refer this article.

http://support.installshield.com/kb/view.asp?articleid=Q105621

jweber
03-19-2006, 08:37 AM
So for every dialog with fields that I need to validate, I would need separate functions?

wjoconnor
03-20-2006, 11:23 AM
Writing separate functions is usually the best choice. A single function would very likely get extremely unwieldy and difficult to maintain.

jweber
03-20-2006, 11:28 AM
Okay, but it seems counter productive to have to maintain the same code in separate places. For instance in Universal, I was able to code a custom java class that accepts the control I want to validate as an argument. Within the code I check for the control type and spit out an error if the input it contains does not conform to what I need it to be. In this manner I was able to write the code once, not over and over.

wjoconnor
03-20-2006, 11:34 AM
Unfortunately, you don't get the granular level of control with basic installer. It is more maintenance intensive, but I don't know of a different way to do it with the current technology.
Of course, there's always something new to learn and I'd be interested to hear if I'm wrong on this.