From 218983ac0d208aebcfda57e2d9a795009a33dccd Mon Sep 17 00:00:00 2001 From: SamvelRaja Date: Mon, 6 Aug 2018 19:37:57 +0530 Subject: [PATCH 1/2] Added updateOnly option to createShortcut command --- src/Update/Program.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Update/Program.cs b/src/Update/Program.cs index f87ab691b..97b9bb4b4 100644 --- a/src/Update/Program.cs +++ b/src/Update/Program.cs @@ -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]", @@ -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}, { "framework-version=", "Set the required .NET framework version, e.g. net461", v => frameworkVersion = v }, }; @@ -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); @@ -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(); @@ -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); } } From 343bb53c0afac694f7ae5a888d1ab46e7fde9cbd Mon Sep 17 00:00:00 2001 From: Mihail Latyshov Date: Wed, 6 Feb 2019 14:22:14 +0530 Subject: [PATCH 2/2] Update src/Update/Program.cs Co-Authored-By: SamvelRaja --- src/Update/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Update/Program.cs b/src/Update/Program.cs index 97b9bb4b4..c55e5e24d 100644 --- a/src/Update/Program.cs +++ b/src/Update/Program.cs @@ -133,7 +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}, + { "updateOnly", "Argument that will be used while creating shortcut, decides whether to just update the shortcuts", v => updateOnly = true}, { "framework-version=", "Set the required .NET framework version, e.g. net461", v => frameworkVersion = v }, };