From aa8fa8e9bd6029a015cd08814c3360665a2e2b1d Mon Sep 17 00:00:00 2001 From: Tom Plant Date: Sun, 31 May 2026 10:46:45 +1000 Subject: [PATCH] Bubble up child process errors in IndexCreationTool Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Signed-off-by: Tom Plant --- src/WinGetSourceCreator/Helpers.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WinGetSourceCreator/Helpers.cs b/src/WinGetSourceCreator/Helpers.cs index 7e34735064..438860a4aa 100644 --- a/src/WinGetSourceCreator/Helpers.cs +++ b/src/WinGetSourceCreator/Helpers.cs @@ -86,12 +86,7 @@ public static void Unpack(string package, string outDir) string pathToSDK = SDKDetector.Instance.LatestSDKBinPath; string makeappxExecutable = Path.Combine(pathToSDK, "makeappx.exe"); string args = $"unpack /nv /p \"{package}\" /d \"{outDir}\""; - Process p = new Process - { - StartInfo = new ProcessStartInfo(makeappxExecutable, args) - }; - p.Start(); - p.WaitForExit(); + RunCommand(makeappxExecutable, args); } public static void PackWithMappingFile(string outputPackage, string mappingFile) @@ -138,6 +133,11 @@ public static void RunCommand(string command, string args, string? workingDirect } p.Start(); p.WaitForExit(); + + if (p.ExitCode != 0) + { + throw new Exception($"Command failed with exit code {p.ExitCode}: {command} {args}"); + } } // If in the future we edit more elements, this should be a nice wrapper class.