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.