Installer Custom Actions - Missing InstallState on rollback

G

Guest

Hi,

When installing an MSI installation containing a number of custom actions,
if the installer fails on the first custom action, during rollback, the
installer will display an error dialog complaining that it cannot find the
InstallState files for each custom action. And no wonder, since it hadn't
even begun executing the rest of them. is there any way, other than
providing a custom external UI for the MSI and filtering them out, to prevent
these dialogs from being displayed?

Thanks!
 
P

Phil Wilson

Your Installer class methods should be calling the base methods before your
code, assuming it's your code that's failing. Are you calling
base.Install(savedState), base.Commit(savedState) etc?
 
G

Guest

Yes - there are 4 custom actions, and each Install, Rollback, Uninstall and
Commit method in each, calls the base method before doing anything else.

If the installation succeeds, the saved state is available to the uninstall
method - i.e. it correctly loads back everything that was saved while
installing.

It's just when rollback happens, a dialog is popped up for each custom
action (even those that have not yet been executed, saying that the
InstallState file could not be found. Which is as it should be since the
installation didn't get far enough to create the files yet.

This is more of an annoyance than a serious issue for me.

- Ross

Phil Wilson said:
Your Installer class methods should be calling the base methods before your
code, assuming it's your code that's failing. Are you calling
base.Install(savedState), base.Commit(savedState) etc?
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

Ross said:
Hi,

When installing an MSI installation containing a number of custom actions,
if the installer fails on the first custom action, during rollback, the
installer will display an error dialog complaining that it cannot find the
InstallState files for each custom action. And no wonder, since it hadn't
even begun executing the rest of them. is there any way, other than
providing a custom external UI for the MSI and filtering them out, to
prevent
these dialogs from being displayed?

Thanks!
 
C

Chris

Hi Ross,

I'm glad to know I'm not the only person suffering with this anoyance.
Have you found a way to stop the Rollback method being executed on the
custom actions that did not reach the Install method?

I've been thinking about using the condition property (in the Custom
Action Editor of the setup project) of the custom action rollback to
see if I can get the MSI to check the current install state of the
custom action component and decide whether the Rollback method should
be executed. So far I've not had any luck finding a suitable windows
installer condition that does the trick.

If I do come up with anything I'll let you know.

Ross said:
Yes - there are 4 custom actions, and each Install, Rollback, Uninstall and
Commit method in each, calls the base method before doing anything else.

If the installation succeeds, the saved state is available to the uninstall
method - i.e. it correctly loads back everything that was saved while
installing.

It's just when rollback happens, a dialog is popped up for each custom
action (even those that have not yet been executed, saying that the
InstallState file could not be found. Which is as it should be since the
installation didn't get far enough to create the files yet.

This is more of an annoyance than a serious issue for me.

- Ross

Phil Wilson said:
Your Installer class methods should be calling the base methods before your
code, assuming it's your code that's failing. Are you calling
base.Install(savedState), base.Commit(savedState) etc?
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

Ross said:
Hi,

When installing an MSI installation containing a number of custom actions,
if the installer fails on the first custom action, during rollback, the
installer will display an error dialog complaining that it cannot find the
InstallState files for each custom action. And no wonder, since it hadn't
even begun executing the rest of them. is there any way, other than
providing a custom external UI for the MSI and filtering them out, to
prevent
these dialogs from being displayed?

Thanks!
 
G

Guest

Thanks Chris,

Sounds like a good approach, if you can work out how to define the condition.

Ross

Chris said:
Hi Ross,

I'm glad to know I'm not the only person suffering with this anoyance.
Have you found a way to stop the Rollback method being executed on the
custom actions that did not reach the Install method?

I've been thinking about using the condition property (in the Custom
Action Editor of the setup project) of the custom action rollback to
see if I can get the MSI to check the current install state of the
custom action component and decide whether the Rollback method should
be executed. So far I've not had any luck finding a suitable windows
installer condition that does the trick.

If I do come up with anything I'll let you know.

Ross said:
Yes - there are 4 custom actions, and each Install, Rollback, Uninstall and
Commit method in each, calls the base method before doing anything else.

If the installation succeeds, the saved state is available to the uninstall
method - i.e. it correctly loads back everything that was saved while
installing.

It's just when rollback happens, a dialog is popped up for each custom
action (even those that have not yet been executed, saying that the
InstallState file could not be found. Which is as it should be since the
installation didn't get far enough to create the files yet.

This is more of an annoyance than a serious issue for me.

- Ross

Phil Wilson said:
Your Installer class methods should be calling the base methods before your
code, assuming it's your code that's failing. Are you calling
base.Install(savedState), base.Commit(savedState) etc?
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

Hi,

When installing an MSI installation containing a number of custom actions,
if the installer fails on the first custom action, during rollback, the
installer will display an error dialog complaining that it cannot find the
InstallState files for each custom action. And no wonder, since it hadn't
even begun executing the rest of them. is there any way, other than
providing a custom external UI for the MSI and filtering them out, to
prevent
these dialogs from being displayed?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top