Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rolling Back a Windows Service

1 view
Skip to first unread message

Ronen Meyuhas

unread,
Apr 27, 2008, 9:03:00 AM4/27/08
to
Hello,

I am using Visual Studio 2005 to create an MSI for my solution - which
includes some web applications, class libraries and a Windows Service. A
major upgrade is created by setting RemovePreviousVersions to true, and
changing the product Version and ProductCode.

When the installation of the upgrade fails, the application is successfully
rolled back to its previous version, besides the service - which is
completely uninstalled. How can I fix that?

Thanks,

-Ronen

Ronen Meyuhas

unread,
Apr 28, 2008, 12:53:00 AM4/28/08
to
Some more information:
It seems that upon rollback, the previous version is re-installed, but its
custom actions do not run. I did not set any conditions for the custom
actions.

Kalle Olavi Niemitalo

unread,
Apr 28, 2008, 1:59:59 AM4/28/08
to
Ronen Meyuhas <RonenM...@discussions.microsoft.com> writes:

> Some more information:
> It seems that upon rollback, the previous version is re-installed, but its
> custom actions do not run. I did not set any conditions for the custom
> actions.

Instead of using custom actions to install your service,
you could use the ServiceInstall and ServiceControl tables.
Windows Installer would then take care of the rollback.

If you must use custom actions, you need a rollback custom
action. During rollback, Windows Installer runs only those
custom actions that have the msidbCustomActionTypeRollback flag.
I don't know how this MSI concept maps to Visual Studio setup
projects, but System.Configuration.Install.Installer.Rollback
may be involved.

Ronen Meyuhas

unread,
Apr 28, 2008, 10:54:02 AM4/28/08
to
The custom actions for the service are created by Visual Studio, and they all
work fine for the initial installation of the service. When I fail to upgrade
the service, then the service is uninstalled - instead of being rolled back
to its previous version.

In other words:
Upon an upgrade, the current product is uninstalled, and then the new
product version is installed. If the installation of the new version fails,
then it is rolled back and then the old version is installed again - and this
is where the custom action do not run.

Phil Wilson

unread,
Apr 28, 2008, 1:29:36 PM4/28/08
to
If you do the install with a log, msiexec ...... /l*vx <path to some log
file>
what does it say about the rollback to reinstall the service?

There is an internal condition on the rollback custom action. I'm wondering
if it's wrong.

--
Phil Wilson
Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"Ronen Meyuhas" <RonenM...@discussions.microsoft.com> wrote in message
news:9196700C-AFAB-4C63...@microsoft.com...

Ronen Meyuhas

unread,
Apr 29, 2008, 12:26:00 AM4/29/08
to
Phil Hi,

First I would like to tell you how helpful your MSI related posts are - for
me.
I am not sure where to look at in the log in regard to the rollback, so I
uploaded the log for you to check (and tell me where you are looking at):
http://www.intlock.com/temp/log.zip

Thanks!

- Ronen

Phil Wilson

unread,
Apr 30, 2008, 3:34:51 PM4/30/08
to
Well it is calling the rollback, so this is baffling. It's around 20:15:42
in the log. If it wasn't calling the rollback this would be an easier
problem to solve, but if it is calling it and internally it's not working
then all we have is the black box of what's going on inside that code, and
no way to break in.

--
Phil Wilson
Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"Ronen Meyuhas" <RonenM...@discussions.microsoft.com> wrote in message

news:1FE7B617-C357-412D...@microsoft.com...

Ronen Meyuhas

unread,
Apr 30, 2008, 4:15:00 PM4/30/08
to
Thanks for looking at the logs.
The rollback for the upgrade *is* working. After being rolled back, the
files from the previous version are installed - but the custom actions are
not run. Is there any condition I can use for the custom actions, to ensure
they are run after the re-installation of the previous version? Or, how can I
create a log for the re-installation of the previous version?
0 new messages