alewis
Posts: 2
Joined: Wed Nov 14, 2007 7:44 pm

questions on custom actions

I'm investigating Advanced Installer as an option for my company's client installations and have a few questions on features.

We need to be able to have several different installation paths within the installer, so I'd like to be able to display dialogs conditionally (based on a mode variable I create and set at the beginning of the process). Is this possible?

We also need to be able to associate custom actions with dialog controls. For example, if the user clicks next on a certain dialog, I want to run a particular DLL. It seems like you can control the sequence custom actions, but I don't see how to associate custom actions with dialog controls. My custom actions do not appear in the set of possible events to subscribe to.

Also, we need to be able to pass data back from a DLL executed by a custom action, and then use that data in the installation. Is this possible? If it's not possible directly, can I pass variables into the DLL by reference and read them after the DLL has finished executing?

Thanks, A.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Thank you for your interest in Advanced Installer.
We need to be able to have several different installation paths within the installer, so I'd like to be able to display dialogs conditionally (based on a mode variable I create and set at the beginning of the process). Is this possible?
Yes, Advanced Installer allows you to do this.

In the "Files and Folders" page we have a list of the most used installation folders in which you can place your files. If you need a folder that is not specified in this list you can set a custom one like this:
- in the "Install Parameters" page you create a public property (uppercase letters), for example MY_DIR with the value "C:\" (your custom path)
- in the "Files and Folders" page you create a property-based folder using MY_DIR
- at runtime MY_DIR will be resolved to the value you specified when you created the property

You can read more about the "Install Parameters" and "Files and Folders" pages here:
http://www.advancedinstaller.com/user-g ... eters.html
http://www.advancedinstaller.com/user-g ... lders.html

Also, we have a tutorial that will help you create a simple installation:
http://www.advancedinstaller.com/user-g ... imple.html

You can set which dialogs will be shown in the "Dialogs" page. Also, the Dialog Editor feature allows you to display the dialogs conditionally by using control events. Note that the Dialog Editor feature is available only in an Enterprise project which requires an Enterprise license (you can also test this feature in the trial version).

For more information about the "Dialogs" page and the "Dialog Editor" please see this page:
http://www.advancedinstaller.com/user-g ... ditor.html

You can read more about control events here:
http://www.advancedinstaller.com/user-g ... ditor.html

Let me know if you need an example of how to display a dialog conditionally (just mention what the desired behavior would be).
We also need to be able to associate custom actions with dialog controls.
This can be done by using the "DoAction" control event in the "Published Events" tab of the control. Note that this type of custom actions will be scheduled under the "UI Custom Actions" sequence in the "Custom Actions" page.

You can read more about the "Custom Actions" page here:
http://www.advancedinstaller.com/user-g ... -page.html
Also, we need to be able to pass data back from a DLL executed by a custom action, and then use that data in the installation. Is this possible?
This can be done by using public properties (that will store the data) and by creating a "New Attached Custom Action" under the "UI Custom Actions" sequence. Inside the DLL you can get/send information from/to the installation by using the MsiGetProperty/MsiSetProperty functions.

You can read more about these functions here:
http://msdn2.microsoft.com/en-us/library/aa371681.aspx
http://msdn2.microsoft.com/en-us/library/aa370134.aspx

If you have any other questions, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
alewis
Posts: 2
Joined: Wed Nov 14, 2007 7:44 pm

Wow, thanks for the quick and detailed reply!

I will get greedy now and ask you about our remaining requirements for our installer:

Does advanced installer have an application mutex? I'd like to prevent users from accidentally starting the installer up more than once (we have to unpack a lot of files and sometimes the users get impatient).

Can advanced installer forcibly override existing files when doing an install? If a client wants to do a full reinstall after a previous install (instead of an update) we want to be able to overwrite any application files written by the previous installation.

Can advanced installer delete arbitrary files on uninstall? After our product is installed, it can create files in locations other than the application install dir, and we'd like to be able to clean those files up as well on uninstall.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
Does advanced installer have an application mutex? I'd like to prevent users from accidentally starting the installer up more than once
Windows Installer does not allow two MSI-based installations to run at the same time. Therefore, if an installation is in progress then you cannot launch a new instance of the installation.

Note that this happens only for the "InstallExecuteSequence" stage in the installation (when the package is actually installing). If the installation is not in this stage (for example in the UI Sequence when you have the "Welcome" and "Select installation folder" dialogs) then you can launch a new instance of the installation.
Can advanced installer forcibly override existing files when doing an install?
Yes, Advanced Installer allows you to do this by using the "Ensure that this file overwrites any installed target file" option in the "Version" tab of the "Edit File" dialog (to show this dialog you right-click the file and select "Properties").

You can read more about this here:
http://advancedinstaller.com/user-guide ... ialog.html
If a client wants to do a full reinstall after a previous install (instead of an update) we want to be able to overwrite any application files written by the previous installation.
Note that when you launch the MSI of an installation that has already been deployed on the target machine the MSI will go into maintenance mode. When this happens the user can choose between the "Repair", "Modify" and "Remove" options.

If you need to do a full reinstall of a MSI package then you first have to remove it and then reinstall it.
Can advanced installer delete arbitrary files on uninstall? After our product is installed, it can create files in locations other than the application install dir, and we'd like to be able to clean those files up as well on uninstall.
Advanced Installer allows you delete files that were not created by the installation during an uninstall by using the "File Removal" file operation. The File Removal can be added using the "File Operations" button on the toolbar and you will configure it to delete the files you want.

Note that in the "New File Removal" dialog you will set the "Remove On" combo box to "Component Uninstall". In the "Component" combo box you will choose a component that will always be uninstalled.

You can read more about this feature here:
http://www.advancedinstaller.com/user-g ... ialog.html

However, if you need to delete an entire folder you can do it with a custom action. There is a discussion on the forum about this, please take a look:
http://www.advancedinstaller.com/forums ... ove+folder

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”