Ejemplo n.º 1
0
        void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (!App.mArgs.Any())
            {
                MessageBox.Show("Builder not meant to be called directly. Use install.bat instead.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
                return;
            }

            LoadPosition();
            mLoaded = true;

            string xAppPath = AppContext.BaseDirectory;

            mCosmosDir = Path.GetFullPath(xAppPath + @"..\..\..\..\");
            mSetupPath = Path.Combine(mCosmosDir, @"Setup\Output\" + CosmosTask.GetSetupName(mReleaseNo) + ".exe");
            if (App.InstallTask)
            {
                InstallScheduledTask();
                Close();
            }
            else if (!Build())
            {
                Close();
            }
        }
Ejemplo n.º 2
0
        public bool Build()
        {
            Log.LogLine    += new Installer.Log.LogLineHandler(Log_LogLine);
            Log.LogSection += new Installer.Log.LogSectionHandler(Log_LogSection);
            Log.LogError   += new Installer.Log.LogErrorHandler(Log_LogError);

            if (App.IsUserKit)
            {
                mReleaseNo = Int32.Parse(DateTime.Now.ToString("yyyyMMdd"));
            }
            if (mPreventAutoClose)
            {
                return(true);
            }

            var xTask = new CosmosTask(mCosmosDir, mReleaseNo);

            var xThread = new System.Threading.Thread(delegate() {
                xTask.Run();
                ThreadDone();
            });

            xThread.Start();

            return(true);
        }
Ejemplo n.º 3
0
        public bool Build()
        {
            if (App.IsUserKit)
            {
                do
                {
                    string x = Interaction.InputBox("Enter Release Number", "Cosmos Builder");
                    if (string.IsNullOrEmpty(x))
                    {
                        return(false);
                    }
                    if (false == int.TryParse(x, out mReleaseNo))
                    {
                        MessageBox.Show("Please use only a number!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    else
                    {
                        break;
                    }
                } while (true);
            }
            else
            {
                if (App.UseTask)
                {
                    if (!ScheduledTaskIsInstalled())
                    {
                        InstallTaskAsAdmin();
                    }
                }
            }
            if (mPreventAutoClose)
            {
                return(true);
            }

            var xTask = new CosmosTask(mCosmosDir, mReleaseNo);

            xTask.Log.LogLine    += new Installer.Log.LogLineHandler(Log_LogLine);
            xTask.Log.LogSection += new Installer.Log.LogSectionHandler(Log_LogSection);
            xTask.Log.LogError   += new Installer.Log.LogErrorHandler(Log_LogError);

            var xThread = new System.Threading.Thread(delegate() {
                xTask.Run();
                ThreadDone();
            });

            xThread.Start();

            return(true);
        }
Ejemplo n.º 4
0
    public bool Build() {
      if (App.IsUserKit) {
        do {
          string x = Interaction.InputBox("Enter Release Number", "Cosmos Builder");
          if (string.IsNullOrEmpty(x))
          {
            return false;
          }
          if (false == int.TryParse(x, out mReleaseNo))
            MessageBox.Show("Please use only a number!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
          else
            break;
        } while (true);
      } else {
        if (App.UseTask) {
          if (!ScheduledTaskIsInstalled()) {
            InstallTaskAsAdmin();
          }
        }
      }
      if (mPreventAutoClose)
        return true;

      var xTask = new CosmosTask(mCosmosDir, mReleaseNo);
      xTask.Log.LogLine += new Installer.Log.LogLineHandler(Log_LogLine);
      xTask.Log.LogSection += new Installer.Log.LogSectionHandler(Log_LogSection);
      xTask.Log.LogError += new Installer.Log.LogErrorHandler(Log_LogError);

      var xThread = new System.Threading.Thread(delegate() {
        xTask.Run();
        ThreadDone();
      });
      xThread.Start();

      return true;
    }