protected override void Run()
    {
        Dispatcher = Dispatcher.CurrentDispatcher;
        var model   = new BootstrapperApplicationModel(this);
        var command = model.BootstrapperApplication.Command;

        if (command.Action == LaunchAction.Uninstall && (command.Display == Display.None || command.Display == Display.Embedded))
        {
            model.LogMessage("Starting silent uninstaller.");
            var viewModel = new SilentUninstallViewModel(model, Engine);
            Engine.Detect();
        }
        else
        {
            model.LogMessage("Starting installer.");
            var viewModel = new InstallViewModel(model);
            var view      = new InstallView(viewModel);
            view.Closed += (sender, e) => Dispatcher.InvokeShutdown();
            model.SetWindowHandle(view);
            Engine.Detect();
            view.Show();
        }
        Dispatcher.Run();
        Engine.Quit(model.FinalResult);
    }
        protected override void Run()
        {
            Dispatcher = Dispatcher.CurrentDispatcher;
            var model     = new BootstrapperApplicationModel(this);
            var viewModel = new InstallViewModel(model);

            view    = new InstallView(viewModel);
            restreq = new restart();
            model.SetWindowHandle(view);
            this.Engine.Detect();
            view.Show();
            Dispatcher.Run();
            this.Engine.Quit(model.FinalResult);
        }
 void NextButton(object parameter)
 {
     if (parameter == null) return;
     if (Directory.Exists(parameter.ToString()))
     {
         var wnd = new InstallView(null);
         wnd.Show();
         CloseWindow();
     }
     else if (!Directory.Exists(parameter.ToString()) && !string.IsNullOrEmpty(parameter.ToString()))
     {
      Location = Directory.CreateDirectory(parameter.ToString()).FullName;
      var wnd = new InstallView(null);
      wnd.Show();
      CloseWindow();
     }
 }
Exemplo n.º 4
0
        //This is our UI's primary entry point. This method will be called by the Burn engine.
        protected override void Run()
        {
            //Dispatcher object provides a means for sending messages between the UI thread and any backend threads.
            Dispatcher = Dispatcher.CurrentDispatcher;

            //MVVM pattern
            var model     = new BootstrapperApplicationModel(this);
            var viewModel = new InstallViewModel(model);
            var view      = new InstallView(viewModel);

            // Sets the handle for a Windows Presentation Foundation (WPF) window.
            // This handle is used by the Burn engine when performing the install or uninstall.
            model.SetWindowHandle(view);

            //This will start the Burn engine. engine will go-ahead to check if our bundle is already installed.
            this.Engine.Detect();

            //This code is to wait for a second before closing our flash screen. Otherwise the WPF window will load very fast.
            var timer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(1)
            };

            timer.Start();
            timer.Tick += (sender, args) =>
            {
                model.LogMessage("Time elapsed.Loading the window");
                timer.Stop();
                view.Show();
            };

            //This event is fired when the window is loaded. Here we are closing the flash screen.
            view.Loaded += (sender, e) =>
            {
                model.LogMessage("FrameworkElement loaded event fired.");
                model.CustomBootstrapperApplication.Engine.CloseSplashScreen();
            };

            //halts execution of this method at that line until the Dispatcher is shut down.
            Dispatcher.Run();

            //shut down the Burn engine
            this.Engine.Quit(model.FinalResult);
        }
Exemplo n.º 5
0
        public HiddenView()
        {
            var startupMode = (Application.Current as App).StartupMode;
            ////////////////////////////
            //startupMode = "Update";
            ///////////////////////////
            if (!string.IsNullOrEmpty(startupMode) && startupMode.Equals("Update"))
            {
                var wnd = new InstallView(startupMode);
                wnd.Show();
            }
            else
            {
                var wnd = new PickLocation();
                wnd.Show();
            }

            InitializeComponent();
            this.Close();
        }