winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

`Install-WinGetPackage -Override` does not take current directory into account unlike `winget install --override`

Open Bratman117 opened this issue 1 year ago • 3 comments

Brief description of your issue

Install-WinGetPackage -Override does not take current directory into account, while winget install --override does.

Steps to reproduce

Current directory contains a Configuration.xml file used for Office install configuration.

PS> Install-WinGetPackage Microsoft.Office -Override "/configure Configuration.xml"

image

PS> winget install Microsoft.Office --override "/configure Configuration.xml"

image

Expected behavior

Install-WinGetPackage -Override

takes current directory into account like

winget install --override

Actual behavior

Full path needs to be specified in installer arguments when using Install-WinGetPackage -Override.

Environment

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

Windows: Windows.Desktop v10.0.22631.3296
Architecture du système : X64
Package : Microsoft.DesktopAppInstaller v1.22.10661.0

Répertoires Winget
-----------------------------------------------------------------------------------------------------------------------
Journaux                                     %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
Paramètres utilisateurs                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
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                        Désactivé
BypassCertificatePinningForMicrosoftStore Désactivé
InstallerHashOverride                     Désactivé
LocalArchiveMalwareScanOverride           Désactivé

Bratman117 avatar Mar 26 '24 08:03 Bratman117

[Policy] Issue Bug [Policy] PowerShell

Trenly avatar Mar 26 '24 11:03 Trenly

This looks like it could be related to the "path" where PowerShell expects ".\" to specify a file in the current path.

Does the following work?

Install-WinGetPackage Microsoft.Office --override "/configure .\Configuration.xml"

denelon avatar Mar 26 '24 16:03 denelon

I don't think that matters because in this case the string is not interpreted by PowerShell but by the Office setup.exe, since it's just passed along as a parameter. I tested it anyway to make sure and was able to reproduce this with both:

Install-WinGetPackage Microsoft.Office -Override "/configure configuration.xml"

and

Install-WinGetPackage Microsoft.Office -Override "/configure .\configuration.xml"

jantari avatar Apr 02 '24 21:04 jantari