cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
David_Foyt
Level 2

Custom action to uninstall not working

My product is installed by two installers: A .msi installer created in VisualStudio 2005 with VSTO technology that installs customizations to the Microsoft Word ribbon UI, and a Basic MSI installer built with InstallShield that installs the rest of the app.

Originally I was using custom actions in the InstallShield installer to run the VSTO .msi installer to install and remove the ribbon UI, but this has well-known problems with maintainability. So now I'm trying to install the ribbon UI as a prerequisite, and only to remove it with a custom action, placed in the execute sequence of the Basic MSI installer just before RemoveFiles.

I get two items in Add/Remove programs, as expected: The main app and the ribbon UI, but when I uninstall the main app, the ribbon UI is not removed by the custom action.

I've activated msi logging, but I'm having trouble interpreting the log file. The custom action runs without apparent errors, but the ribbon ui isn't removed. It may be that it is removed and re-installed; I don't understand the log entries well enough to be sure.

I've attached the relevant part of the log as a file attachment to this post. I'd be grateful if someone could tell me what's going wrong and how I can get the custom action to work properly.

Thanks in advance,
David
Labels (1)
0 Kudos
(5) Replies
Christopher_Pai
Level 16

I recently put together an install that had .NET 3.5, VSTO 2005SE and VSTO 3.0 as prereqs. .NET 3.5 is always required and the latter is only required if Office 2003 / Office 2007 ( respectively ) is detected.

Inside my main MSI I had three features. A stand alone tray app. An Office 2003 plugin and an Office 2007 plugin. The latter features are set to INSTALLLEVEL 200 if the respective Office/VSTO is not installed.

I don't use .VSTO / ClickOnce. I authored all of the needed components / customactions straight into my main MSI and as a result I've only got 1 Add/Remove programs entry.
0 Kudos
David_Foyt
Level 2

Thanks, Christopher. Moving all of the components of one of the installers into the other is my fallback plan, but since I already have these two installers built and working, I'd like to re-use them if I can.

David
0 Kudos
orrsella
Level 2

Christopher,

Can you please explain how you packed everything up in one MSI? What custome actions and registry stuff do you need for your Office 12 Add-In to work properly?

Thanks.
0 Kudos
Christopher_Pai
Level 16

I've been meaning to write a white paper on this subject. You'll need to bring a bunch of things together:

1) .NET 3.5 Prereq
2) VSTO 3.0 Prereq ( Conditioned Office 2007 Installed )
3) Blocking SystemSearch/Launch Conditions to check .NET 3.5 and Office 2007 Installed

You'll need a Custom Action to handle installing various certificates ( Use DotNetCoCreateObject and C# wrapper clases for the x509 classes ).

You'll need a Custom Action to generate a Random Number

You'll need a CustomAction to *ADD* a registry key during Install ( something MSI can't do natively )

You'll need some components to handle adding and removing from the registry.

Read through these three threads and it'll speed you up through my original learning curve:

http://blogs.msdn.com/mshneer/archive/2007/09/04/deploying-your-vsto-add-in-to-all-users-part-i.aspx
http://blogs.msdn.com/mshneer/archive/2007/09/05/deploying-your-vsto-add-in-to-all-users-part-ii.aspx

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2625693&SiteID=1
0 Kudos
orrsella
Level 2

Christopher,

Thank you for your response. I've done a lot of reading on this subject, and also read the three links you posted. I'm currently focusing on getting the Add-In to work only for the current user (will get to Misha's articles on all users later as I get things working). I'm still having trouble on getting my Add-In to run on a "clean" machine with no development emvironment. This is what I did:


1) Created a Basic MSI Project using InstallShield 12.

2) Added the .NET Framework 3.5, VSTO Runtime v3.0 as prerequisites.

3) Added Launch Conditions for both prerequisites and Office 2007 being installed.

4) Added the following registry keys using the Registry view of InstallShield:
[HKCU\Software\Microsoft\Office\Word\Addins\MyAddIn]
Description = "MyAddIn Description"
FriednlyName = "MyAddIn"
LoadBehaviour = dword:3
Manifest = "C:\Program Files\MyAddIn\MyAddIn.dll.vsto|vstolocal"

5) Placed MyAddIn.dll, MyAddIn.dll.manifest and MyAddIn.dll.vsto under "C:\Program Files\MyAddIn"

6) Manually granted trust to the Add-In folder "C:\Program Files\MyAddIn" using the CasPol.exe utility. I will later on add this as a Custom Action (using the SetSecurity class provided by Microsoft or an exe CA - although it's considered evil... :D).


I'm still a bit confused about the certificates part. Can you please elaborate on these issues:

- You'll need a Custom Action to handle installing various certificates ( Use DotNetCoCreateObject and C# wrapper clases for the x509 classes ).
- You'll need a Custom Action to generate a Random Number
- You'll need a CustomAction to *ADD* a registry key during Install ( something MSI can't do natively )

Can you please point me in which direction I should continue? Am I doing something wrong?


Many Thanks!
0 Kudos