Skip to content

Add Silent Mode option to AutoUpdater #746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AutoUpdater.NET/AutoUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ public static class AutoUpdater
/// </summary>
public static bool ShowSkipButton = true;

/// <summary>
/// Set this to true if you want to hide the download dialog (silent mode).
/// </summary>
public static bool Silent = false;

/// <summary>
/// Set this to true if you want to run update check synchronously.
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions AutoUpdater.NET/DownloadUpdateDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public DownloadUpdateDialog(UpdateInfoEventArgs args)
{
ControlBox = false;
}

// Silent mode: hide the dialog
if (AutoUpdater.Silent)
{
WindowState = FormWindowState.Minimized;
ShowInTaskbar = false;
Visible = false;
}
}

private void DownloadUpdateDialogLoad(object sender, EventArgs e)
Expand Down