See attached project. This is a very small test project so I can learn. Here are my questions:
1) I've overridden the Install and Uninstall in my Installer component based class, but they don't seem to get called...why? I am setting a breakpoint in the Install override and running in debugger--you can do that right?:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Runtime.InteropServices; // Deploying a .NET component customization
namespace CustomAction1
{
[RunInstaller(true)]
public partial class Installer1 : Installer
{
public Installer1()
{
InitializeComponent();
}
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
RegistrationServices regSrv = new RegistrationServices();
regSrv.RegisterAssembly(base.GetType().Assembly,
AssemblyRegistrationFlags.SetCodeBase);
}
public override void Uninstall(System.Collections.IDictionary savedState)
{
base.Uninstall(savedState);
RegistrationServices regSrv = new RegistrationServices();
regSrv.UnregisterAssembly(base.GetType().Assembly);
}
}
}
2) How do I invoke the following CustomAction (see below)? It doesn't matter to me whether before or after install, though I would like to know how you tell the setup to do it both ways. I assume you cannot invoke a CustomAction while it performs the actual installation--is that correct assumption?
[CustomAction]
public static ActionResult CustomAction1(Session session)
{
session.Log("Begin CustomAction1");
string[] arguments = GetCustomActionDataArguments(session);
string body = "Arguments:\n";
foreach (string s in arguments)
body += "\t" + s + "\n";
MessageBox.Show(body, "CustomAction1");
return ActionResult.Success;
}
3) How or can I view the msi script directly to see declarations and logic in the IDE? I used to work with InstallShield and you could view and edit the script file directly, which was often easier to find what you are looking for and understand the settings than it is to sift through all the different views in the IDE.
Thanks!