public Installer(string filename)
        {
            if (Keyboard.Modifiers == ModifierKeys.Shift) {
                Logger.Errors = true;
                Logger.Messages = true;
                Logger.Warnings = true;
                verbose = true;
            }

            // we'll take it from here...
            try {

                MsiFilename = filename;
                InstallTask = Task.Factory.StartNew(StartInstall);

                // if we got this far, CoApp must be running.
                Application.ResourceAssembly = Assembly.GetExecutingAssembly();
                var window = new InstallerMainWindow(this);
                window.ShowDialog();

                if (Application.Current != null) {
                    Application.Current.Shutdown(0);
                }
            } catch (Exception e) {
                MessageBox.Show(e.StackTrace, e.Message);
            }
        }
Beispiel #2
0
        public Installer(string filename)
        {
            // we'll take it from here...
            try {
                MsiFilename = filename;
                InstallTask = Task.Factory.StartNew(StartInstall);

                // if we got this far, CoApp must be running.
                try {
                    Application.ResourceAssembly = Assembly.GetExecutingAssembly();
                }
                catch { }

                var window = new InstallerMainWindow(this);
                window.ShowDialog();

                if (Application.Current != null) {
                    Application.Current.Shutdown(0);
                }
            } catch (Exception e) {
                MessageBox.Show(e.StackTrace, e.Message);
            }
        }
Beispiel #3
0
        public Installer(string filename)
        {
            try {
                MsiFilename = filename;
                Task.Factory.StartNew(() => {
                    // was coapp just installed by the bootstrapper?
                    if (((AppDomain.CurrentDomain.GetData("COAPP_INSTALLED") as string) ?? "false").IsTrue()) {
                        // we'd better make sure that the most recent version of the service is running.
                        EngineServiceManager.InstallAndStartService();
                    }
                    InstallTask = LoadPackageDetails();
                });

                bool wasCreated;
                var ewhSec = new EventWaitHandleSecurity();
                ewhSec.AddAccessRule(new EventWaitHandleAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), EventWaitHandleRights.FullControl, AccessControlType.Allow));
                _ping = new EventWaitHandle(false, EventResetMode.ManualReset, "BootstrapperPing", out wasCreated, ewhSec);

                // if we got this far, CoApp must be running.
                try {
                    Application.ResourceAssembly = Assembly.GetExecutingAssembly();
                }
                catch { }

                window = new InstallerMainWindow(this);
                window.ShowDialog();

                if (Application.Current != null) {
                    Application.Current.Shutdown(0);
                }
                ExitQuick();
            } catch (Exception e) {
                DoError(InstallerFailureState.FailedToGetPackageDetails, e);

            }
        }
Beispiel #4
0
		/// <summary>Starts the window of the application, and then presents the provided error message message.</summary>
		/// <param name="eventName">Name of the event that is used to signal to Altaxo that Altaxo should be stopped.</param>
		/// <param name="message">The error message to present.</param>
		private static void StartVisualAppWithErrorMessage(string eventName, string message)
		{
			if (null != eventName)
				UpdateInstaller.SetEvent(eventName); // Altaxo is waiting for this event to finish itself

			if (null == app)
			{
				app = new System.Windows.Application();
			}
			if (null == mainWindow)
			{
				mainWindow = new InstallerMainWindow(true, int.MaxValue);
				mainWindow.SetErrorMessage(message);
				app.Run(mainWindow);
			}
			else
			{
				mainWindow.SetErrorMessage(message);
			}
		}
Beispiel #5
0
		/// <summary>Starts the window of the application, and then runs the provided installer program.</summary>
		/// <param name="installer">The installer program to run..</param>
		private static void StartVisualApp(UpdateInstaller installer, bool showInstallationWindow, int timeoutAfterSuccessfullInstallation)
		{
			if (null == app)
			{
				app = new System.Windows.Application();
			}
			if (null == mainWindow)
			{
				mainWindow = new InstallerMainWindow(showInstallationWindow, timeoutAfterSuccessfullInstallation);
				mainWindow._installer = installer;
				app.Run(mainWindow);
			}
		}