/[AnywhereTS-MSSQL]/trunk/TSControlPanel/CPanel.Installer.cs
ViewVC logotype

Diff of /trunk/TSControlPanel/CPanel.Installer.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSControlPanel/CPanel.Installer.cs	2012/07/16 10:34:12	166
+++ trunk/TSControlPanel/CPanel.Installer.cs	2012/07/16 14:04:06	183
@@ -18,15 +18,30 @@
         #region install
         public override void Install(IDictionary stateSaver)
         {
+            base.Install(stateSaver);
+            string path = this.Context.Parameters["targetdir"];
+            Logging.UpdateLogPath(string.Format(@"{0}\logs", path));
             using (log4net.NDC.Push("Logged from TSControlPanel.Installer"))
             {
-                CreateRegistryConfigKeys();
+                try
+                {
+                    CreateRegistryConfigKeys();
+                }
+                catch (Exception ex)
+                {
+                    using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", ex.GetType().Name, ex.Message, System.Environment.NewLine, ex.ToString())))
+                    {
+                        Logging.TSControlPanelInstallerLog.Error("Install() failed.");
+                    }
+                    throw ex;
+                }
             }
         }
         private void CreateRegistryConfigKeys()
         {
             try
             {
+                Logging.TSControlPanelInstallerLog.Info("Creating AnywhereTS Control Panel registry settings");
                 Microsoft.Win32.RegistryKey key = null;
                 if (IntPtr.Size == 8)
                 {   // 64 bit OS
@@ -46,6 +61,7 @@
                 // RunFirstTime = 1
                 key.SetValue("RunFirstTime", 1);
                 ATSGlobals.CreateRegistryValues();
+                Logging.TSControlPanelInstallerLog.Info("Successfully created AnywhereTS Control Panel registry Registry settings");
             }
             catch (Exception ex)
             {
@@ -63,6 +79,8 @@
             {
                 try
                 {
+                    string path = this.Context.Parameters["targetdir"];                    
+                    Logging.UpdateLogPath(string.Format(@"{0}\logs", path));
                     Logging.TSControlPanelInstallerLog.DebugFormat("Removing TSControlPanel Registry settings");
                     Microsoft.Win32.RegistryKey key = null;
                     if (IntPtr.Size == 8)
@@ -74,7 +92,7 @@
                     else
                     {   // 32 bit OS
                         //strATSregRoot = @"SOFTWARE\" + ATSGlobals.ApplicationName + @"\ts-config";
-                        key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(string.Format("Software\{0}\{1}", ATSGlobals.ApplicationName, "ts-config"), true);
+                        key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(string.Format(@"Software\{0}\{1}", ATSGlobals.ApplicationName, "ts-config"), true);
                         key.DeleteValue("ControlPanelVersion",false);
                     }
                     Logging.TSControlPanelInstallerLog.DebugFormat("Successfully removed TSControlPanel Registry settings");

 

  ViewVC Help
Powered by ViewVC 1.1.22