vpodans
Posts: 28
Joined: Tue Dec 27, 2011 3:03 pm

Add published events (dialog editor)

I'm looking to slightly imporove user experience with installation paths depending on setup type (for all users or current users).

I've started with dialogs — edited FolderDlg by adding 2 radiobuttons (choice — install for current user or for all users). Default value is AllUsers. My thought is to attach some events to these radiobuttons that will set the path (in the FolderEdit text box) associated with particular choice. Say, if a user selects "All users", the path should be default (as specified in [APPDIR]). Otherwise — set predefined path for current user (files are copied to MyDocs folder).

Looking to other items, these events are defined in Published Events. However I cannot add any event here for radio button (all actions are inactive). Is there a way to add Published Events for radiobuttons?

Thanks in advance!
®
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Add published events (dialog editor)

Hi,

First of all, you should know that Advanced Installer offers you a predefined dialog from which the user can select the install type, you can simply add it from our list of predefined ones.

Now, back to the radio buttons. Unfortunately, only checkboxes, buttons and listboxes( with Enhanced UI only ) can publish events in Windows Installer, radio buttons cannot. Here is a thread with more details on this, and available workaround, in case you choose not to use our predefined dialog:
http://www.advancedinstaller.com/forums ... =2&t=19517

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vpodans
Posts: 28
Joined: Tue Dec 27, 2011 3:03 pm

Re: Add published events (dialog editor)

First of all, you should know that Advanced Installer offers you a predefined dialog from which the user can select the install type, you can simply add it from our list of predefined ones
yep. However I was unable to figure how it works and how do I specify the path depending on active radiobutton.

Ok, it seems, I've figured it out by using provided workaround.
I need to place a check-box control and add 2 published events (SetProperty):
Name: [APPDIR]
Argument: Path1 (say, the path to install for all users — Program Files)
Condition: CHECKBOX_1_PROP= "CheckBox"

and the second event:
Name: [APPDIR]
Argument: Path2 (say, the path to install for current user — MyDocs)
Condition: CHECKBOX_1_PROP= ""

At least, if I enable the checkbox, the path is changed based on first event, and if uncheck — the path is changed to alternate path (based on second event). This might be helpful for others. Thanks again!
®
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Add published events (dialog editor)

This is a correct solution, but only if you are interested in just the install paths. Our predefined dialogs also handles the install type, i.e. the value of the property
ALLUSERS, as this property has different values for per-machine and per-user installs.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vpodans
Posts: 28
Joined: Tue Dec 27, 2011 3:03 pm

Re: Add published events (dialog editor)

Yes, I'm concerning on installation paths only. I've decided to use only per-machine installs (and request elevation if necessary), so only administrators can install it and my solution is sufficient for me.
®

Return to “Common Problems”