Without a description, the intent of this issue is a little up for grabs, so I'm going to take a stab at it...
I would love to have a "universal" (i.e. not dependent on the package maintainer) option to prevent/remove a desktop icon. This would need to be an attempt, but I suspect it could be successful most of the time.
Some installers have a switch to prevent desktop icons, and for those, the installing user can pass those through to the installer via --installarguments. Some package maintainers can/will included code to handle -packageparameters that will allow the package to deal with unwanted icons, but most maintainers do not. Some packages actually add an icon when the installer does not. It is entirely the maintainer's choice, and often out of the control of the installer.
Chocolatey installs are often scripted, and while the scripter could create custom code to manage the icons for each package install, it would be much nicer and more efficient to simply add a switch to the choco install call.
The most likely successful process for doing this is to track all the shortcut icons before the install, let the install finish, and then remove the new shortcut icons. Then the issue is reduced to determining which icons were dropped on the desktop due to the package as opposed to placed there by a user during the install or by another simultaneous install or process. Further reductions to the risk of false positives:
CommonDesktopDirectory and the current user's desktop. If new icons are in both locations, only delete those from the common desktop.$env:ChocolateyPackageName or the SoftwareName to the icon names.You developers are smarter than I am, so I'm sure there are additional/better methods to handle this, but I would love to see this feature.
Thanks!
I think it is easier and less intrusive to implement a global flag (set through config) and provide package maintainer some PowerShell helper to query user preference. This is less enforcing, but it will guarantee to work if package maintainer implements it in chocolateyInstall.ps1.
This is less enforcing, but it will guarantee to work if package maintainer implements it in
chocolateyInstall.ps1.
The limitation of that is it relies on the package maintainers. My interest in this is to give control to the installer, regardless of the maintainer's willingness/interest/ability to implement anything.
Apps putting shortcuts on desktop or in menu bar drives me nuts on Windows. Please support global switch to prevent them from doing this by default. Only desktop icon I have is Firefox. That is all.
Hi guys, sorry for digging up this issue but is there any news on this ?
Not related, but related:
https://github.com/chocolatey/choco/issues/1185
^^^^ If the above got implemented, this issue could be handled by a post run helper.
Just to clarify the relation of my issue #2016 and issue #344 to this one:
There are (at least) four kinds of icons/shortcuts:
and there are (at least) three policies w.r.t. adding these shortcuts:
and these policies can be set at:
Now, here's what these issues ask for:
| Issue | Kind of shortcut | Requested policy | Policy scope |
| -------- |:------------------:|:-------------------:|:--------------:|
| #4 (this one) | 1 | 2 | 2 |
| #344 | 1 | 2 | 1 |
| #344 | 1 | 3 | 1 |
| #2016 | 2 | 3 | 2 |
Most helpful comment
Apps putting shortcuts on desktop or in menu bar drives me nuts on Windows. Please support global switch to prevent them from doing this by default. Only desktop icon I have is Firefox. That is all.