/[AnywhereTS-MSSQL]/trunk/TSAdminTool/ATSAmdin.Installer.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/ATSAmdin.Installer.cs

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

revision 152 by william, Sun Jul 15 13:01:23 2012 UTC revision 153 by william, Sun Jul 15 13:17:36 2012 UTC
# Line 30  namespace AnywhereTS Line 30  namespace AnywhereTS
30              dlg.ShowDialog();                          dlg.ShowDialog();            
31          }          }
32    
33            private void InstallDatabase()
34            {
35                // install the database
36                Thread db_installer_thread = new Thread(new ThreadStart(InstallDatabaseWaitMessage));
37                db_installer_thread.IsBackground = true;
38                db_installer_thread.Start();
39                Logging.ATSAdminInstallerLog.DebugFormat(@"Installing database: {2} to {0}\{1}", DBServer, DBInstance, ATSGlobals.strDatabaseName);
40                AnywhereTS.DatabaseSupport dbsup = new DatabaseSupport();
41                dbsup.SetupDatabase();
42                dlg.Message = string.Format(@"Successfully installed the database: {2} to {0}\{1}", DBServer, DBInstance, ATSGlobals.strDatabaseName);
43                dlg.ForeColor = Color.Green;
44                Thread.Sleep(new TimeSpan(0, 0, 15));
45                dlg.Close();
46                Logging.ATSAdminInstallerLog.DebugFormat(@"Successfully Installed database: {2} to {0}\{1}", DBServer, DBInstance, ATSGlobals.strDatabaseName);
47            }
48    
49            private void ConfigureATS()
50            {
51                try
52                {
53                    frmAdmin atsadmin = new frmAdmin();
54                    if (!atsadmin.ConfigureATS())
55                    {
56                        throw new Exception("AnywhereTS cannot be installed without configuring it first.");
57                    }
58                }
59                catch (Exception ex)
60                {
61                    // database install failed
62                    using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", ex.GetType().Name, ex.Message, System.Environment.NewLine, ex.ToString())))
63                    {
64                        Logging.ATSAdminInstallerLog.Error("ConfigureATS() failed.");
65                    }
66                    throw ex;
67                }
68            }
69    
70          public override void Install(IDictionary stateSaver)          public override void Install(IDictionary stateSaver)
71          {          {
72              base.Install(stateSaver);              base.Install(stateSaver);
# Line 50  namespace AnywhereTS Line 87  namespace AnywhereTS
87                      ATSGlobals.SetATSRegValue(ProSupport.strRegDatabaseInstance, DBInstance);                      ATSGlobals.SetATSRegValue(ProSupport.strRegDatabaseInstance, DBInstance);
88                      ProSupport.strDatabaseServer = ATSGlobals.GetATSRegValueString(ProSupport.strRegDatabaseServer);                      ProSupport.strDatabaseServer = ATSGlobals.GetATSRegValueString(ProSupport.strRegDatabaseServer);
89                      ProSupport.strDatabaseInstance = ATSGlobals.GetATSRegValueString(ProSupport.strRegDatabaseInstance);                      ProSupport.strDatabaseInstance = ATSGlobals.GetATSRegValueString(ProSupport.strRegDatabaseInstance);
90                      // install the database  
91                      Thread db_installer_thread = new Thread(new ThreadStart(InstallDatabaseWaitMessage));                      InstallDatabase();
92                      db_installer_thread.IsBackground = true;                      ConfigureATS();
                     db_installer_thread.Start();  
                     Logging.ATSAdminInstallerLog.DebugFormat(@"Installing database: {2} to {0}\{1}", DBServer, DBInstance, ATSGlobals.strDatabaseName);  
                     AnywhereTS.DatabaseSupport dbsup = new DatabaseSupport();  
                     dbsup.SetupDatabase();  
                     dlg.Message = string.Format(@"Successfully installed the database: {2} to {0}\{1}", DBServer, DBInstance, ATSGlobals.strDatabaseName);  
                     dlg.ForeColor = Color.Green;  
                     Thread.Sleep(new TimeSpan(0,0,15));  
                     dlg.Close();  
                     Logging.ATSAdminInstallerLog.DebugFormat(@"Successfully Installed database: {2} to {0}\{1}", DBServer, DBInstance, ATSGlobals.strDatabaseName);  
93                  }                  }
94              }              }
95              catch (Exception ex)              catch (Exception ex)

Legend:
Removed from v.152  
changed lines
  Added in v.153

  ViewVC Help
Powered by ViewVC 1.1.22