marcelo
Posts: 103
Joined: Fri Sep 28, 2007 2:07 pm

Updating TextBox after returning from vbscript

Hi

I have a text box that depends on a script attached action to be run to set its property value. So I added a button on the form for that text box and that button calls my attached custom action when clicked. that works perfectly. but when the property is updated on the vbscript (Session.Property("TXT_DATA") = strDataValue), the value doesn't get refreshed on the dialog.

How can I acomplish that? If I go back and forth on the dialogs, the value is updated properly.

Also, is there a way I can allow user to pick dates (using a calendar) using maskeditor or any other advanced installer feature?

Thank,
Marcelo
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi
How can I acomplish that? If I go back and forth on the dialogs, the value is updated properly.
We have a How-To for this, please take a look:
http://www.advancedinstaller.com/user-g ... -text.html
Also, is there a way I can allow user to pick dates (using a calendar) using maskeditor or any other advanced installer feature?
I'm afraid that Windows Installer does not support this type of control. However, this can be done in two ways:
1) you use combo boxes that will get the day, month and year set by the user
2) you create a custom action that shows your own custom dialog with a calendar control

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
marcelo
Posts: 103
Joined: Fri Sep 28, 2007 2:07 pm

Hi Cosmin,

Thanks for the response, but I'm still having problems using the UpdateMsiEditControls custom action.

I tried to add another published event as shown on the example you sent me and put it below the event that sets the new value in VB Script, but that didn't refresh my value at all.

I also tried to use the Session.DoAction("UpdateMsiEditControls") after the new value has been set on the variable, but that didn't work either. Its like the UpdateMsiEditControls is not doing nothing at all?

On the Button's Published Events
DoAction SetCurrentDate AI_INSTALL
DoAction UpdateMsiEditControl AI_INSTALL (if Session.DoAction is not present on VBS)

On the VBS
Sub SetCurrDate
Session.Property("TXT_STARTDATE") = strCurrentDate
Session.DoAction("UpdateMsiEditControls") (If DoAction UpdateMsiEditControl is not present on Published Event)
End Sub

On Custom Actions
UpdateMsiEditControls
Source Path : <aicustact.dll>
Source Type : Dynamic Linked library (*.dll)
Function Name : UpdateMsiEditControls

SetCurrentDate
SourcePath I:\Install\CustomAction.vbs
SourceType : Visual Basic sscript (*.vbs)
FunctionName: SetCurrDate

I'm using the latest version of AI.

Did I miss something on the explanation?
marcelo
Posts: 103
Joined: Fri Sep 28, 2007 2:07 pm

Found my problem.. I didn't set the "SetProperty" event.. it works properly now :oops:
Thanks Cosmin!

Return to “Common Problems”