Winget не является внутренней или внешней командой исполняемой программой или пакетным файлом
I'm trying to build mapsme for Android on Windows 8. So far I have done the following steps:
I have stuck with make utility (I'm trying to use mingw32-make). I think that qmake calls make, which results in error ".." не является внутренней или внешней командой, исполняемой программой или пакетным файлом , so it tries running ".." command. I wasn't able get more information from inside of qmake to find the reason, why it fails, but it seems to be related to handling of slashes or backslashes in file paths. Can you help me to find out, what's going wrong here, please?
The full log from gradle goes below.
The text was updated successfully, but these errors were encountered:
zshtern commented Nov 13, 2016
Having the similar failure.
- Windows 7 x64
- Cygwin
- Qt 5.7
- Visual Studio 2015
- Path to Cygwin directory in the PATH variable updated
- Set up local.properties. Set sdk.dir and ndk.dir for correct Android SDK and NDK locations.
- Launch android/script/replace_links.bat to replace symbolic links with actual files.
I've tried to build with cmd.exe under android dir and build with "gradlew installGoogleDebug" command.
Also tried to build with cygwin console.
Here is one of multiple errors during the build of 3party libraries:
make[2]: Entering directory `C:/omim-android-debug-armeabi-v7a-hard/3party/freetype'
/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64 -target armv7-none-linux-androideabi -
Wa,--noexecstack -Wformat -Werror=format-security -Wno-extern-c-compat -Wno-deprecated-register --sy
/platforms/android-15/arch-arm/usr/include/../.. -O0 -g -DDEBUG -D_DEBUG -fvisibility=hidden -DFT2_B
UILD_LIBRARY -DDEBUG -D_DEBUG -IC:/omim-master-inwork/3party/freetype -I. -IC:/omim-master-inwork/3party/freetype/include
-IC:/omim-master-inwork -IC:/omim-master-inwork/3party/boost -IC:/omim-master-inwor
/sources/cxx-stl/llvm-libc++/libcxx/include -IC:/Users/asdf/AppData/Local/Android/sdk1/ndk-bundle
/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/include -IC:/Users/asdf/AppData/Local/An
/sources/cxx-stl/llvm-libc++/../../android/support/include -IC:/Users/asdf/AppData/Local/Android/
/platforms/android-15/arch-arm/usr/include -IC:/omim-master-i
nwork/tools/mkspecs/android-clang -o ../../out/debug/tmp/freetype/afangles.obj C:/omim-master-inwork/3party/freetype/src/autofit/afangles.c
/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64 -target armv7-none-linux-androideabi -
Wa,--noexecstack -Wformat -Werror=format-security -Wno-extern-c-compat -Wno-deprecated-register --sy
/platforms/android-15/arch-arm/usr/include/../.. -O0 -g -DDEBUG -D_DEBUG -fvisibility=hidden -DFT2_B
UILD_LIBRARY -DDEBUG -D_DEBUG -IC:/omim-master-inwork/3party/
freetype -I. -IC:/omim-master-inwork/3party/freetype/include
/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/include -IC:/Users/asdf/AppData/Local/An
/sources/cxx-stl/llvm-libc++/../../android/support/include -IC:/Users/asdf/AppData/Local/Android/
/platforms/android-15/arch-arm/usr/include -IC:/omim-master-i
nwork/tools/mkspecs/android-clang -o ../../out/debug/tmp/freetype/afangles.obj C:/omim-master-inwork/3party/freetype/src/autofit/afangles.c, . ) failed.
make[2]: *** [../../out/debug/tmp/freetype/afangles.obj] Error 2
make[2]: Leaving directory `C:/omim-android-debug-armeabi-v7a
-hard/3party/freetype'
Here is the output off running make directly from freetype folder:
I've installed the App Installer package from the Microsoft Store, however, curiously, I can't run winget. When I do, I get: "'winget' is not recognized as an internal or external command, operable program or batch file."
Now, I've seen a lot of stuff about paths. Also curiously, though, "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps" is already in my PATH.
And also curiously, I've searched the entire drive for any file beginning with "winget", and came up with nothing whatsoever.
I have a feeling this thing never installed, even though it says it did and even though it shows in the Store app as "This product is installed."
Any solution? Or is this true "beta-ware" that really sometimes just doesn't work, and I should just forget about it?
The text was updated successfully, but these errors were encountered:
denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage labels May 27, 2021
arnitdo commented May 27, 2021
Facing a similar problem here. Installed it from the releases page. Searching the C:\ Drive for 'winget' returns no search results apart from Microsoft Store Search cache files. No application exists in WindowsApps\ as well.
Out of curiosity, what does the AppInstallerCLI.exe executable do? Is that supposed to be winget?
mnpenner commented May 27, 2021 •
FWIW, I didn't get winget either when I went to the store page. Said I already had App Installer. But the "directly install" link from the blog post seemed to force an update, and now I have it.
denelon commented May 27, 2021
Out of curiosity, what does the AppInstallerCLI.exe executable do? Is that supposed to be winget?
That is the name for the Windows Package Manager client .exe as compiled/built. We use and App Execution Alias to map winget.exe to AppInstallerCLI.exe .
JoeLyga commented May 27, 2021
Facing the same issue. Running winget produces no output in powershell.
denelon commented May 27, 2021
@JoeLyga are you a Windows Package Manager Insider or running a Windows Insider build?
How did you install the "App Installer"?
billriess commented Jun 1, 2021
I'm also having the no output issue.
impossiblynew commented Jun 1, 2021 •
denelon commented Jun 1, 2021
The Windows Package Manager is distributed with the "App Installer". Make sure you have the correct version that includes the Windows Package Manager. In PowerShell:
Check to see that the version is greater than 1.11
billriess commented Jun 2, 2021
I can confirm that the App Execution Alias is enabled and the Get-AppxPackage microsoft.DesktopAppInstaller gives the following results:
Running winget just gives no output. Curiously, the winget.exe is 0 bytes in the WindowsApps folder.
billriess commented Jun 2, 2021 •
I noticed that running the winget command in a terminal immediately after logging in seems to work. There is likely some interference with another application causing no output. Windows Terminal is installed as is WSL2 with Debian.
denelon commented Jun 2, 2021
The zero byte file is expected. The App Execution Alias maps winget.exe to the true executable. It acts similar to a symlink in *nix. I haven't seen other reports of interactions with WSL2 or any of the other specific distributions, but I'll keep that in mind as others report similar issues.
impossiblynew commented Jun 2, 2021
I noticed that running the winget command in a terminal immediately after logging in seems to work. There is likely some interference with another application causing no output. Windows Terminal is installed as is WSL2 with Debian.
Just wanted to say that the same thing happened with me -- winget suddenly started working without me restarting or making any changes in the middle of a PowerShell session, and that I also have Windows Terminal and WSL2.
This comment has been minimized.
A9G-Data-Droid commented Jun 9, 2021
If I try to manually run the target of that alias I get:
If I try to manually browse to that location and try to run the exe I get an access denied error like this:
This is odd because I am running an elevated Administrator PowerShell session when I get the access denied error. I think this might be the root cause for me.
arnitdo commented Jun 9, 2021
Update : The winget command now works, and the executable is located in C:\Windows\System32. However, upon executing it, I get the following error
This comment has been minimized.
A9G-Data-Droid commented Jun 16, 2021
You're stale @msftbot, we need developer action, not bot auto-closing. If a human wants to close the issue they will. Maybe you should be auto-closed.
arnitdo commented Jun 16, 2021
I think this issue should be permanently kept open until a strong fix is found. It would be great if the bot could have this issue excluded
denelon commented Aug 18, 2021
billriess commented Aug 18, 2021
You can get this error if you have Discord installed. Other applications may cause conflicts as well but I can confirm Discord was an issue for me.
aminya commented Aug 18, 2021 •
Here is the result of the command:
I do have Discord installed. Not sure how that one is related, but I can try uninstalling it.
denelon commented Aug 18, 2021
@billriess can you describe the scenario a bit more and how you came to identify Discord as a possible cause/correlation?
msftbot bot commented Aug 25, 2021
@djhalnon 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.
A9G-Data-Droid commented Aug 25, 2021
The problem still exists:
msftbot bot commented Sep 1, 2021
@djhalnon 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.
A9G-Data-Droid commented Sep 1, 2021
Can we remove the Needs-Author-Feedback flag? Who has this power?
ItzLevvie commented Sep 1, 2021 •
cc @djhalnon: What happens if you open up Command Prompt with administrator privileges and do path %LOCALAPPDATA%\Microsoft\WindowsApps and then run the winget command?
^ Note: This will temporarily reset your current Command Prompt window's %PATH% variable until you exit out of it or close it; so there's no panic involved here by permanently resetting your %PATH% variable.
Issues like these are most likely (?) related to the %PATH% variable where Windows cannot successfully parse %PATH% properly because an application added an additional special character to the %PATH% variable that messes things up which is not actually needed.
^ This %PATH% issue will impact various commands and applications that work with Windows, such as showing that the winget.exe file doesn't exist on your machine, even though it does exist on your machine, et cetera. You can test this out yourself by doing path C:\Windows\System32 and then doing where winget .
I ran into this exact same issue a couple of weeks ago, where the winget command wouldn't work and found out that an application messed up the %PATH% variable by adding additional special characters.
cc @A9G-Data-Droid: You will most likely need to reset the permissions of the WindowsApps folder as it's not really meant to be accessible by any user which is why it's a protected folder and bypassing those permission restrictions will cause various issues to not only your apps, but your OS too.
It would be much better for you to grab the latest ISO image from Microsoft's website and do an in-place upgrade and let Windows handle the rest for you.
A9G-Data-Droid commented Sep 1, 2021
You don't have to modify your path to reach an executable.
You can just run the fully qualified path.
I gave my account explicit Full Control permissions to the WindowsApps folder.
This is what I see from command prompt:
denelon commented Sep 1, 2021
@A9G-Data-Droid, this issue is a bit "generic" and the Needs-Author-Feedback label is used to help close issues if the author hasn't responded. This is likely a broad issue with multiple causes. It's not a "single" and "actionable" issue. We're looking at updating documentation and troubleshooting guides to help with users who believe the package manager is installed, and it's not working. These kinds of issues end up being noise, and others tend to add comments with similar, but not necessarily the same problems and solutions. Once we ship the Windows Package Manager to all Windows 10 versions 1809+ (and all Windows 11 versions) we should be able to redirect users to the guides to help troubleshoot why they aren't able to run winget .
A9G-Data-Droid commented Sep 1, 2021
@denelon Instead of a troubleshooting guide you should ship a binary that works as expected. That would reduce the "noise" you're hearing about it. There should not be a broad issue with multiple causes.
denelon commented Sep 1, 2021
@A9G-Data-Droid I'm not able to reproduce this issue. I'm also not closing the issue with "It works on my machine[tm]". There are certainly many causes for software to end up in an inconsistent state. I noticed the text from you GitHub profile "I am an edge case." (I laughed about it. I know the feeling). In this instance, I believe your system is an demonstrating an edge case.
If you can help us understand what state the system is in, and preferably how the machine got to that state, we can look for a fix. We may not be able to prevent it, and we may not be able to detect it to automatically fix it (or prevent it from ending up in that state), but maybe we can help get it working.
The noise I referred to is other unrelated, but similar in appearance problems. Software is complex. If I was posting an issue like "my car won't start", and many other people said "my car wont start either", it doesn't help solve the problem for "me". Those other messages end up being the "noise" I was referring to.
That's quite different from an issue that says "when a car has no fuel, it won't start". With something like that, maybe a feature like a fuel gauge can be implemented. It might even be enhanced with an audible alert when the fuel is running low.
Similarly, there are several causes to get undesired results when you try to run winget . One might not have the correct version of the App Installer, the PATH environment variable may have been modified by a user or another program. The App Execution Alias may be disabled. Any number of other factors might be the cause. That's what I mean with the term "broad". Hundreds of thousands of users have been able to install and run the Windows Package Manager. I've only seen tens of users with the more generic " winget command does not work". I want everyone to be able to use the Windows Package Manager, and it's going to take time to figure out the various reasons why it doesn't so we can try and fix the underlying issue,
In some cases, if it can't be automatically fixed, we're going to need troubleshooting guides for those. Have you attempted the in-place upgrade suggested by @ItzLevvie? You might also try installing the latest version of the App Installer.
The text was updated successfully, but these errors were encountered:
lancejpollard commented Sep 28, 2012
lancejpollard commented Sep 28, 2012
- windows equivalent of executing the $(./bin/dependencies) .
- an alternative to the Makefile (we could just go back to using Cakefile, that's probably easiest).
Most of the Makefile commands are just wrappers around grunt commands, so you should be able to run those.
lancejpollard commented Sep 28, 2012
@ricick do the latest changes to master work for you now?
ilyategmark commented Sep 29, 2012
@viatropos Lance, you do an amazing job, thousands of people are constantly checking for updates of tower.js. Another thousands of people, those who on windows, are constantly coming back to see if it started working on their computers. I can tell you, that once it does, I'll probably quit django, and most likely stop watching mojito.
And no, your latest changes to the master didn't work for me yet.
thehydroimpulse commented Sep 29, 2012
@ginsent What went wrong? viatropos and I fixed some of the issues but some still remain.
ilyategmark commented Sep 29, 2012
I've just run npm install tower -g and got the same problem as the topic starter rickick had:
C:\Users\flyer\nodist\bin\tower -> C:\Users\flyer\nodist\bin\node_modules\tower
bin\tower
tower@0.4.2-4 postinstall C:\Users\flyer\nodist\bin\node_modules\tower
$(./bin/dependencies)
"$" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
npm ERR! tower@0.4.2-4 postinstall: $(./bin/dependencies)
npm ERR! cmd "/c" "$(./bin/dependencies)" failed with 1
npm ERR!
npm ERR! Failed at the tower@0.4.2-4 postinstall script.
npm ERR! This is most likely a problem with the tower package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! $(./bin/dependencies)
npm ERR! You can get their info via:
npm ERR! npm owner ls tower
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Users\flyer\nodist\bin\..\node.exe" "C:\Users\fly
er\nodist\bin\node_modules\npm\cli.js" "install" "tower" "-g"
npm ERR! cwd C:\Users\flyer
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.59
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\flyer\npm-debug.log
npm ERR! not ok code 0
thehydroimpulse commented Sep 29, 2012
mmmm. I'm running the same command and it returns fine.
thehydroimpulse commented Sep 29, 2012
After trying it inside cmd it does end up failing. I'm guessing that tower on npm isn't up-to-date with the github version. I had replaced the command $(./bin/dependencies) yesterday and if you look in the packages.json file within the scripts: <> it now uses make install-dependencies instead to work with windows.
For now until npm is updated you'll have to do some manual tuning.
First clone the github tower repository and cd into the new directory:
Once it's finished installing all the dependencies link the local tower repo globally against npm:
This should install tower. There are a few more bugs that you'll run into when running tower on windows. I'm trying to sort them out, but until then you can somewhat install tower.
ilyategmark commented Sep 29, 2012
The way, described by TheHydroImpulse works. You've got to install make for windows http://gnuwin32.sourceforge.net/packages/make.htm before running "make install".
ilyategmark commented Sep 29, 2012
Okay, this is what I get after npm link:
Is this how it supposed to be or something wrong? Cause after that, running "tower new app" or just "tower" or just "node c:\tower\bin\tower" doesn't do anything, i.e. process hangs and nothing happens.
thehydroimpulse commented Sep 29, 2012
mmmm. That's a little bit weird. When I run npm link I get:
The procedures are the exact same, hopefully you won't get any errors.
thehydroimpulse commented Oct 1, 2012
Windows now somewhat fully works on my end. There might be one last issue in terms of the controllers but other than that it's fully functional!
ilyategmark commented Oct 1, 2012
I got a load of errors. But this is probably a subject for another issue. Anyway, how the work progresses is amazing. I'm convinced, that Tower.js has huge chances to become defacto standard web development framework on node.js.
lancejpollard commented Oct 1, 2012
Awesome, thanks so much for plowing through this @thehydroimpulse, it's going to be great having this working on windows!
When you guys get errors on windows, just paste the whole error message in this thread so we can help resolve it faster :)
@thehydroimpulse not sure why the pull request didn't merge properly, I tried a few times and the lines I saw that differed I also tried just manually changing so I'll try just copy/pasting your two files in a bit (package.json and tower/server.coffee).
Some of the windows bugs are going to be related to paths that aren't built using path.sep or path.join , so if you guys see and fix those, would love pull requests.
lancejpollard commented Oct 2, 2012
It should fully work on windows now! Let me know if there's anything else. @thehydroimpulse and his windows batch file chops took care of the hard stuff (I mean wtf? lol). The rest is just making sure paths aren't using / but require('path').sep (which you have to escape for regular expressions, and gets a little messy). Cheers.
thehydroimpulse commented Oct 3, 2012
The latest pull request I submitted should fix one of the regular expressions on windows.
lancejpollard commented Oct 5, 2012
Can we close this?
liferealized commented Oct 5, 2012
Just tried to install tower on vanilla windows 7. After installing make for windows and running 'make install' i received this error.
****** B A T C H R E C U R S I O N exceeds STACK limits ******
Recursion Count=593, Stack Usage=90 percent
****** B A T C H PROCESSING IS A B O R T E D ******
pashaie commented Oct 5, 2012
@liferealized, I got same error when installing latest version (4.2-12)
But when I execute tower new app, it cause error which says ejs module not found.
11588 info install tower@0.4.2-12
11589 info postinstall tower@0.4.2-12
11590 verbose unsafe-perm in lifecycle true
11591 silly exec cmd "/c" "make install-dependencies"
11592 silly cmd,/c,make install-dependencies,C:\Users\Pasha\AppData\Roaming\npm\node_modules\tower spawning
11593 info tower@0.4.2-12 Failed to exec postinstall script
11594 info C:\Users\Pasha\AppData\Roaming\npm\node_modules\tower unbuild
11595 verbose from cache C:\Users\Pasha\AppData\Roaming\npm\node_modules\tower\package.json
11596 info preuninstall tower@0.4.2-12
11597 info uninstall tower@0.4.2-12
11598 verbose true,C:\Users\Pasha\AppData\Roaming\npm\node_modules,C:\Users\Pasha\AppData\Roaming\npm\node_modules unbuild tower@0.4.2-12
11599 verbose C:\Users\Pasha\AppData\Roaming\npm,[object Object] binRoot
11600 info postuninstall tower@0.4.2-12
11601 error tower@0.4.2-12 postinstall: make install-dependencies
11601 error cmd "/c" "make install-dependencies" failed with 255
11602 error Failed at the tower@0.4.2-12 postinstall script.
11602 error This is most likely a problem with the tower package,
11602 error not with npm itself.
11602 error Tell the author that this fails on your system:
11602 error make install-dependencies
11602 error You can get their info via:
11602 error npm owner ls tower
11602 error There is likely additional logging output above.
11603 error System Windows_NT 6.1.7601
11604 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "tower" "-g"
11605 error cwd D:\MyProgramming\js\brick
11606 error node -v v0.8.11
11607 error npm -v 1.1.62
11608 error code ELIFECYCLE
11609 verbose exit [ 1, true ]
--------- console error
****** B A T C H R E C U R S I O N exceeds STACK limits ******
Recursion Count=593, Stack Usage=90 percent
****** B A T C H PROCESSING IS A B O R T E D ******
npm ERR! tower@0.4.2-12 postinstall: make install-dependencies
npm ERR! cmd "/c" "make install-dependencies" failed with 255
npm ERR!
npm ERR! Failed at the tower@0.4.2-12 postinstall script.
npm ERR! This is most likely a problem with the tower package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make install-dependencies
npm ERR! You can get their info via:
npm ERR! npm owner ls tower
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "tower" "-g"
npm ERR! cwd D:\MyProgramming\js\brick
npm ERR! node -v v0.8.11
npm ERR! npm -v 1.1.62
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\MyProgramming\js\brick\npm-debug.log
npm ERR! not ok code 0
edubkendo commented Oct 5, 2012
@pashaie you can fix that with:
This has something to do with your node environment, causing ejs not to get installed when the rest of tower's dependencies are.
EDIT: Actually, it looks like when you commented out that line in make.bat, that also comments out all the setup that file does, which includes installing tower's dependencies.
pashaie commented Oct 5, 2012
@edubkendo yeah, make file is supposed to call some command to take care of post-installation step. But instead, it's calling itself!
I installed ejs, but still got error:
events.js:68
throw arguments[1]; // Unhandled 'error' event
^
Error: connect ETIMEDOUT
at errnoException (net.js:769:11)
at Object.afterConnect as oncomplete
lancejpollard commented Oct 5, 2012
@pashaie sorry you're running into this issue, we've been trying to get it working on all platforms and we're so close! I think this is the last issue, the BATCH RECURSION stuff.
The reason that's happening is because we added the ./make.bat file to the root of tower specifically to allow the windows cmd (which can't / doesn't have make from what I understand) to be able to execute that make install-dependencies command.
From what I understand about windows, there are two ways people use the command line (even though there are multiple shells on windows it seems):
- The default cmd shell
- The git bash shell
[Just rehashing to make sure I understand this correctly]. The git bash shell on windows seems to be the preferred (and better) shell, since it's more UNIX-like and it can install things like make . Is that roughly correct?
The thing is, Windows Azure uses the cmd shell, and from what I saw there's no way to install make . However, it is [probably] possible if you skip the simple heroku-like command-line interface to Azure, and just start managing the virtual machines directly; I'm sure you could install git bash and make if you went down that road (and if anyone does I'd love to learn how). That's way too much work though.
But now it seems that, at least on some windows, that make.bat script is causing this BATCH RECURSION issue since you probably already have the actual make installed. Do you know how to make the real make you may have installed on your windows to work alongside this make.bat script? It seems like it should be a straightforward fix but I don't know my way around windows/batch files very well
One solution - if there's no way to keep the make.bat and have it work alongside any real make that may be installed on windows - is to somehow remove it in an npm preinstall hook, but I'd like to avoid that if at all possible.
Any ideas? Looking forward to calling "windows support" done :)
thehydroimpulse commented Oct 5, 2012
@pashaie @liferealized What terminal are you guys using? (cmd, powershell, cygwin, or git bash?)
For starters make does not work on git bash even if you have the actual make installed. (at least in my case it doesn't. Possibly a git bash issue.)
Seems a little strange that some people can't get make.bat to work but others can. I'm running it perfectly fine with both make install and make.bat . Even all the commands such as make watch still work.
It might be an issue with which.bat or where . The bat file make.bat I made uses where , an actual windows default program. Try opening cmd and typing where make .
I've noticed that if you have ruby's devkit installed, it has it's own make program. I'm not sure if it's the same as others but it could be the culprit.
If you have the devkit installed, running .\where make (powershell), where make (cmd) you receive two locations both on separate lines.
The bat file make.bat will choose the first line it finds. So in this case it will run the make.bat . But if you run which.bat make , the results will be inverted and will run devkit's version.
Try running (inside the tower directory) where make and comment the result.
Try running (inside the tower directory) which.bat make and comment the result.
Finally, try editing the make.bat file and replacing the contents on line 10 with:
Что такое менеджер или диспетчер пакетов winget (Windows Package Manager) ?
Разработчики Windows уже давно с завистью смотрят на избыток менеджеров пакетов в Linux. Наличие простого инструмента командной строки, такого как apt или rpm, который установит приложение и все его необходимые компоненты, упрощает установку цепочки инструментов. Все, что вам нужно, это сценарий, который объединяет в цепочку список инструментов.
Такого никогда не было в средах Microsoft, по крайней мере, до появления шаблонов Azure CLI и ARM. Но они предназначены только для облака или для управляемых систем Azure Arc. Они работают на более высоком уровне, чем инструменты, устанавливающие редактор, служебную программу или компилятор, обеспечивая полную инфраструктуру. У пользователей Windows был выбор стороннего Chocolatey, основанного на PowerShell и работающего с собственными установщиками Windows, но это не шло из коробки.
В течение долгого времени люди просили встроенный диспетчер пакетов в Windows и Microsoft Build Microsoft создала версию диспетчера пакетов Windows под названием WinGet. Менеджер пакетов может помочь вам сэкономить время и быстро установить программное обеспечение и инструменты на ваш компьютер. Разработчики и ИТ-специалисты давно хотели иметь собственный менеджер пакетов в Windows, и с WinGet вы это получите.
WinGet.exe - Это утилита командной строки, позволяющая вам скачивать и устанавливать огромное количество программ, со всеми зависимостями прямо у командной строки, не тратя время на поиски официальных сайтов и тому подобное. С помощью Windows Package Manager вы просто вводите простую команду и дело пошло, все можно заскриптовать и автоматизировать, главное наличие интернета.
Winget, это также первая итерация встроенного диспетчера пакетов для Windows, тесно связанная с различными альтернативами и с открытым исходным кодом, особенно с AppGet. Он публикуется на GitHub. Он имеет архитектуру, аналогичную большинству менеджеров пакетов, с использованием манифестов для описания приложений и их требований, с центральным управляемым репозиторием для манифестов, каждый из которых ссылается на сайты загрузки для установщиков приложений.
Способы установить WinGet Windows Package Manager в Windows 10
Для того, что получить и установить Windows Package Manager 1.0 и выше вам необходимо выполнить одно из требований:
Версия 1.0 диспетчера пакетов Windows скоро будет поставляться в виде автоматического обновления через Microsoft Store для всех устройств под управлением Windows 10 версии 1809 и более поздних версий. Так же установить и использовать Windows Package Manager 1.0 можно через групповые политики
Установка менеджера пакета WinGet через Microsoft Store
Данный метод очень простой, тут будет использоваться установщик приложения. Microsoft App Installer для Windows 10 существенно упрощает загрузку неопубликованных приложений для Windows 10. Перейдите на страницу с Microsoft App Installer.
В правой части страницы нажмите "Получить"
Далее подтвердите, что подтверждаете открытие данного приложения через Microsoft Store
Если у вас выскакивает ошибка при скачивании Microsoft App Installer, то нужно посмотреть причину в подробных сведениях. Если проблем нет, то Microsoft App Installer установится без проблем.
В итоге Microsoft App Installer жалуется, что центр обновления Windows отключен.
Установка менеджера пакета WinGet через GitHub и PowerShell
Как я и писал выше весь открытый код Winget выложен на портале GitHub. Суть установки WinGet заключается в том, что необходимо скачать и установить appxbundle пакет. Для этого перейдите по ссылке, где есть список всех релизов и версий:
На момент написания статьи актуальной версией является Windows Package Manager v1.0.11451. Снизу вы увидите список доступных файлов, Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.appxbundle это и есть сам пакет с утилитой WinGet.
Далее вы просто щелкаете по данному пакету и устанавливаете его. Вас уведомят, хотите ли вы обновить установщик приложений, ответьте да.
Начнется процесс обновления. Дожидаемся окончания и можем использовать WinGet.
Давайте я покажу, как с помощью PowerShell можно скачать данный пакет и установить его. Откройте PowerShell от имени администратора и введите:
Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/v1.0.11451/ Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.appxbundle " -OutFile "C:\Temp\WinGet.appxbundle"
Add-AppxPackage "C:\Temp\WinGet.appxbundle"
Первая команда начинает скачивание пакета Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.appxbundle, убедитесь, что у вас создана папка для загрузки.
Далее команда распаковывает пакет и добавляет утилиту WinGet.
На этом установка менеджера пакетов WinGet Windows Package Manager завершена.
Основные ключи winget
Перед тем, как мы разберем установку программ через менеджер пакетов Windows я вам покажу основные ключи, которые будут фигурировать в командах. Запустите командную строку или powerShell, где введите:
- install - Установка указанного пакета
- show - Показывает сведения о пакете
- source - Управление источниками пакетов
- search - Поиск и отображение базовых сведений о пакетах
- list - Отображать установленные пакеты
- upgrade - Обновление указанного пакета
- uninstall - Удаление указанного пакета
- hash - Вспомогательное приложение для хэширования файлов установщика
- validate - Утверждает файл манифеста
- settings - Открыть параметры
- features - Показывает состояние экспериментальных компонентов
- export - Экспортирует список установленных пакетов
- import - Устанавливает все пакеты в файле
Ключи третьего уровня
- -v,--version - Отобразить версию инструмента
- --info - Отображать общие сведения об инструменте
- --silent - Тихая установка
- -e, --exact - Ищет точное совпадение со строкой в запросе, выполняя при этом проверку на учет регистра. Поведение по умолчанию для подстроки не используется
- -i, --interactive - Запускает установщик в интерактивном режиме. При взаимодействии по умолчанию отображается ход выполнения установщика.
- -h, --silent - Запускает установщик в автоматическом режиме. Блокирует весь пользовательский интерфейс. При взаимодействии по умолчанию отображается ход выполнения установщика.
- -o, --log - Направляет данные журнала в файл журнала. Необходимо указать путь к файлу, для которого у вас есть права на запись.
Как установить программное обеспечение с помощью диспетчера пакетов Windows
Теперь вы можете начать использовать winget для установки огромного количества программ, сильно ускорив этот процесс, а дальше я покажу, как это еще и автоматизировать скриптами.
- Первое, что вы должны сделать, это вывести список всех установленных. Сделать это можно через команду:
На выходе вы получите список содержащий: имя, ID и версию установленного пакета.
Обратите внимание, что тут будут перечислены все приложения, которые вы видите и в оснастке "Программы и компоненты", для примера я вывел отдельной командой этот же список для сравнения.
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, Size, InstallDate | Format-Table -AutoSize
- Теперь давайте посмотрим список доступных пакетов, через команду:
Вы увидите огромный список
- Чтобы произвести поиск по ключевому слову во всем списке пакетов, вам нужно воспользоваться ключом search. Я буду искать например "Google" или "Telegram Desktop". Введите:
В результате вы получите все пакеты с ключевым словом "Google". Мне интересен Google Chrome и его версия Canary.
- У вас может возникнуть потребность более подробно посмотреть содержимое пакета с его метаданными, кто его разработчик, версия и все в таком духе, для этого выполните:
Обратите внимание, что можно использовать как имя пакета, так и его ID. Полезной информации будет много.
- Процесс установки приложения через Winget. Тут все просто, в менеджере пакетов Windows есть ключ install, структура будет такой:
Начнется подключение к репозиторию Microsoft и скачивание пакета Google Chrome.
После чего появится окно с установкой Google Chrome
Дожидаемся окончания установки. Проверяем, что приложение появилось в списке.
- Если хотите установить несколько приложений сразу, то вот пример команды, устанавливающей "VLC media player" и "Telegram Desktop". Команда будет выглядеть вот так:
Как видите все успешно отработало и в списке приложений все появилось.
Проверим наши приложения в меню пуск.
- При желании вы можете экспортировать список пакетов, которые у вас установлены в JSON файл, чтобы потом его можно было импортировать. Если вам это нужно вот пример команды:
Бывает, так что некоторые пакеты не могут быть экспортируемы и будут писать "Установленный пакет недоступен из любого источника".
Как использовать winget в скриптах
Логично представить, что если это утилита командной строки или PowerShell, то можно написать скрипт, который вы сами будите запускать на чистой системе или через автозапуск Windows, вам главное чтобы без вашего участия был установлен весь набор софта. для корпоративных компьютеров, это вообще отличное решение, так как установка программ через GPO не всегда возможна, а SCCM есть не у всех.
Самое классное, что если вы еще не разбираетесь в PowerShell, то вы легко можете все равно написать скрипт. Для этого есть отличный интернет ресурс:
winstall - это по сути графический режим для пакетного менеджера Windows Winget. Ресурс имеет огромную базу пакетов, которая присутствует в winget и позволяет вам выбрать их нужное количество, после чего сформировать простой скрипт на PowerShell.
- Первым делом вам необходимо через поиск найти нужные вам пакеты. Пускай в моем примере, это будут: "VLC media player", "Telegram Desktop", "Google Chrome", "Mozilla Firefox".
- Далее, когда вы выбрали все необходимые пакеты, вам необходимо просто нажать кнопку "Generate Script"
- В результате этих простых действий вам будет подготовлено три сценария: bat скрипт для командной строки, скрипт PowerShell и файл для импорта в Winget.
- Далее вам остается просто запустить нужный файл в вашей системе.
Пример скрипта установки приложений через Winget для командной строки Windows
Пример скрипта установки приложений через Winget для PowerShell
Пример импорта Json
Запуск скрипта по установке приложений через менеджер пакетов Windows
Запускать скрипт нужно от имени администратора, если м говорим про сценарий PowerShell, то вам может потребоваться разрешить запуск неподписанных скриптов, иначе может быть ошибка, если не хотите разрешать, то можете конвертировать файл ps1 в exe, это исправит проблему или же запускать его через групповые политики, перед запуском компьютера.
‘winget’ не распознается как внутренняя или внешняя команда, исполняемая программа или пакетный файл.
Вы можете увидеть эту ошибку при попытке войти в крыло в окне командной строки с повышенными привилегиями.
Winget не распознается в Windows 11
Если Winget не распознается в Windows 11, выполните следующие действия:
- Загрузите или обновите установщик приложений
- Загрузите Winget с GitHub
- Укажите правильный путь
Чтобы узнать больше об этих шагах, продолжайте читать.
1]Загрузите или обновите установщик приложений
Это самое первое, что вам нужно сделать, чтобы команда winget работала на вашем компьютере с Windows 11 или Windows 10. Установщик приложений — это не обычный пакет, который можно найти в магазине Microsoft. Это один из самых важных компонентов вашего компьютера с Windows 11, поскольку он содержит winget и различные утилиты.
Если вы отключили или удалили его по ошибке, вы столкнетесь с вышеупомянутой ошибкой на своем ПК. С другой стороны, если вы очень долго не обновляли этот пакет, может возникнуть аналогичная проблема.
2]Загрузите Winget с GitHub.
Если вы не можете загрузить вингет из официального репозитория или магазина Microsoft, вы всегда можете загрузить или обновить его с GitHub. Поскольку вы используете Windows 11, при установке или обновлении пакета не будет проблем с совместимостью.
Если у вас нет пакета на вашем компьютере, вы можете найти Установить вариант. Однако, если у вас уже есть пакет, вы можете найти Переустановить вариант.
После того, как вы выполните инструкции на этом экране, вы сможете без проблем использовать команды winget на своем компьютере.
3]Установите правильный путь
По умолчанию Windows 11 хранит файл winget.exe здесь: %userprofile%\AppData\Local\Microsoft\WindowsApps. Однако, если он удален оттуда, вы можете выполнить вышеупомянутые шаги, чтобы вернуть его. С другой стороны, если ваш путь неверен или вы изменили его ранее, чтобы проверить что-то в прошлом, вам нужно указать правильный путь в Переменные среды раздел.
Чтобы указать правильный путь к winget.exe, выполните следующие действия:
Затем перезагрузите компьютер и проверьте, решает ли он вашу проблему или нет.
Как получить Winget в Windows 11?
Чтобы получить Winget в Windows 11, в основном есть два метода. Во-первых, вы можете следовать официальному методу, то есть использовать Microsoft Store. Вы можете зайти в Microsoft Store и найти Установщик приложений. Затем вы можете установить пакет на свой компьютер. С другой стороны, вы можете посетить GitHub, чтобы загрузить тот же пакет.
Что я могу установить с Winget?
Не существует фиксированного списка приложений, которые вы можете установить с помощью утилиты командной строки Winget. Однако вы можете без проблем установить OneDrive, Google Chrome, Firefox и т. д. С другой стороны, с помощью WINGET можно обновить сразу все установленные программы.
Это все! Надеюсь, это руководство помогло.
Чтение. Массовая установка приложений Windows с помощью графического интерфейса Winstall для диспетчера пакетов Windows.
Читайте также: