Israel
Posts: 14
Joined: Mon Dec 17, 2007 2:53 pm

Newcommer questions regarding custom actions

Hi,

Hi I'm new to MSI and currently evaluating Advanced Installer.

I want to run an application that will report the installation status (OK, Failed etc.) at the end of the installation.

I tried doing so using custom actions that was placed in the 'Commit' stage, bit it doesn't run in case the installation fails, and it does run also when performing uninstall.

1) Where should I place the action, and what should be the execution conditions in order that it will run only at the last possible stage when the application is installed?

2) How can I detect whether the installation completed successfully or failed (in order to pass the information to the reporting application)?

3) In case the installation failed, is there a simple way to retrieve the reason using some string property?

Thanks

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

Hi,

Thank you for your interest in Advanced Installer.
I want to run an application that will report the installation status (OK, Failed etc.) at the end of the installation.
I'm not sure why you need this. Please note that the installation process will automatically notify the user if the installation fails. Also, if the installation is successful, the "ExitDialog" dialog will be shown, letting the user know that there were no errors.
1) Where should I place the action, and what should be the execution conditions in order that it will run only at the last possible stage when the application is installed?
In order to execute the custom action in the final stage of the installation you can schedule it under the "InstallFinalize" standard action in the "Custom Actions" page. You can see "InstallFinalize" by using the "Show standard action" button on the toolbar.

Also, to make sure that the custom action will be executed only during the first installation you can set the "Expression" field in the "Custom Action Properties" page to: NOT Installed.
2) How can I detect whether the installation completed successfully or failed (in order to pass the information to the reporting application)?
I'm afraid that this cannot be done directly because the installation process will return a code only after the Windows Installer process is terminated.

However, you can do what you need by using two custom actions:
- one scheduled under "Rollback" which will let the user know that there was an error and the installation failed
- the other scheduled under "Commit" which will let the user know that the installation was successful.

You can read more about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html
3) In case the installation failed, is there a simple way to retrieve the reason using some string property?
I'm afraid that this cannot be done because the installation errors are handled by Windows Installer.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Israel
Posts: 14
Joined: Mon Dec 17, 2007 2:53 pm

More details regarding my requirement

Hi,

Thanks for the replay. Unfortunately, it doesn't solve my problem.

1) Regarding the installation report - I want to run an automatic installation in 'passive' mode.
All data regarding the installation statuses is reported to some central database.
I would like to be able to report for each station whether the installation succeeded or failed, and if it failed, why it failed.

2) I tried to place a custom action in the 'Roll back' section, but the action isn't performed, even though the log file reports it does.

3) I tried placing a 'Set Property' action in the rollback section, and it was performed even though the installation completed successfully.

What am I doing wrong, and is there a better way?


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

Hi,
1) Regarding the installation report - I want to run an automatic installation in 'passive' mode.
This can be done by using the "Limit to basic user interface (simple progress and error handling)" option in the "Install Parameters" page. This option directs Windows Installer to display only a dialog with a progress bar showing the evolution of the installation and the message boxes that display error messages.
All data regarding the installation statuses is reported to some central database.
I would like to be able to report for each station whether the installation succeeded or failed, and if it failed, why it failed.
This can be done by using two custom actions scheduled under the "Rollback" (the installation failed) and "Commit" (the installation was successful) sequences. These custom actions will send messages to the central database, however, I'm not sure how these custom actions will look like.
2) I tried to place a custom action in the 'Roll back' section, but the action isn't performed, even though the log file reports it does.
Please note that the custom actions scheduled under the "Rollback" sequence will be executed only if the installation fails. Also, in the "Custom Actions Properties" page the "Rollback" option must be set in the "Execution Options" section.

If the problem persists please send us the AIP (if it doesn't contain confidential information) or a small test case that reproduces this behavior to support at advancedinstaller dot com so we can investigate this issue.
3) I tried placing a 'Set Property' action in the rollback section, and it was performed even though the installation completed successfully.
Note that a custom action will be performed if it's conditions are met (no matter in which sequence the custom action is added).

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

Return to “Common Problems”