microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.51k stars 1.39k forks source link

ZIP extraction fails when %temp% is set to a RAMDisk #4520

Open ben20471 opened 3 weeks ago

ben20471 commented 3 weeks ago

Brief description of your issue

Note: I will use git-cola.git-cola as an example package for this issue, but this works with any other package that uses a zip archive during install

I use a RAMDisk to put temporary files on it, and whenever I attempt to install a program that uses a zip file (regardless of the contents being a portable package or an exe installer), the extraction always fails. The problem started to appear when I started to put temporary file on the said RAMDisk, without updating winget or anything else.

Steps to reproduce

1) Download the ImDisk Toolkit and install it to the default location 2) Open C:\Program Files\ImDisk\RamDiskUI.exe 3) Create a RAMDisk of any size big enough for the download 4) Set both %temp% and %tmp% to any folder under the RAMDisk 5) Restart 6) Use winget install git-cola.git-cola

Expected behavior

Silently extracts the zip and successfully installs package

Actual behavior

The package installation fails with the following error: weakly_canonical: Fonction incorrecte.: "R:\Temp\WinGet\git-cola.git-cola.4.6.1\extracted\git-cola-4.6.1.exe"

Environment

Using winget --info:

Gestionnaire de package Windows v1.7.11261
Copyright (c) Microsoft Corporation. Tous droits réservés.

Windows: Windows.Desktop v10.0.19045.4474
Architecture du système : X64
Package : Microsoft.DesktopAppInstaller v1.22.11261.0

Répertoires Winget
-----------------------------------------------------------------------------------------------------------------------------------------
Journaux                                     %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Paramètres utilisateurs                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Répertoire des liens portables (utilisateur) %LOCALAPPDATA%\Microsoft\WinGet\Links
Répertoire des liens portables (ordinateur)  C:\Program Files\WinGet\Links
Racine de package portable (utilisateur)     %LOCALAPPDATA%\Microsoft\WinGet\Packages
Racine du package portable                   C:\Program Files\WinGet\Packages
Racine de package portable (x86)             C:\Program Files (x86)\WinGet\Packages
Téléchargements du programme d’installation  %USERPROFILE%\Downloads

Liens
---------------------------------------------------------------------------------------------
Déclaration de confidentialité        https://aka.ms/winget-privacy
Contrat de licence                    https://aka.ms/winget-license
Avis de tiers                         https://aka.ms/winget-3rdPartyNotice
Page d’accueil                        https://aka.ms/winget
Conditions générales du Windows Store https://www.microsoft.com/en-us/storedocs/terms-of-sale

Paramètre administrateur                  État
---------------------------------------------------
LocalManifestFiles                        Activé
BypassCertificatePinningForMicrosoftStore Désactivé
InstallerHashOverride                     Désactivé
LocalArchiveMalwareScanOverride           Désactivé

Temporary folders environment variables:
TEMP                           R:\Temp
TMP                            R:\Temp
github-actions[bot] commented 3 weeks ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

ben20471 commented 3 weeks ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Just checked, this issue provides a different error. Additionally, while the error in the issue mentioned by the bot is happening before the download even starts, the error mentioned in my issue happens only after downloading and extracting.