OS: Windows 10 Enterprise N
Dev Environment: VS2022 (64-Bit) Professional (7.5)
Application: VSTO Add-In (Outlook 32-Bit)
The custom action I have closes Outlook during Install. That's working. However, it's not calling my UnInstall code which also closes Outlook.
Is there a way to step through this code?
CUSTOM ACTION CODE
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.Diagnostics;
namespace MySetupCustomActions
{
[RunInstaller(true)]
public class AddCustomizations: Installer
{
public AddCustomizations() : base() { }
// Override the 'Install' method.
public override void Install(IDictionary savedState)
{
base.Install(savedState);
KillProcess("outlook");
}
// Override the 'Commit' method.
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
KillProcess("outlook");
}
// Override the 'Rollback' method.
public override void Rollback(IDictionary savedState)
{
base.Rollback(savedState);
KillProcess("outlook");
}
private void KillProcess(string processName)
{
try
{
var procs = Process.GetProcessesByName(processName);
foreach (var p in procs) { p.Kill(); }
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
static void Main()
{
}
}
}