Skip to content
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

Added updateOnly option to createShortcut command #1368

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
8 changes: 5 additions & 3 deletions src/Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ int executeCommandLine(string[] args)
bool shouldWait = false;
bool noMsi = (Environment.OSVersion.Platform != PlatformID.Win32NT); // NB: WiX doesn't work under Mono / Wine
bool noDelta = false;
bool updateOnly = false;

opts = new OptionSet() {
"Usage: Squirrel.exe command [OPTS]",
Expand Down Expand Up @@ -132,6 +133,7 @@ int executeCommandLine(string[] args)
{ "l=|shortcut-locations=", "Comma-separated string of shortcut locations, e.g. 'Desktop,StartMenu'", v => shortcutArgs = v},
{ "no-msi", "Don't generate an MSI package", v => noMsi = true},
{ "no-delta", "Don't generate delta packages to save time", v => noDelta = true},
{ "updateOnly", "Argument that will be used while creating shortcut, decides whether to just update the shortcuts", v => updateOnly = false},
SamvelRaja marked this conversation as resolved.
Show resolved Hide resolved
{ "framework-version=", "Set the required .NET framework version, e.g. net461", v => frameworkVersion = v },
};

Expand Down Expand Up @@ -173,7 +175,7 @@ int executeCommandLine(string[] args)
UpdateSelf().Wait();
break;
case UpdateAction.Shortcut:
Shortcut(target, shortcutArgs, processStartArgs, setupIcon);
Shortcut(target, shortcutArgs, updateOnly, processStartArgs, setupIcon);
break;
case UpdateAction.Deshortcut:
Deshortcut(target, shortcutArgs);
Expand Down Expand Up @@ -473,7 +475,7 @@ public void Releasify(string package, string targetDir = null, string packagesDi
}
}

public void Shortcut(string exeName, string shortcutArgs, string processStartArgs, string icon)
public void Shortcut(string exeName, string shortcutArgs, bool updateOnly, string processStartArgs, string icon)
{
if (String.IsNullOrWhiteSpace(exeName)) {
ShowHelp();
Expand All @@ -485,7 +487,7 @@ public void Shortcut(string exeName, string shortcutArgs, string processStartArg
var locations = parseShortcutLocations(shortcutArgs);

using (var mgr = new UpdateManager("", appName)) {
mgr.CreateShortcutsForExecutable(exeName, locations ?? defaultLocations, false, processStartArgs, icon);
mgr.CreateShortcutsForExecutable(exeName, locations ?? defaultLocations, updateOnly, processStartArgs, icon);
}
}

Expand Down