private static void Install(bool undo) { try { var appAssembly = Assembly.GetEntryAssembly(); using (var installer = new ProjectInstaller(appAssembly)) { if (undo) { installer.Uninstall(); } else { installer.Install(); } } } catch (Exception ex) { Console.Error.WriteLine(ex); } }