Groups | Blog | Home
all groups > visual studio .net setup > june 2005 >

visual studio .net setup : MSI "Repair" destroys installstate of custom installer


Alexander Groß
6/2/2005 12:00:00 AM
Hi everyone,

I've created a custom installer that creates a database on a SQL Server
using VS.NET 2003. During the installation of the application the user is
asked for the database server, database name and so on. This information is
saved by the stateSaver in my custom installer. I need it later when
uninstalling the app and dropping the database.

However, if the user decides to perform a repair installation this
information is deleted from the .installstate file. On uninstallation I will
not be able to perform the given task of dropping the database.

What can I do to prevent Windows Installer to call my custom installer on
any repair installation. Even better, how can I tell the installer *not* to
delete important information from the file?

Your help is greatly appreciated.

Best regards,

Alex

X-Post, F'Up set to m.p.vsnet.s

--
_______________________________________

Alexander Groß
Dipl.-Ing. (BA) für Informationstechnik
PLEASEAlexanderGrossREMOVETHIS@gmx.de
http://www.it99.org/axl
ICQ# 36765668
_______________________________________

Phil Wilson
6/2/2005 11:26:06 AM
The repair is calling your custom action again, and those properties are all
undefined, so I assume that your code is overwriting those install-time
values with empty values. A condition of Not Installed on your custom action
should help (Installed is case sensitive - it's a property that is set if
your product is already installed).
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Alexander Groß
6/3/2005 1:02:56 AM
Hi Phil,

thanks for your quick reply.

[quoted text, click to view]
| The repair is calling your custom action again, and those properties
| are all undefined, so I assume that your code is overwriting those
| install-time values with empty values.

Yes, the debugger shows that the stateSaver collection is empty (or at least
not containing the values I set on first install) at the start of
MyInstaller.Install() when doing a repair. I don't overwrite the stateSaver
values because I've got no idea where to get them from. I've implemented a
way to exit Install() immediately when a repair install is triggered. It
seems as the MSI runtime decides to throw my persisted values away as the
repair's stateSaver is empty. Not sure if this works as it should. Or am I
doing wrong?

| A condition of Not Installed
| on your custom action should help (Installed is case sensitive - it's
| a property that is set if your product is already installed).

I am not quite sure what you mean here. As far as I've read in the docs I've
got no way to set properties in my .NET code. Do I?

Again, thanks for your help - I am new to MSI and haven't found a good
overview on the subject. Any recommendations?

Best regards,

Alex

--
_______________________________________

Alexander Groß
Dipl.-Ing. (BA) für Informationstechnik
PLEASEAlexanderGrossREMOVETHIS@gmx.de
http://www.it99.org/axl
ICQ# 36765668
_______________________________________

Phil Wilson
6/3/2005 7:24:17 AM
I'm assuming your custom installer is an installer class custom action, and
you're calling it during the install as an Install custom action. If so, the
properties on the custom action have a condition where you can add Not
Installed. The custom action then won't get called if the product is already
installed.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

[quoted text, click to view]

AddThis Social Bookmark Button