mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add our installer actions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -7,6 +8,10 @@ using Mono.Options;
|
||||
|
||||
namespace Update
|
||||
{
|
||||
enum UpdateAction {
|
||||
Unset = 0, Install, Uninstall, Download, Update,
|
||||
}
|
||||
|
||||
class Program
|
||||
{
|
||||
static OptionSet opts;
|
||||
@@ -19,16 +24,31 @@ namespace Update
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool silentInstall = false;
|
||||
var updateAction = default(UpdateAction);
|
||||
string target = default(string);
|
||||
|
||||
opts = new OptionSet() {
|
||||
"Usage: Update.exe command [OPTS]",
|
||||
"Manages Squirrel packages",
|
||||
"",
|
||||
"Commands",
|
||||
{ "install=", "Install the app specified by the RELEASES file", v => { updateAction = UpdateAction.Install; target = v; } },
|
||||
{ "uninstall", "Uninstall the app the same dir as Update.exe", v => updateAction = UpdateAction.Uninstall},
|
||||
{ "download=", "Download the releases specified by the URL and write new results to stdout as JSON", v => { updateAction = UpdateAction.Download; target = v; } },
|
||||
{ "update", "Update the application to the latest remote version", v => updateAction = UpdateAction.Update },
|
||||
"",
|
||||
"Options:",
|
||||
{ "h|?|help", "Display Help and exit", v => ShowHelp() }
|
||||
{ "h|?|help", "Display Help and exit", _ => ShowHelp() },
|
||||
{ "s|silent", "Silent install", _ => silentInstall = true},
|
||||
};
|
||||
|
||||
opts.Parse(args);
|
||||
|
||||
if (updateAction == UpdateAction.Unset) {
|
||||
ShowHelp();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user