Skip to content

Manage Cache #343

Closed as not planned
Closed as not planned

Description

Would it make sense to manage/configure the Cache on a Device with a Manifest. In this case I can set the Path to a different folder, I can manage the source path, if I have the possible option to add my own Repository also delete/clear cache at a selected time or also set a maximum size to not fulfil the Hard-drive, also let me mark application to be persistent in the cache for Active-Setup applications.

Thank you

Activity

  1. added
    Issue-Feature
    on May 27, 2020
  2. ghost added
    Needs-Triage
    on May 27, 2020
  3. megamorf commented on May 27, 2020

    @megamorf

    Mirko Colemberg (@slaet) I have trouble understanding what point you're trying to make. There's a local cache[1] of each configured source in winget (winget source list) but that only contains metadata and references to available manifests which currently is a few 100 KB in size. Can you elaborate why you think your hard drive would fill up by using winget?

    Are you asking to be able to override the path where setups will be installed to, e.g. a different hard drive like D:\programs?

    [1]: C:\Program Files\WindowsApps\Microsoft.Winget.Source_2020.527.608.245_neutral__8wekyb3d8bbwe\Public\index.db

  4. riverar commented on May 27, 2020

    @riverar

    Sebastian N. (@megamorf) Do you work at Microsoft?

    I believe Mirko Colemberg (@slaet) is referring to the downloaded packages that sit on disk, presumably forever.

  5. slaet commented on May 27, 2020

    @slaet
    Author

    yes, thank you Rafael Rivera (@riverar) you pointed. I think the setup.exe from a Application will be downloaded first to the Device (to a cache folder) and start the Setup with parameters from the manifest from there? If yes, I like to manage this local cache...

  6. megamorf commented on May 27, 2020

    @megamorf

    The installers are downloaded to %LocalAppData%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\TempState\WinGet\ and removed by winget upon installation:

    2020-5-27 10:57:36.928 [CLI ] WinGet invoked with arguments: 'install' 'glimpse.glimpse'
    2020-5-27 10:57:36.928 [CLI ] Found subcommand: install
    2020-5-27 10:57:36.928 [CLI ] Leaf command to execute: root:install
    2020-5-27 10:57:37.170 [CLI ] Executing command: install
    2020-5-27 10:57:37.204 [REPO] Default source requested, using first source: winget
    2020-5-27 10:57:37.208 [REPO] Named source requested, found: winget
    2020-5-27 10:57:37.208 [REPO] Source past auto update time [5 mins]; it has been at least 76 mins
    2020-5-27 10:57:37.408 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
    2020-5-27 10:57:37.409 [CORE] Found matching extension.
    2020-5-27 10:57:39.203 [REPO] Remote source data was not newer than existing, no update needed
    2020-5-27 10:57:39.288 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
    2020-5-27 10:57:39.288 [CORE] Found matching extension.
    2020-5-27 10:57:39.425 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2020.527.608.245_neutral__8wekyb3d8bbwe\Public\index.db'
    2020-5-27 10:57:39.428 [SQL ] Opening SQLite connection: 'file:/C:/Program Files/WindowsApps/Microsoft.Winget.Source_2020.527.608.245_neutral__8wekyb3d8bbwe/Public/index.db?immutable=1' [1, 40]
    2020-5-27 10:57:39.437 [REPO] Opened SQLite Index with version [1.0], last write [2020-5-27 07:08:53.000]
    2020-5-27 10:57:39.571 [REPO] Performing search: Query:'glimpse.glimpse'[Substring]
    2020-5-27 10:57:39.589 [CLI ] Found one app. App id: Glimpse.Glimpse App name: Glimpse
    2020-5-27 10:57:39.600 [REPO] Downloading manifest
    2020-5-27 10:57:39.600 [CORE] Downloading from url: https://winget.azureedge.net/cache/manifests/Glimpse/Glimpse/2ac4-0.1.2.yaml
    2020-5-27 10:57:40.389 [CORE] Download completed.
    2020-5-27 10:57:40.397 [CLI ] Manifest fields: Name [Glimpse], Version [0.1.2]
    2020-5-27 10:57:40.399 [CLI ] Starting installer selection.
    2020-5-27 10:57:40.399 [CLI ] Completed installer selection.
    2020-5-27 10:57:40.700 [CLI ] Generated temp download path: "C:\\Users\\megamorf\\AppData\\Local\\Packages\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\TempState\\WinGet\\Glimpse.Glimpse.0.1.2"
    2020-5-27 10:57:40.706 [CORE] Downloading to path: "C:\\Users\\megamorf\\AppData\\Local\\Packages\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\TempState\\WinGet\\Glimpse.Glimpse.0.1.2"
    2020-5-27 10:57:40.725 [CORE] Started applying motw to "C:\\Users\\megamorf\\AppData\\Local\\Packages\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\TempState\\WinGet\\Glimpse.Glimpse.0.1.2"
    2020-5-27 10:57:40.729 [CORE] Finished applying motw
    2020-5-27 10:57:40.733 [CORE] Downloading from url: https://github.com/glimpse-editor/Glimpse/releases/download/v0.1.2/glimpse-0.1.2.msi
    2020-5-27 10:59:08.100 [CORE] Download hash: 99c3df2884310cb74c39a15fb63e93fbf2112f581dc5325b37123467618d89e8
    2020-5-27 10:59:08.101 [CORE] Download completed.
    2020-5-27 10:59:08.111 [CLI ] Installer hash verified
    2020-5-27 10:59:08.115 [CLI ] Installer args: /passive /log "C:\Users\megamorf\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\TempState\WinGet\Glimpse.Glimpse.0.1.2.log"
    2020-5-27 10:59:08.122 [CLI ] Successfully renamed downloaded installer. Path: "C:\\Users\\megamorf\\AppData\\Local\\Packages\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\TempState\\WinGet\\Glimpse.Glimpse.0.1.2.msi"
    2020-5-27 10:59:08.127 [CLI ] Starting installer. Path: "C:\\Users\\megamorf\\AppData\\Local\\Packages\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\TempState\\WinGet\\Glimpse.Glimpse.0.1.2.msi"
    + 2020-5-27 10:59:36.467 [CLI ] Removing installer: "C:\\Users\\megamorf\\AppData\\Local\\Packages\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\TempState\\WinGet\\Glimpse.Glimpse.0.1.2.msi"
    2020-5-27 10:59:36.547 [CLI ] Leaf command succeeded: root:install

    Note that many setups are stored in %windir%\Installer so that they can be uninstalled later which has nothing to do with winget.

    Rafael Rivera (@riverar) No, I'm just an enthusiast who wants this project to succeed.

  7. riverar commented on May 27, 2020

    @riverar

    Sebastian N. (@megamorf) The files still remain in app installer's INetCache. Look in %localappdata%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache.

  8. megamorf commented on May 27, 2020

    @megamorf

    Rafael Rivera (@riverar) That path is empty for me after installing the package with ID glimse.glimpse which is an msi based installer.

  9. riverar commented on May 27, 2020

    @riverar

    Sebastian N. (@megamorf) The folders/files are hidden. Try again.

  10. riverar commented on May 27, 2020

    @riverar

    image

    image

  11. megamorf commented on May 27, 2020

    @megamorf

    Rafael Rivera (@riverar) You're right. I can confirm that. I typically have show all hidden and system files enabled but not on this computer, sorry about that.

    PS C:\Users\megamorf> gci -Recurse -Force $env:LocalAppData\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache | select fullname
    
    FullName
    --------
    C:\Users\megamorf\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache\6DZJX28P
    C:\Users\megamorf\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache\NB11U0ZX
    C:\Users\megamorf\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache\container.dat
    C:\Users\megamorf\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache\6DZJX28P\2ac4-0.1.2[1].yaml
    C:\Users\megamorf\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache\NB11U0ZX\glimpse-0.1.2[1].msi
    
  12. slaet commented on May 27, 2020

    @slaet
    Author

    exactly, this Folder %localappdata%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\AC\INetCache I like to manage.
    In my Case this folder is Empty after installing some Packages, but maybe I need the app for another user to run the User Conditions again, for that I like to have more options to manage the content, like hold an application in that cache as persistent for later use. For sure the uninstall is most based in the MSI-ID to run without the sources, and for some exe there is a uninstall.exe at the Installation Path, but what about exe's that only run setup.exe again for uninstall?
    And the %localappdata% is also based on a User-Profile, that's why I like to manage it, on a different location, for example c:\windows\wingetcache that the folder is accessible to all Users on a Device.
    Would that make sense?

  13. removed
    Needs-Triage
    on Jun 2, 2020
  14. added this to the milestone on Jun 2, 2020
  15. cgerke commented on Jun 19, 2020

    @cgerke

    Further to this, cache management would be nice from the perspective of resuming installs. For example if you call winget install on an application, it gets to 100% download but for whatever reason (maybe a user mistake) the uac prompt its not passed then the installation is cancelled. If you run winget install again...it downloads it again. It would be preferrable to use whats already downloaded.

    Correct me if I wrong about this.

  16. 8 remaining items

  17. denelon commented on Feb 2, 2023

    @denelon
    Collaborator

    We've changed the location for the installers to land in the %TEMP% path.
    enih (@enihcam) The Cleanup UI does cover the directory.

    As cache management shouldn't be handled in a manifest which would impact "all" users, we think cache management should be a separate Issue. I've created a discussion to have further conversation.

  18. microsoft-github-policy-service commented on Apr 21, 2023

    @microsoft-github-policy-service
    Contributor

    Mirko Colemberg (@slaet) this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

  19. microsoft-github-policy-service commented on Apr 21, 2023

    @microsoft-github-policy-service
    Contributor

    Mirko Colemberg (@slaet) this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

  20. escape0707 commented on Apr 22, 2023

    @escape0707

    No you don't.

  21. removed
    Needs-Author-Feedback
    on Apr 22, 2023
  22. tb-mtg commented on Nov 2, 2023

    @tb-mtg

    Any updates on this?

  23. 70V07 commented on Feb 27, 2024

    @70V07

    I solve the Installer failed with exit code: 2 using this: winget install -i --id <name.package>

    -i,--interactive / Request interactive installation; user input may be needed

    before I unistalled the program using winget uninstall
    but I dont know if this solution work for every cases possible

    can also try an setup.exe manual from the app site (before try to reinstall) :|

  24. denelon commented on Mar 6, 2024

    @denelon
    Collaborator

    We've added the WinGet Download command to enable downloading applications.

  25. removed this from the milestone on Nov 14, 2024
  26. MulverineX commented on Jan 20, 2026

    @MulverineX

    Demitrius Nelon (@denelon) that doesn't allow you to manually clear the internal cache

  27. denelon commented on Jul 26, 2026

    @denelon
    Collaborator

    Issue summary

    • Request: manage/configure a winget "cache" — set the download/cache path, size limits, clear it, and persist selected installers.

    Current behavior (by design)

    • WinGet downloads an installer to a temporary directory and, once installation completes, removes the installer file (and its now-empty folder). There is no persistent installer cache to manage — installers are intentionally cleaned up after use.
    • If you want to keep an installer, use winget download, which saves it to a location you choose and does not clean it up (and pairs with local-manifest install for offline scenarios).
    • The package source/index (the only long-lived cached data) is managed with winget source (e.g., winget source update, reset).

    Disposition

    • Between post-install cleanup, winget download, and winget source, the scenarios in this request are already covered, and a separately-managed installer cache isn't planned. Closing as not planned.

    Drafted with the help of GitHub Copilot.

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

    Issue-Feature

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions