Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Add (pin) shortcut to Start menu (or taskbar) #228

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add (pin) shortcut to Start menu (or taskbar) #228

wants to merge 2 commits into from

Conversation

Redsandro
Copy link
Contributor

This will pin items to the Start menu. This is developed and tested on Windows 8.

I added support to pin items to the Taskbar (-taskbar true) instead of Start Menu, because this functionality is outdated here:
https://github.com/chocolatey/chocolatey/blob/master/src/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1
That one does not work in Windows 8, only <= Windows 7. Also, it does not work for any Windows language other than English.

This one works in 6 languages, and more if someone can add the correct words to the language arrays.

@Redsandro
Copy link
Contributor Author

This thing has not made it in yet?

@ferventcoder
Copy link
Contributor

Been a little busy, but that should be clearing up soon. :)

@Redsandro
Copy link
Contributor Author

Also fixed Dutch language

@Redsandro
Copy link
Contributor Author

I was wondering, is the Start Menu directory in Windows translated internally from English to the locale, or vice-versa?

If so, this becomes a hell of a lot easier:

  $appData = [environment]::GetFolderPath([environment+specialfolder]::ApplicationData)
  $destPath = Join-Path "$appData" "Microsoft\Windows\Start Menu\Programs\"
  $destLink = Join-Path "$destPath" "Name Of Target.lnk"

  $shell = New-Object -comObject WScript.Shell
  $shortcut = $shell.CreateShortcut($destLink)
  $shortcut.TargetPath = Join-Path "C:\Path\To\Binary.exe"
  $shortcut.Save()

@Redsandro
Copy link
Contributor Author

A reminder that the old version that only works on English systems is still unfixed one year later:

https://github.com/chocolatey/chocolatey/blob/master/src/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1

@Redsandro
Copy link
Contributor Author

bump

2015 alert. We need this.

@ferventcoder
Copy link
Contributor

And it's not in there yet?

@ferventcoder
Copy link
Contributor

I thought we decided to prefer Install-ChocolateyShortcut over this - https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Install-ChocolateyShortcut.ps1 ?

@Redsandro
Copy link
Contributor Author

Where is the discussion about this? You might be right, but I have no
recollection of year old decisions. :P

Anyway, this needs to be automated in installZipPackage, where a lot of GUI
tools now get a command-line shim when they would actually need a start
menu entry.
E.g. SomeGraphicalTool.STARTMENU creates a user-friendly entry in Start
instead of a power-user Shim.

There are a lot of new packages with GUI tools that (automatically) create
shims, making these packages valid for power users only. There needs to be
an easy way to have shims for the really nerdy tools, and start menu
entries for packages that average users might want to have pre-installed on
their laptops.

Op vr 17 jul. 2015 om 14:00 schreef Rob Reynolds [email protected]:

I thought we decided to prefer Install-ChocolateyShortcut over this -
https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/helpers/functions/Install-ChocolateyShortcut.ps1
?


Reply to this email directly or view it on GitHub
#228 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants