Init event not triggered - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

Init event not triggered

Hi,

I have a dialog with a check box that I'd like disable when a file is not present in the target installation folder. I've created a UI custom action that checks the existence of the file and sets a public property. Then I added an init event on the dialog with event=DoAction, argument=myUICustomAction and no condition (AI sets condition to 1). I also added a control condition on the check box with action=Disable and condition=test of the public property set by the custom action.
The problem is that the init event is never triggered!
Is there something special to do to enable init events?

regards
Laurent
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can use a "DoAction" Published Event instead of an Init Event. This control event can be set for the "Next" button of the dialog scheduled before the dialog with the checkbox.

Also, you can use a search in the "Search" page to determine if the file is present or not. In this case you can use the property of the search (usually it's RESULT_PROPERTY) to condition the checkbox.

You can read more about the "Search" page here:
http://www.advancedinstaller.com/user-guide/search.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

Hi,

I didn't use a published event on the dialog scheduled before, because there are several possible dialogs (actually the setup dialog, or the customize dialog) and I didn't want to duplicate the event.

Regarding the search feature, I didn't use it because when it is executed, I don't yet know what will be the target installation folder (choosen using the setup/customize dialogs).

regards
Laurent
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that an Init Event basically sets a Published Event for the "Next" button of the previous dialog in the tree shown in the "Dialogs" page. Also, this is set at build-time, not at runtime.

Note that the Init Event feature is usually used in simple dialog structures when the sequence of dialogs in the "Dialogs" page may change from build to build.

For example, if in the "Dialogs" page you have this structure:
WelcomeDlg
FolderDlg
CustomDialog

An Init Event set for "CustomDialog" will be set at build-time to a Published Event for the "Next" button of "FolderDlg". If "WelcomeDlg" also launches "CustomDialog" (based on a condition), then the Init Event will not be applied for it.

The solution in your case is to use a Published Event for all "Next" buttons which launch the dialog with the checkbox.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
elver
Posts: 29
Joined: Thu Oct 11, 2007 9:50 am

Ok, I will follow your suggestion.
Thanks Cosmin.

regards
laurent

Return to “Common Problems”