You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fix depends on #6426 (re-file of #4181). Today CopyManifestFile fails to create destination subdirectories, so the IndexCreationTool / WinGetSourceCreator path breaks before it ever reaches
index creation - the tool cannot be used at all for anything laid out in
subfolders (which includes every real multi-file manifest).
Both fixes are required for the end-to-end offline-source scenario:
Helpers.PackWithMappingFile in src/WinGetSourceCreator/Helpers.cs resolves makeappx.exe from the detected Windows SDK bin path and invokes it without verifying the executable exists. When the SDK is missing, incomplete, or the detected bin path is wrong, the failure surfaces as an opaque process-launch error instead of a clear, actionable message — costing significant debugging time when building an offline source package.
The sibling method SignFile already validates its inputs (it throws FileNotFoundException when signature.CertFile is missing). PackWithMappingFile should be consistent and fail fast with a clear message when makeappx.exe is not found.
Why this matters (air-gapped / regulated environments)
Offline source packaging with IndexCreationTool / WinGetSourceCreator is the supported path for air-gapped, heavily regulated environments that cannot use a public REST source. These builds frequently run on hardened/locked-down build agents where the Windows SDK layout cannot be assumed. A precise "makeappx.exe not found at <path>" error turns a confusing failure into a one-line fix (install/point at the SDK), which matters a lot when the environment is deliberately minimal.
Proposed fix
In PackWithMappingFile (src/WinGetSourceCreator/Helpers.cs), add an existence check before running the tool:
stringpathToSDK=SDKDetector.Instance.LatestSDKBinPath;stringmakeappxExecutable=Path.Combine(pathToSDK,"makeappx.exe");if(!File.Exists(makeappxExecutable)){thrownewFileNotFoundException($"makeappx.exe not found at {makeappxExecutable}");}stringargs=$"pack /o /nv /f \"{mappingFile}\" /p \"{outputPackage}\"";RunCommand(makeappxExecutable,args);
The same guard could reasonably be applied to the other makeappx.exe / signtool.exe call sites in this file for consistency.
Happy to submit a PR alongside the CopyManifestFile fix (see companion issue).
Prerequisite: #6426 / #4181 must be fixed first
This fix depends on
#6426 (re-file of
#4181). Today
CopyManifestFilefails to create destination subdirectories, so theIndexCreationTool/WinGetSourceCreatorpath breaks before it ever reachesindex creation - the tool cannot be used at all for anything laid out in
subfolders (which includes every real multi-file manifest).
Both fixes are required for the end-to-end offline-source scenario:
CopyManifestFile(prerequisite; without it the tool is unusable for subfoldered input).
Summary
Helpers.PackWithMappingFileinsrc/WinGetSourceCreator/Helpers.csresolvesmakeappx.exefrom the detected Windows SDK bin path and invokes it without verifying the executable exists. When the SDK is missing, incomplete, or the detected bin path is wrong, the failure surfaces as an opaque process-launch error instead of a clear, actionable message — costing significant debugging time when building an offline source package.The sibling method
SignFilealready validates its inputs (it throwsFileNotFoundExceptionwhensignature.CertFileis missing).PackWithMappingFileshould be consistent and fail fast with a clear message whenmakeappx.exeis not found.Why this matters (air-gapped / regulated environments)
Offline source packaging with
IndexCreationTool/WinGetSourceCreatoris the supported path for air-gapped, heavily regulated environments that cannot use a public REST source. These builds frequently run on hardened/locked-down build agents where the Windows SDK layout cannot be assumed. A precise "makeappx.exenot found at<path>" error turns a confusing failure into a one-line fix (install/point at the SDK), which matters a lot when the environment is deliberately minimal.Proposed fix
In
PackWithMappingFile(src/WinGetSourceCreator/Helpers.cs), add an existence check before running the tool:The same guard could reasonably be applied to the other
makeappx.exe/signtool.execall sites in this file for consistency.Happy to submit a PR alongside the
CopyManifestFilefix (see companion issue).Environment
winget-climastersrc/WinGetSourceCreator