mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Add test for automatic update
This commit is contained in:
@@ -6,8 +6,10 @@ using Squirrel.Locators;
|
||||
|
||||
try {
|
||||
bool shouldExit = false;
|
||||
bool shouldAutoUpdate = args.Any(a => a.Equals("--autoupdate", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
SquirrelApp.Build()
|
||||
.SetAutoApplyOnStartup(false)
|
||||
.SetAutoApplyOnStartup(shouldAutoUpdate)
|
||||
.WithFirstRun((v) => {
|
||||
debugFile("firstrun", v.ToString());
|
||||
Console.WriteLine("was first run");
|
||||
@@ -24,6 +26,11 @@ try {
|
||||
.WithBeforeUninstallFastCallback((v) => debugFile("args.txt", String.Join(" ", args)))
|
||||
.Run(new ConsoleLogger());
|
||||
|
||||
if (shouldAutoUpdate) {
|
||||
// this shouldn't be reached
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (shouldExit) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user