InstallCoreAsync deletes packageInfo.ExtractedPath only on the success path. The catch sets result.Message/ExitCode and returns, and there is no finally, so any package that unpacks successfully and then fails during installation leaves its entire extracted tree behind.
GetPackageInfoAsync is not affected — it already cleans up its temp directory in a catch, so a failure during extraction is handled.
The leak is the post-extraction failures: a preinstall/postinstall script returning non-zero, a blocked application, a copy error. Each attempt leaves a full extracted payload. Where the managing client retries hourly and the payload is multiple gigabytes, this consumes the disk, and a full disk then fails installs that would otherwise have succeeded — including packages unrelated to the one that leaked.
Observed as an install failing with:
System.IO.IOException: There is not enough space on the disk.
at ZipFile.ExtractToDirectory(...)
at PackageInstaller.GetPackageInfoAsync(String packagePath, String customTempDir)
on a machine with under 2% of its volume free.
Fix: free the extracted payload in a finally so every exit path releases it.
InstallCoreAsyncdeletespackageInfo.ExtractedPathonly on the success path. Thecatchsetsresult.Message/ExitCodeand returns, and there is nofinally, so any package that unpacks successfully and then fails during installation leaves its entire extracted tree behind.GetPackageInfoAsyncis not affected — it already cleans up its temp directory in acatch, so a failure during extraction is handled.The leak is the post-extraction failures: a preinstall/postinstall script returning non-zero, a blocked application, a copy error. Each attempt leaves a full extracted payload. Where the managing client retries hourly and the payload is multiple gigabytes, this consumes the disk, and a full disk then fails installs that would otherwise have succeeded — including packages unrelated to the one that leaked.
Observed as an install failing with:
on a machine with under 2% of its volume free.
Fix: free the extracted payload in a
finallyso every exit path releases it.