Cannot get UpdateMsiEditControls built-in action to work - Advanced Installer Community
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Cannot get UpdateMsiEditControls built-in action to work

I'm attempting to update the status of a script in a dialog and nothing I do seems to make the dialog refresh. I'm not using the enhanced UI. I've attached a simple .aip to illustrate the issue (v11.6.1).

No matter how many times you press the Update button, the control will not update (which resolves any issues with asynchrony in the way I've implemented this trivial example).

I've also included the enhanced UI call that would force an update, but haven't tested it.
Attachments
testApplication.aip
(13.66 KiB) Downloaded 482 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Cannot get UpdateMsiEditControls built-in action to work

Hi,

The text control is not updated because your property is set in a VBS custom action. However, it works if you set that property separately through a "Set installer property" custom action. Also, select the text control and in the "Property Name" field assign to it the property that you want set (i.e. MY_TEXT).

If the Enhanced User Interface is enabled the VBS custom action limitation is not encountered anymore.

I attached the modified AIP file for your reference.

Best regards,
Eusebiu
Attachments
testApplication.aip
(14.31 KiB) Downloaded 464 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Cannot get UpdateMsiEditControls built-in action to work

As I said, my trivial example was an illustration of what I'm doing in a much more complex scenario. I cannot use the enhanced UI requires a bootstrapper which will not work in this case. I'm not sure how setting the property through a script differs from setting it through the custom action, could you tell me what the custom action does in addition to setting the MSI property that would allow me to use the UpdateMsiEditControls action to update the UI with my text (I would prefer to include the property in the text value of the field, but if I cannot, I can work around that).

Setting the property with the event you've used doesn't require UpdateMsiEditControls to be called, which is supposed to allow the value to be set in the script and reflected in the UI (see http://www.advancedinstaller.com/user-g ... -text.html, the very last entry about a VBScript custom action).

Thank you,

- Adam
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Cannot get UpdateMsiEditControls built-in action to work

Hi Adam,

I apologize for the delayed reply.

I will try to explain below the scenario when the "Update MSI Edit Controls" custom action can be used.

Because of a Windows Installer limitation, the value of an "Edit Box" control will not be updated in the UI if its related property is changed through a VBS custom action. For this, you need to use an auxiliary property (i.e. MY_PROP) that is set by the VBS custom action and an auxiliary "Set installer property" custom action that sets the property related to the edit box (i.e. MY_EDIT).

So, when the VBS custom action sets the "MY_PROP" property to a value (i.e. "My value"), the "Set installer property" custom action will set the "MY_EDIT" property to the value contained by the "MY_PROP" property like below:
  • Property: MY_EDIT
    Value: [MY_PROP]
In the case described above the value of the edit box will be updated in the UI.

However, there are cases when the user already typed some text in the edit box and in this case the above steps will still be helpless (the UI will not be updated). To overcome this problem, you should first call the "Update MSI Edit Controls" custom action which will let the edit box's UI be updated.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
adamdc78
Posts: 76
Joined: Wed Mar 19, 2014 7:42 pm

Re: Cannot get UpdateMsiEditControls built-in action to work

Thank you for clarifying. In my work-around I'd found that I needed to replace my static text with a text box (not super thrilled with the UX on a disabled text box, but will deal with it). I'm just calling the UI events to set public properties based on the private properties modified by the script. Not very efficient, but in this case it doesn't really need to be.

Cheers,

- Adam
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Cannot get UpdateMsiEditControls built-in action to work

You're welcome Adam.

You can still use the static text if you want, but you need to assign to it the property that is set through the "Set installer property" custom action (i.e. MY_EDIT) and it should work.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”