Skip to content

A failed install leaves its extracted payload on disk #24

Description

@rodchristiansen

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions