all groups > visual studio .net setup > july 2007 >
You're in the

visual studio .net setup

group:

VS2005 Installset with custom actions


VS2005 Installset with custom actions bonejon NO[at]SPAM gmail.com
7/10/2007 2:55:47 PM
visual studio .net setup:
Hi All,

I am trying to create a install set that executes custom actions on
both installation and uninstallation. The custom actions are contained
within a c# class that inherits the Installer class.

The class has the overridden Install and Uninstall methods which pass
through to base.Install and base.Uninstall respectively. When call the
compiled dll using installutil.exe both the Install and Uninstall
methods run sucessfully. However when I build the msi and depoly it to
another machine the Install method is executed correctly, however when
I Uninstall the product from add/remove programs I would expect the
Uninstall method to be invoked, however the Install method is being
invoked again.

I could fudge the problem by creating a new class for the Uninstall
method, however I would like to try and understand what it going
wrong.

I would be grateful for any thoughts.

Thanks, Jon.
Re: VS2005 Installset with custom actions Phil Wilson
7/10/2007 4:26:19 PM
The key here isn't your classes, it's what you've done with the custom
actions in the setup project. Typically you'd add your assembly at the
Custom Action node so that if you don't override the base methods still get
called. It looks like you've added your custom action calls in such a way
that the uninstall is calling your Install method.
--
Phil Wilson
[MVP Windows Installer]

[quoted text, click to view]

Re: VS2005 Installset with custom actions Jon
7/11/2007 12:00:00 AM
Hi Phil,

Thanks for your response. I'm new to creating Install Sets in VS so it
could be something I am doing wrong. I have added my assembly to both
the Install and UnInstall sections of the Custom Actions, attached is
a screenshot of the setup.

On the properties of the Install action I have added the condtion of
NOT Installed and set the InstallerClass property to true. On the
Uninstall action there is no condition, and the InstallerClass
property is also set to true. Both custom actions pass through
CustomActionData properties to control the flow of the assembly.

<a href="http://imageshack.us"><img src="http://img218.imageshack.us/
img218/5301/customactionsha6.jpg" border="0" alt="Image Hosted by
ImageShack.us"/></a>

On Jul 11, 12:26 am, "Phil Wilson"
[quoted text, click to view]

AddThis Social Bookmark Button