public FinishPage(ScriptRunner runner, IScriptContinuation continuation) { if (runner == null) throw new ArgumentNullException("runner"); if (continuation == null) throw new ArgumentNullException("continuation"); _runner = runner; InitializeComponent(); switch (_runner.Mode) { case ScriptRunnerMode.Install: _headerLabel.Text = String.Format(UILabels.InstallComplete, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.InstallCompleteSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Update: _headerLabel.Text = String.Format(UILabels.UpdateComplete, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UpdateCompleteSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Uninstall: _headerLabel.Text = String.Format(UILabels.UninstallComplete, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UninstallCompleteSubText, runner.Environment.Config.SetupTitle); break; } continuation.Resume(); }
public ProgressPage(ScriptRunner runner, IScriptContinuation continuation) { if (runner == null) { throw new ArgumentNullException("runner"); } InitializeComponent(); switch (runner.Mode) { case ScriptRunnerMode.Install: _header.Text = UILabels.Installing; _header.SubText = String.Format(UILabels.InstallingSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Update: _header.Text = UILabels.Updating; _header.SubText = String.Format(UILabels.UpdatingSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Uninstall: _header.Text = UILabels.Uninstalling; _header.SubText = String.Format(UILabels.UninstallingSubText, runner.Environment.Config.SetupTitle); break; } _progressListBox.Visible = false; continuation.Resume(); }
public FinishPage(ScriptRunner runner, IScriptContinuation continuation) { if (runner == null) { throw new ArgumentNullException("runner"); } if (continuation == null) { throw new ArgumentNullException("continuation"); } _runner = runner; InitializeComponent(); switch (_runner.Mode) { case ScriptRunnerMode.Install: _headerLabel.Text = String.Format(UILabels.InstallComplete, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.InstallCompleteSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Update: _headerLabel.Text = String.Format(UILabels.UpdateComplete, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UpdateCompleteSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Uninstall: _headerLabel.Text = String.Format(UILabels.UninstallComplete, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UninstallCompleteSubText, runner.Environment.Config.SetupTitle); break; } continuation.Resume(); }
public ProgressPage(ScriptRunner runner, IScriptContinuation continuation) { if (runner == null) throw new ArgumentNullException("runner"); InitializeComponent(); switch (runner.Mode) { case ScriptRunnerMode.Install: _header.Text = UILabels.Installing; _header.SubText = String.Format(UILabels.InstallingSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Update: _header.Text = UILabels.Updating; _header.SubText = String.Format(UILabels.UpdatingSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Uninstall: _header.Text = UILabels.Uninstalling; _header.SubText = String.Format(UILabels.UninstallingSubText, runner.Environment.Config.SetupTitle); break; } _progressListBox.Visible = false; continuation.Resume(); }
public InstallLicensePage(ScriptRunner runner, PageInstallLicense action, IScriptContinuation continuation) { if (runner == null) { throw new ArgumentNullException("runner"); } if (action == null) { throw new ArgumentNullException("action"); } if (continuation == null) { throw new ArgumentNullException("continuation"); } _runner = runner; _continuation = continuation; InitializeComponent(); _license.Text = TextUtil.FixNewlines(runner.ParseTemplate(action.Value)); _header.SubText = String.Format(_header.SubText, runner.Environment.Config.SetupTitle); _agree.Text = String.Format(_agree.Text, runner.Environment.Config.SetupTitle); _license.Select(0, 0); }
public void WaitForClose(IScriptContinuation continuation) { if (continuation == null) { throw new ArgumentNullException("continuation"); } _continuation = continuation; }
public void WaitForClose(IScriptContinuation continuation) { var form = (MainForm)FindForm(); form.CloseButtonEnabled = true; form.ProgressChanged -= form_ProgressChanged; continuation.Resume(); }
public void WaitForClose(IScriptContinuation continuation) { var form = (MainForm)FindForm(); form.CloseButtonEnabled = true; form.ProgressChanged -= form_ProgressChanged; continuation.Resume(); }
public InstallDestinationFolderPage(ScriptRunner runner, PageInstallDestinationFolder action, IScriptContinuation continuation) { if (runner == null) { throw new ArgumentNullException("runner"); } if (action == null) { throw new ArgumentNullException("action"); } if (continuation == null) { throw new ArgumentNullException("continuation"); } _runner = runner; _continuation = continuation; InitializeComponent(); _header.SubText = String.Format(_header.SubText, runner.Environment.Config.SetupTitle); _introduction.Text = String.Format( _introduction.Text, runner.Environment.Config.SetupTitle, action.IsLast ? UILabels.InstallContinue : UILabels.NextContinue ); string targetPath = _runner.Variables.GetRequired <string>( Constants.ScriptVariables.TargetPath ); if (!Path.IsPathRooted(targetPath)) { throw new ScriptException(UILabels.TargetPathNotRooted); } if (!Directory.Exists(Path.GetPathRoot(targetPath))) { throw new ScriptException(UILabels.InvalidTargetPathRoot); } long downloadFolderSize = CalculateDownloadFolderSize( runner.Environment.Config.PackageFolder ); _spaceRequired.Text = String.Format(_spaceRequired.Text, Util.FormatSize(downloadFolderSize)); _originalSpaceAvailable = _spaceAvailable.Text; _targetPath.Text = targetPath; _destination.Enabled = action.Enabled; PageUtil.UpdateAcceptButton(_acceptButton, action.IsLast); }
public InstallStartMenuPage(ScriptRunner runner, PageInstallStartMenu action, IScriptContinuation continuation) { if (runner == null) { throw new ArgumentNullException("runner"); } if (action == null) { throw new ArgumentNullException("action"); } if (continuation == null) { throw new ArgumentNullException("continuation"); } _runner = runner; _continuation = continuation; InitializeComponent(); _header.SubText = String.Format(_header.SubText, runner.Environment.Config.SetupTitle); _container.Enabled = action.Enabled; _createStartMenu.Visible = action.CreateStartMenuVisible; _createOnDesktop.Visible = action.CreateOnDesktopVisible; _originalStartMenuFolder = runner.Variables.GetRequired <string>( Constants.ScriptVariables.StartMenuPath ); _createStartMenu.Checked = runner.Variables.GetOptional( Constants.ScriptVariables.CreateShortcuts, true ); _createOnDesktop.Checked = runner.Variables.GetOptional( Constants.ScriptVariables.CreateDesktopShortcuts, true ); _startMenuFolder.Text = _originalStartMenuFolder; var startMenuFolders = new List <string>(); AddStartMenuFolders(startMenuFolders, NativeMethods.SpecialFolderCSIDL.CSIDL_PROGRAMS); AddStartMenuFolders(startMenuFolders, NativeMethods.SpecialFolderCSIDL.CSIDL_COMMON_PROGRAMS); startMenuFolders.Sort((a, b) => String.Compare(a, b, StringComparison.OrdinalIgnoreCase)); foreach (string directory in startMenuFolders) { _startMenuFolders.Items.Add(directory); } PageUtil.UpdateAcceptButton(_acceptButton, action.IsLast); }
public InstallStartMenuPage(ScriptRunner runner, PageInstallStartMenu action, IScriptContinuation continuation) { if (runner == null) throw new ArgumentNullException("runner"); if (action == null) throw new ArgumentNullException("action"); if (continuation == null) throw new ArgumentNullException("continuation"); _runner = runner; _continuation = continuation; InitializeComponent(); _header.SubText = String.Format(_header.SubText, runner.Environment.Config.SetupTitle); _container.Enabled = action.Enabled; _createStartMenu.Visible = action.CreateStartMenuVisible; _createOnDesktop.Visible = action.CreateOnDesktopVisible; _originalStartMenuFolder = runner.Variables.GetRequired<string>( Constants.ScriptVariables.StartMenuPath ); _createStartMenu.Checked = runner.Variables.GetOptional( Constants.ScriptVariables.CreateShortcuts, true ); _createOnDesktop.Checked = runner.Variables.GetOptional( Constants.ScriptVariables.CreateDesktopShortcuts, true ); _startMenuFolder.Text = _originalStartMenuFolder; var startMenuFolders = new List<string>(); AddStartMenuFolders(startMenuFolders, NativeMethods.SpecialFolderCSIDL.CSIDL_PROGRAMS); AddStartMenuFolders(startMenuFolders, NativeMethods.SpecialFolderCSIDL.CSIDL_COMMON_PROGRAMS); startMenuFolders.Sort((a, b) => String.Compare(a, b, StringComparison.OrdinalIgnoreCase)); foreach (string directory in startMenuFolders) { _startMenuFolders.Items.Add(directory); } PageUtil.UpdateAcceptButton(_acceptButton, action.IsLast); }
public InstallDestinationFolderPage(ScriptRunner runner, PageInstallDestinationFolder action, IScriptContinuation continuation) { if (runner == null) throw new ArgumentNullException("runner"); if (action == null) throw new ArgumentNullException("action"); if (continuation == null) throw new ArgumentNullException("continuation"); _runner = runner; _continuation = continuation; InitializeComponent(); _header.SubText = String.Format(_header.SubText, runner.Environment.Config.SetupTitle); _introduction.Text = String.Format( _introduction.Text, runner.Environment.Config.SetupTitle, action.IsLast ? UILabels.InstallContinue : UILabels.NextContinue ); string targetPath = _runner.Variables.GetRequired<string>( Constants.ScriptVariables.TargetPath ); if (!Path.IsPathRooted(targetPath)) throw new ScriptException(UILabels.TargetPathNotRooted); if (!Directory.Exists(Path.GetPathRoot(targetPath))) throw new ScriptException(UILabels.InvalidTargetPathRoot); long downloadFolderSize = CalculateDownloadFolderSize( runner.Environment.Config.PackageFolder ); _spaceRequired.Text = String.Format(_spaceRequired.Text, Util.FormatSize(downloadFolderSize)); _originalSpaceAvailable = _spaceAvailable.Text; _targetPath.Text = targetPath; _destination.Enabled = action.Enabled; PageUtil.UpdateAcceptButton(_acceptButton, action.IsLast); }
public WelcomePage(ScriptRunner runner, IScriptAction action, IScriptContinuation continuation) { if (runner == null) { throw new ArgumentNullException("runner"); } if (continuation == null) { throw new ArgumentNullException("continuation"); } _continuation = continuation; InitializeComponent(); switch (runner.Mode) { case ScriptRunnerMode.Install: _headerLabel.Text = String.Format(UILabels.InstallWelcome, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.InstallWelcomeSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Update: _headerLabel.Text = String.Format(UILabels.UpdateWelcome, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UpdateWelcomeSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Uninstall: _headerLabel.Text = String.Format(UILabels.UninstallWelcome, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UninstallWelcomeSubText, runner.Environment.Config.SetupTitle); break; } bool isLast = false; if (action is PageInstallWelcome) { isLast = ((PageInstallWelcome)action).IsLast; } PageUtil.UpdateAcceptButton(_acceptButton, isLast); }
public InstallLicensePage(ScriptRunner runner, PageInstallLicense action, IScriptContinuation continuation) { if (runner == null) throw new ArgumentNullException("runner"); if (action == null) throw new ArgumentNullException("action"); if (continuation == null) throw new ArgumentNullException("continuation"); _runner = runner; _continuation = continuation; InitializeComponent(); _license.Text = TextUtil.FixNewlines(runner.ParseTemplate(action.Value)); _header.SubText = String.Format(_header.SubText, runner.Environment.Config.SetupTitle); _agree.Text = String.Format(_agree.Text, runner.Environment.Config.SetupTitle); _license.Select(0, 0); }
private void WaitForPageClose(IScriptContinuation continuation) { if (InvokeRequired) { BeginInvoke(new Action(() => WaitForPageClose(continuation))); return; } IWaitablePage waitablePage = null; if (Controls.Count > 0) { waitablePage = Controls[0] as IWaitablePage; } if (waitablePage == null) { throw new NuGetUpdateException(UILabels.PageNotWaitable); } waitablePage.WaitForClose(continuation); }
public WelcomePage(ScriptRunner runner, IScriptAction action, IScriptContinuation continuation) { if (runner == null) throw new ArgumentNullException("runner"); if (continuation == null) throw new ArgumentNullException("continuation"); _continuation = continuation; InitializeComponent(); switch (runner.Mode) { case ScriptRunnerMode.Install: _headerLabel.Text = String.Format(UILabels.InstallWelcome, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.InstallWelcomeSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Update: _headerLabel.Text = String.Format(UILabels.UpdateWelcome, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UpdateWelcomeSubText, runner.Environment.Config.SetupTitle); break; case ScriptRunnerMode.Uninstall: _headerLabel.Text = String.Format(UILabels.UninstallWelcome, runner.Environment.Config.SetupTitle); _wizardLabel.Text = String.Format(UILabels.UninstallWelcomeSubText, runner.Environment.Config.SetupTitle); break; } bool isLast = false; if (action is PageInstallWelcome) isLast = ((PageInstallWelcome)action).IsLast; PageUtil.UpdateAcceptButton(_acceptButton, isLast); }
public void WaitForClose(IScriptContinuation continuation) { if (continuation == null) throw new ArgumentNullException("continuation"); _continuation = continuation; }