From cc9866845ec05c56f0db9445a919eb6e8fec16f0 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Tue, 19 Aug 2014 13:05:30 -0700 Subject: [PATCH] On initial install, invoke all the apps with FirstRun --- src/Squirrel/UpdateManager.ApplyReleases.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Squirrel/UpdateManager.ApplyReleases.cs b/src/Squirrel/UpdateManager.ApplyReleases.cs index 310bf7fc..08efc6db 100644 --- a/src/Squirrel/UpdateManager.ApplyReleases.cs +++ b/src/Squirrel/UpdateManager.ApplyReleases.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Diagnostics.Contracts; using System.IO; using System.Linq; @@ -193,8 +194,14 @@ namespace Squirrel String.Format("/squirrel-install {0}", currentVersion) : String.Format("/squirrel-updated {0}", currentVersion); - await SquirrelAwareExecutableDetector.GetAllSquirrelAwareApps(targetDir.FullName) - .ForEachAsync(exe => Utility.InvokeProcessAsync(exe, args), 1); + var squirrelApps = SquirrelAwareExecutableDetector.GetAllSquirrelAwareApps(targetDir.FullName); + + // For each app, run the install command in-order and wait + await squirrelApps.ForEachAsync(exe => Utility.InvokeProcessAsync(exe, args), 1); + + // 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 + squirrelApps.ForEach(exe => Process.Start(exe, "/squirrel-firstrun")); } void fixPinnedExecutables(Version newCurrentVersion)