Exemplo n.º 1
0
        void OnSetupButtonClick(object sender, RoutedEventArgs e)
        {
            if (isFinished)
            {
                new SettingsDialog(configPath)
                {
                    Owner = this
                }.ShowDialog();
                return;
            }

            if (targetPath == null && Keyboard.Modifiers == ModifierKeys.Control)
            {
                try
                {
                    zip.ExtractToDirectory(".");
                }
                catch (Exception ex)
                {
                    UpdateStatusAndFinish(false, "Failed to extract some ReShade files.", ex.Message);
                    return;
                }

                Close();
                return;
            }

            if (Keyboard.Modifiers == ModifierKeys.Alt)
            {
                var dlg = new OpenFileDialog
                {
                    Filter          = "Applications|*.exe",
                    DefaultExt      = ".exe",
                    Multiselect     = false,
                    ValidateNames   = true,
                    CheckFileExists = true
                };

                if (dlg.ShowDialog(this) == true)
                {
                    targetPath = dlg.FileName;

                    InstallationStep0();
                }
            }
            else
            {
                var dlg = new SelectAppDialog();
                dlg.Owner = this;

                if (dlg.ShowDialog() == true)
                {
                    targetPath = dlg.FileName;

                    InstallationStep0();
                }
            }
        }
Exemplo n.º 2
0
        void OnSetupButtonClick(object sender, RoutedEventArgs e)
        {
            if (isFinished)
            {
                new SettingsDialog(configPath)
                {
                    Owner = this
                }.ShowDialog();
                return;
            }

            if (targetPath == null && Keyboard.Modifiers == ModifierKeys.Control)
            {
                try
                {
                    using (ZipArchive zip = ExtractArchive())
                    {
                        zip.ExtractToDirectory(".");
                    }
                }
                catch (Exception ex)
                {
                    UpdateStatusAndFinish(false, "Unable to extract ReShade files.", ex.Message);
                    return;
                }

                Close();
                return;
            }

            var dlg = new SelectAppDialog();

            dlg.Owner = this;

            if (dlg.ShowDialog() == true)
            {
                targetPath = dlg.FileName;

                InstallationStep0();
            }
        }