private bool GetConfiguration()
        {
            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();

            ofd.Title = "Please specify the installation configuration to load...";

            ofd.Filter = "json files (*.json)|*.json";

            if (ofd.ShowDialog() == true)
            {
                DataModel.InstallationConfiguration = InstallationConfiguration.LoadConfiguration(ofd.FileName);
            }
            else
            {
                MessageBox.Show("This operation cannot be completed without loading an installation configuration file. The installer will now exit.");

                Dispatcher.BeginInvoke(new Action(() =>
                {
                    Application.Current.MainWindow.Close();
                }));

                return(false);
            }

            return(true);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InstallerModel"/> class.
        /// </summary>
        /// <param name="mainWindow">The owning UI element.</param>
        public InstallerModel(UIElement mainWindow)
        {
            InstallationConfiguration = new InstallationConfiguration();
            Progress           = new WizardProgress();
            Page               = new WizardPage();
            OperationsProgress = new OperationsProgress();

            InstallationConfiguration.LoadConfiguration();

            ShowCrmLink = false;

            PreviousEnabled = true;
            NextEnabled     = true;

            ShowStatus   = false;
            ShowProgress = false;
            ShowPrevious = false;
            ShowNext     = true;
            ShowCancel   = true;
            ShowFinish   = false;

            InstallerAction = InstallerActionType.New;
        }