diff --git a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs
index 1fdff4cb..59fc493e 100644
--- a/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs
+++ b/WebsitePanel.Installer/Sources/Setup.SchedulerService/Product.wxs
@@ -3,13 +3,23 @@
-
+
+
bannrbmp
-
+
+
+
+
+
+
+
@@ -95,7 +105,9 @@
-
+ (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
+
+ NOT Installed or REINSTALL
@@ -103,8 +115,13 @@
-
+
+
+
+
+
+
@@ -115,8 +132,8 @@
-
-
+
+
diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs b/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs
index eff618a7..dbfaac3c 100644
--- a/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs
+++ b/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs
@@ -34,6 +34,7 @@ using System.IO;
using System.Linq;
using System.ServiceProcess;
using System.Text.RegularExpressions;
+using System.Threading;
using Microsoft.Deployment.WindowsInstaller;
using WebsitePanel.Setup;
@@ -69,6 +70,14 @@ namespace WebsitePanel.SchedulerServiceInstaller
return ActionResult.Success;
}
+ [CustomAction]
+ public static ActionResult FinalizeUnInstall(Session session)
+ {
+ UnInstallService();
+
+ return ActionResult.Success;
+ }
+
private static void InstallService(string installFolder)
{
try
@@ -93,6 +102,26 @@ namespace WebsitePanel.SchedulerServiceInstaller
}
}
+ private static void UnInstallService()
+ {
+ try
+ {
+ var schedulerService =
+ ServiceController.GetServices().FirstOrDefault(
+ s => s.DisplayName.Equals("WebsitePanel Scheduler", StringComparison.CurrentCultureIgnoreCase));
+
+ if (schedulerService != null)
+ {
+ StopService(schedulerService.ServiceName);
+
+ SecurityUtils.DeleteService(schedulerService.ServiceName);
+ }
+ }
+ catch (Exception)
+ {
+ }
+ }
+
private static void ChangeCryptoKey(string installFolder)
{
string path = Path.Combine(installFolder.Replace("SchedulerService", "Enterprise Server"), "web.config");