Exemplo n.º 1
0
        internal void PrepareFramework()
        {
            try
            {
                while (reboot)
                {
                    microBoot.coreShutdownEvent.Reset();
                    reboot = false;
                    Logger.Debug(Messages.PreparingFramework);
                    dbConf.PrepareDatabase();

                    if (InsideInception())
                    {
                        return;
                    }

                    string appFolder = CheckAppFolder();
                    Logger.Debug(DebugString.Format(Messages.CreatedAppFolder, appFolder));

                    assemblyLoader.UpdateFrameworkAssemblies(appFolder);
                    assemblyLoader.UpdateAddinsDBAssembly();

                    if (rebootCount == 0)
                    {
                        dispatcher.RegisterEvents();
                    }

                    microBoot.AppFolder = appFolder;
                    microBoot.StartInception();
                    microBoot.Boot();
                    microBoot.coreShutdownEvent.WaitOne();
                    rebootCount++;
                }
                reboot = true; // in case we need to start it again (i.e. unit test).
                ContainerManager.Container.Dispose();
                SAPServiceFactory.LogOff();
            }
            catch (Exception e)
            {
                Logger.Fatal(String.Format(Messages.GeneralError, e.Message), e);
                Environment.Exit(10);
            }
        }
Exemplo n.º 2
0
        internal void PrepareFramework()
        {
            try
            {
                while (reboot)
                {
                    reboot = false;
                    Logger.Debug(Messages.PreparingFramework);
                    dbConf.PrepareDatabase();

                    if (InsideInception())
                    {
                        return;
                    }

                    string appFolder = CheckAppFolder();
                    Logger.Debug(DebugString.Format(Messages.CreatedAppFolder, appFolder));

                    assemblyLoader.UpdateAssemblies(AssemblySource.Core, appFolder);
                    assemblyLoader.UpdateAssemblies(AssemblySource.AddIn, appFolder);
                    CopyInstallResources(appFolder, Environment.CurrentDirectory);

                    if (rebootCount == 0)
                    {
                        dispatcher.RegisterEvents();
                    }

                    microBoot.AppFolder = appFolder;
                    microBoot.StartInception();
                    microBoot.Boot();
                    System.Windows.Forms.Application.Run();
                    rebootCount++;
                }
                ContainerManager.Container.Dispose();
                SAPServiceFactory.LogOff();
            }
            catch (Exception e)
            {
                Logger.Fatal(String.Format(Messages.GeneralError, e.Message), e);
                Environment.Exit(10);
            }
        }