How to validate Edit box
Posted 17 January 2005 - 10:34
I am using Installshiled develper 7.01
I created a basic MSI project. I then created a Custom dialog box with few edit boxes. I was able to display the dialog box. (i added it in the sequence/action).
How do I validate the values i enter into the edit box of this dialog
Regards,
Levi
Posted 17 January 2005 - 18:40
Try to use masked edit (with templates)
Posted 18 January 2005 - 09:28
Stefan Krüger
InstallSite.org twitter facebook
Posted 26 January 2005 - 22:47
But what I want to then do is re-set the invalid data to the default..
The edit box is tied to a property, so that's how I read it in my DLL (MsiGetProperty()). So when I've found it is invalid, I set that perperty (MsiSetProperty()) to the default value and display an error message (in my DLL, simple message box) to tell the user what input was invalid. The user "OK"'s the message box, but the dialog doesn't refresh to show the restored-to-default value that I just changed. If the do a back->next button, the dialog correctly refreshes with the changed value.
Does anyone know how can I do that programatically ?
Posted 27 January 2005 - 12:17
Stefan Krüger
InstallSite.org twitter facebook
Posted 27 January 2005 - 15:47
I fill the port box with our default, and the password/confirm edits are empty. When we validate (when "next" is hit), I want to make sure the passwords match, and the port is valid (1025-64k) and not bound by any other process. All that code is there, working. But, if the user, say, entered two different passwords, I want to zero back out that edit box, or if they entered a port in use, I want to restore the default.
The user will get a popup saying what's wrong, but if I reset the control's property, it isn't reflected in the dialog (like wiping out the passwords if they don't match, or reverting to the default port if an invalid port is entered, etc). That's what I'd like to accomplish. Any ideas on it ?
Posted 29 January 2005 - 09:42
Stefan Krüger
InstallSite.org twitter facebook
Posted 07 February 2005 - 15:35
But, there's another problem I've encountered: VB script custom actions run fine when I call them via "DoAction" event for the "Next" button. BUT, InstallScript custom actions just hang up the engine: installer shows hourglasses and never gets back to work. In log, there's a record
Action start 15:50:46: ISCheckUserInput
and it's the last record.
Could someone help me with this problem?
P.S. I'm using web project in IS DevStudio 9.
Posted 07 February 2005 - 15:41
Setup Hangs During MSI API Call
Description:
In a Basic MSI project when calling certain MSI API functions (like MsiSetTargetPath or MsiSetFeatureState) in a InstallScript custom action that is launched via DoAction from a dialog button you setup will wait indefinitely. It will not display an error message or crash, it will just not do anything anymore until you end it in task manager.
Cause:
This happens because of an apparent design decision in MSI. When DoAction is called, it appears that MSI does not process Windows messages. InstallScript uses COM to call MsiSetTarget, and thus relies on the Windows message queue. Hence the deadlock occurs, which does not occur in a C++ custom action that does not use COM.
Workaround:
Do not to call these MSI APIs from InstallScript if they are fired from DoAction from a dialog button. Insert the custom action into the sequence or use a DLL instead of InstallScript. (You can even create a custom action of type Standard DLL to call the function in msi.dll directly). Or convert your project to a Standard project and call the function from an event handler in your script.
Status:
InstallShield confirmed that this is a problem in all versions of InstallShield Developer and in ISWI since version 1.52.
Created: 2002-09-06
http://www.installsi...bugs_isd802.htm
Stefan Krüger
InstallSite.org twitter facebook
Posted 07 February 2005 - 16:47
And how exactly can I "use a DLL instead of InstallScript"? Are there any examples of such adaptation?
Posted 09 February 2005 - 14:59
Custom Action DLL sample:
http://codeproject.c...ustomaction.asp
Stefan Krüger
InstallSite.org twitter facebook