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.95k stars 1.43k forks source link

Support install location via import #1582

Open denelon opened 2 years ago

denelon commented 2 years ago

Is the following command possible?

winget import -i <import-file> —location <path>

If not, how can I use the import command to control where it should be installed?

Originally posted by @PhilippBaumi in https://github.com/microsoft/winget-cli/discussions/1521#discussioncomment-1467325

denelon commented 2 years ago

The Windows Package Manager import file should be able to support a more complex schema including the install location, even if winget export doesn't (yet).

PhilippBaumi commented 2 years ago

So combine winget import -i <import-file> with —location <path> is not possible if I understand it correctly?

denelon commented 2 years ago

That's correct as you would be attempting to install "all" packages with that path which doesn't make sense in the context of import. We would need to support the location in the schema for the package.json file.

jiaojiaodubai commented 1 year ago

Now (or in the near future), will Winget support exporting with the installation location of the program when using the "export" command? Or can I edit .Json file manually to specify the installation location of each program? Because I may have such requirements: ① Install some programs with large size on disk D; ② Install some private programs in the C: \Users\<UserName>\… folder; ③ Install the portable program into the Ondrive sync folder to back up my portable application and its settings. I have browsed export command And inport command before, but those documents don't seem to help me. ----Translated by fanyi.baidu.com

denelon commented 1 year ago

That will only work for packages where getting their install location is reliable. Since users can still make changes outside of WinGet, we need to make sure that we're not making assumptions on things users might have changed.

Trenly commented 1 year ago

[Policy] Command-Import

gex581990 commented 11 months ago

I also had the same issue and like another stated, updating to preview worked for me BUT for some reason the powershell command to update didn't fix it (even tho it installed properly from what I can tell) but using the Appx packager installer method did work and fixed my issues