If users didn't mark anything as Squirrel-aware, run them all

This commit is contained in:
Paul Betts
2014-08-19 13:08:09 -07:00
parent cc9866845e
commit b5b4472d3a

View File

@@ -199,8 +199,19 @@ namespace Squirrel
// For each app, run the install command in-order and wait
await squirrelApps.ForEachAsync(exe => Utility.InvokeProcessAsync(exe, args), 1);
if (!isInitialInstall) return;
// If this is the first run, we run the apps with first-run and
// *don't* wait for them, since they're probably the main EXE
if (squirrelApps.Count == 0) {
this.Log().Warn("No apps are marked as Squirrel-aware! Going to run them all");
squirrelApps = targetDir.EnumerateFiles()
.Where(x => x.Name.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
.Select(x => x.FullName)
.ToList();
}
squirrelApps.ForEach(exe => Process.Start(exe, "/squirrel-firstrun"));
}