choco-url to easily install a package via one click like with AptProtocol (apt://)
i'm not sure where to post this, so please bear with me if this is the wrong place!
i like AptProtocol for its easiness to suggest installation of a package either on a website, in an email or in any other document via one click (resp. a second one to confirm it's installation).
IMHO a choco-protocol - or maybe also work with apt:// - would be a nice tool to provide the simplest method possible to install packages from chocolatey.
e.g. chocolateygui is nice but i rather use https://chocolatey.org/packages to browse the packages because it provides more information. after that i have open powershell and type the install-command (which is ok), but noobs have to open chocolateygui, wait for a refresh and look for the correct package again to install it. instead of this bunch of additional steps and time a little "install now"-button at the homepage would ease the things a lot.
I like this idea, like you I actually find the packages I want on the webpage first (easier than searching through the CLI IMO).
So having this would definitely make it easier. Seems to be pretty easy to set up as well, changing a few registry settings to pass the correct arguments to the client and updating the website to have a link with the correct protocol.
@AdmiringWorm @DJCrashdummy if I have understood this correctly, we would need the ability to pass a navigation parameter into Chocolatey GUI to directly navigate to a Package Details page. Or have I misunderstood this?
@AdmiringWorm which registry keys are you referring to? Do you have a link to what you are describing?
if I have understood this correctly, we would need the ability to pass a navigation parameter into Chocolatey GUI to directly navigate to a Package Details page. Or have I misunderstood this?
No, to the CLI itself. And not to navigate, but to actually install (unless I misunderstood it myself).
@AdmiringWorm which registry keys are you referring to? Do you have a link to what you are describing?
Something along the line of:
[HKEY_CLASSES_ROOT\apt]
@="URL:Apt Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\apt\shell]
[HKEY_CLASSES_ROOT\apt\shell\open]
[HKEY_CLASSES_ROOT\apt\shell\open\command]
@="\"choco\" install \"%1\""
^^ may need full path to choco.exe
I believe the above would allow for urls like apt://git (for installing git)
It may be possible for something along the lines of using:
[HKEY_CLASSES_ROOT\apt]
@="URL:Apt Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\apt\shell]
[HKEY_CLASSES_ROOT\apt\shell\open]
[HKEY_CLASSES_ROOT\apt\shell\open\command]
@="\"choco\" %1 \"%2\""
To allow for urls like apt://install/git or apt://upgrade/git (but this is something I have no idea if it works)
source was found here: https://support.shotgunsoftware.com/hc/en-us/articles/219031308-Launching-applications-using-custom-browser-protocols
NOTE: I have not yet tested this myself, but have seen something similar being used in the past.
Could this be accomplished as well via a browser plugin to open nuspkg files using "choco install" upon download?
@bcurran3 said: Could this be accomplished as well via a browser plugin to open nuspkg files using "choco install" upon download?
I honestly don't know, but it probably could.
~Anyways, I tested out the registry changes, and it does indeed work. Unfortunately due to the nature of chocolatey where it needs to run as an admin, this is something I haven't yet been able to do 😢~
EDIT: Scratch that, support for apt:// urls would still need to be baked into choco, as the whole url is passed to it 😢
Setting cinst.exe as "Run this program as an administrator"
and
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\nupkg_auto_file]
[HKEY_CLASSES_ROOT\nupkg_auto_file\shell]
[HKEY_CLASSES_ROOT\nupkg_auto_file\shell\open]
[HKEY_CLASSES_ROOT\nupkg_auto_file\shell\open\command] @=""C:\ProgramData\chocolatey\bin\cinst.exe" "%1""
...allows double clicking on .nupkg files to autorun/autoinstall
Maybe there's something to run with here...
if I have understood this correctly, we would need the ability to pass a navigation parameter into Chocolatey GUI to directly navigate to a Package Details page. Or have I misunderstood this?
No, to the CLI itself. And not to navigate, but to actually install (unless I misunderstood it myself).
@gep13 and @AdmiringWorm yes and no:
for sure the execution is done at choco.exe but i highly recommend to somehow ask for confirmation before doing so, because hardly any noob looks at the URL behind a link before he clicks it. - doing this in the shell will scare off noobs, so some kind of GUI should be involved.
at debian/ubuntu/etc. apturl is a separate package and it doesn't open any package manager, but a small window to ask for a confirmation:

an other not so advanced approach would be to open the existing package details page of chocolateygui... but still an improvement compared to now. - and what the URL does/opens can still be changed/improved later.
@DJCrashdummy I don't know about other browsers, but I do know that chrome asks for confirmation to run the executable associated with the custom protocol.
IMO, this should be enough (if other browsers behave the same)
I can't say I quite have my head wrapped around the apt "protocol" portion, but I will say that the intent is completely doable. I've already done a proof of concept and created a scope of work for a package that I will create that will allow you to click download a package from chocolatey.org (or elsewhere) and auto-install the package from Chrome.
A small step towards making chocolatey.org pseudo-similar to ninite.com...
SIDENOTE: http://appnr.com/ is pretty damn cool, never saw that site before.
As for implementing it natively in Chocolatey, I think the challenge is adding the support for a "choco://" protocol to all browsers. It would require constantly checking for and updating various browser configs to support it. (i.e. When Chocolatey is initially installed it might not find Chrome, FireFox, or Opera installed because Chocolatey is going to be used to install them. So Chocolatey would then need to keep looking for browsers to inject support for a "choco://" protocol. Seems very cumbersome.) The key thing to take away here is that browser support is needed.
Non-native support via plug-ins for browsers would probably be the best route to go.
Looking at the apt:// method using aptlinex and apturl support programs as an example, a small executable could be used to approve/cancel installation of a package would be a good addition.
My plan to make this intent possible:
- Set registry to open .nupkg files with cinst.exe
- Set cinst.exe to require run as administer
- Set Chrome to auto-open .nupkg files
Not really very hard!
(Then look at implementing via FireFox.)
I still think this is best done via browser extensions, but I've never written one. Any volunteers? There's probably one out there that I could copy, paste, and modify... :)
maybe it is useful... a wiki-link of apturl with integration steps into some browsers:
https://help.ubuntu.com//community/AptURL
another wiki-link with integration steps (translated from german): https://translate.google.com/translate?sl=de&tl=en&js=y&prev=_t&hl=de&ie=UTF-8&u=https%3A%2F%2Fwiki.ubuntuusers.de%2Fapturl%2F%23Integration-in-andere-Browser&edit-text=&act=url
In the spirit of the original request... And dedicated to @DJCrashdummy.
I present to you: https://chocolatey.org/packages/choco-install-packages-from-web-winconfig
Maybe @AdmiringWorm will find it useful too!
@DJCrashdummy - your original dream is becoming a reality...
~~https://chocolatey.org/packages/chocoprotocolstub~~
EDIT: Redone as https://chocolatey.org/packages/choco-protocol-support using Sudo and a batch file instead of a proprietary "assembly" that I wrote.
The following is my personal re-write of the enhancement request:
ENHANCEMENT REQUEST: Add support for custom choco:// protocol
Chocolatey - like yum or apt-get, but for Windows
Requesting Chocolatey feature duplication of AptURL/Apt Protocol. e.g. chocoURL/choco Protocol
IMPLEMENTATION:
- Upon installation of Chocolatey a custom choco Protocol would be configured in the Window's registry.
- choco.exe input to accept chocoURL (choco://packagename) as an input OR creation of a choco protocol handler/stub (SUGGEST: cprot.exe)
- All package pages updated on chocolatey.org :-) and new corporate intranet web pages with click to install corporate approved software.
CONSIDERATIONS:
- When browsers run the program associated with the protocol, the configured program will run with typically non-elevated user permissions. This results in only a handful of packages that could actually be installed. Thus, there needs be some way to elevate to admin privileges for real world package installation. To solve this, choco.exe could be passed a new argument that tells it to re-run itself with elevated privileges. Using a pre-processing choco protocol handler/stub with the internal manifest set to run as admin might be a better way of doing this. Going the choco protocol handler/stub route, no modification to choco.exe would be necessary. The choco protocol would be configured to run the choco protocol handler/stub. The chocoURL would be parsed by the choco protocol handler/stub (running with admin privs) and would then run choco.exe to install the package normally.
- The choco protocol handler/stub is probably best implemented using a Windows GUI program that could prompt for package installation and, separately, privilege elevation confirmation as well as an option to save these confirmations as defaults.
RESULT: Chocolatey becomes much more user friendly for the browser-inclined-CLI-neophyte Average Joe. Chocolateasy! (future tm)
PROOF OF CONCEPT: Proof of concept implemented using a (CLI) handler/stub program I wrote to process the chocoURL and then execute cinst.exe (registry manipulated to run as admin): ~~https://chocolatey.org/packages/chocoprotocolstub~~
EDIT: Redone as https://chocolatey.org/packages/choco-protocol-support using Sudo and a batch file instead of a proprietary "assembly."
RELATED/NOT RELATED BUT SIMILAR: Similar functionality available now. https://chocolatey.org/packages/choco-install-packages-from-web-winconfig
I wanted to say this is a duplicate, but I don't see the original (perhaps it is in the old chocolatey/chocolatey repository).
beforehand: sorry for being silent so long, but i was busy at work the last months and had no time to fiddle around with a windows machine.
choco-protocol-support
thank you very much @bcurran3! :+1: it works like a charm (even with edge - i've tested it because it is nowhere mentioned). :clap: but one interesting thing i noticed: (whether it is installed or not) if i try to view the details-page in the Chocolatey GUI it crushes. - this is the only package with this issue so i guess it must have to do with it and/or its description resp. rendering of them in the Chocolatey GUI.
choco-install-packages-from-web-winconfig
unfortunately it does not work for me. :slightly_frowning_face:
i'm pretty sure because cinst.exe is not executed as admin (although it is explained otherwise in the details). :confused:
PS @bcurran3: may i suggest to strike through all mentions and links of since it was rejected... or is there a reason why it may still be interesting to try?chocoprotocolstub
thank you very much @bcurran3! 👍 it works like a charm

(even with edge - i've tested it because it is nowhere mentioned). 👏
I did some QUICK testing with Edge and it looked like it sandboxed it so quit really fast and moved on. :) (I don't use Edge.) Thanks for letting us (me) know it works with Edge!
but one interesting thing i noticed: (whether it is installed or not) if i try to view the details-page in the Chocolatey GUI it crushes. - this is the only package with this issue so i guess it must have to do with it and/or its description resp. rendering of them in the Chocolatey GUI.
Very weird. Not sure what's causing that. I thought maybe the choco protocol URL was crashing it but it displays it fine in other packages. I opened https://github.com/chocolatey/ChocolateyGUI/issues/649 for @gep13 to check it out.
choco-install-packages-from-web-winconfig unfortunately it does not work for me. 🙁 i'm pretty sure because
cinst.exeis not executed as admin (although it is explained otherwise in the details). 😕
I'd suggest to remove and reinstall. There's also a possibility that it might not work if you already had .nupkg associated with a program under your USER profile. BUT... I'm putting out a v0.0.2 soon reworked to run a batchfile and use Sudo to keep it inline with it's sister package choco-protocol-support. That way it doesn't need to change the cinst.exe compatibility layer/manifest
PS @bcurran3: may i suggest to strike through all mentions and links of
chocoprotocolstubsince it was rejected... or is there a reason why it may still be interesting to try?
Done. I didn't at first because it works, and works slightly better and faster than choco-protocol-support and people can still use it if they wanted. It was rejected not because it didn't work or work well, @ferventcoder didn't
"...want chocolatey.org to be the first validation in the "web of trust" for assemblies that are placed onto chocolatey.org. Rather, that this validation is asserted elsewhere. What it comes down to is that although we know you as a maintainer and trust the work that you have done in this area, we can't independently verify what is going on with the assembly that you are adding into the package."
So basically it wasn't allowed because they didn't have the source. So I re-imagined it into a batch file that anyone could see what it does.
I have gone back and struck out the references to avoid confusion and edited in a comment that it was replaced/superceded by choco-protocol-support which does the same thing and is "blessed."
(I don't use Edge.) Thanks for letting us (me) know it works with Edge!
me neither, :wink: but i didn't have something else on a virgin test machine. - that was my intention.
I thought maybe the choco protocol URL was crashing it but it displays it fine in other packages.
this was also my first thought, but it is definitely not the case. - yes, very weird.
choco-install-packages-from-web-winconfig I'd suggest to remove and reinstall. [...] I'm putting out a v0.0.2 soon reworked [...]
already tried this and now once again, but no change. i just wanted to let you know... - (since i hardly use windows) no problem, i'll "wait" for v0.0.2.
There is another option that might be easier:
Check out the install button in this link: https://marketplace.visualstudio.com/items?itemName=auchenberg.vscode-browser-preview It is: vscode:extension/auchenberg.vscode-browser-preview
so, the format for choco would be something like this: choco:action/package
This is the documentation for it: https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-app-with-uri
It is the same idea as the mailto: link.
although not suggested at my initial post... if not using apt:// but "creating" an own choco:// protocol, supporting chocolaty parameters as discussed at https://github.com/bcurran3/ChocolateyPackages/issues/138 would make sense.
After thinking about this some and some discussion with @gep13, there are a couple of points about how this should be implemented:
- Instead of passing the URI to
choco install, a new command likechoco urishould be created. This is for security reasons, so someone can't do something likechoco install choco://googlechrome --yes --source=https://malware/api. Having a separate command should allow much more secure parsing. - It would be good to have a versioned api, so any future updates/changes can be made, and we are not locked into one format. E.g. start off with
choco://v1/<package to install>, then later add more features likechoco:///v2/<install|upgrade|uninstall>/<package>/<version>?parameter=paramor whatever. - If specifying a source is allowed should be thought through carefully.
This actually appears to be a duplicate of #684, although most of the discussion is happening in this issue.
This issue was added to the 1.0.0 milestone, however, after discussion, we are not going to include this in the 1.0.0 release, but hopefully quite quickly after the 1.0.0 release.
Hey, this is a great idea!
greetings from 2025! Are there any blockers or major concerns before moving forward?
can we get this moved out of the backlog and into the next to be worked on pile?
If you have a look at the top issues in the repository, this is not ranked highly in priority for users.
If i understand this correctly, we need to make the 4 thumbs up at the top go over 18, so it will surface in that list :)
i'm not sure where to post this, so please bear with me if this is the wrong place!
i like AptProtocol for its easiness to suggest installation of a package either on a website, in an email or in any other document via one click (resp. a second one to confirm it's installation).
IMHO a choco-protocol - or maybe also work with
apt://- would be a nice tool to provide the simplest method possible to install packages from chocolatey. e.g.chocolateyguiis nice but i rather use https://chocolatey.org/packages to browse the packages because it provides more information. after that i have open powershell and type the install-command (which is ok), but noobs have to openchocolateygui, wait for a refresh and look for the correct package again to install it. instead of this bunch of additional steps and time a little "install now"-button at the homepage would ease the things a lot.
this the first post please, we need it to go over 18
woohoo we are up to 14 now, only a few more now ;)
@pauby
If you have a look at the top issues in the repository, this is not ranked highly in priority for users.
I just realized that ALL the "top issues" date back to before 2019.
This isn't particularly inspiring, to put it mildly.