![]() |
#1 |
Junior Member
Join Date: Aug 2014
Posts: 44
|
![]()
Hi everyone,
does anyone have a solution through which a shortcut can be pinned to the Windows 10 start menu? By using StdUtils' ${StdUtils.Const.ISV_PinToTaskbar} I could pin the program to the taskbar but ${StdUtils.Const.ISV_PinToStartmenu} throws an "error" message. Is there any other way to do this maybe? Thanks, Mircea |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
I don't know if anything has changed in Win10 but if it has it is because they want to block people from doing this.
I'll investigate this the next time I boot my VM and report back if things have changed but I'm not going to assist you with pinning because you are not supposed to pin things, see http://blogs.msdn.com/b/oldnewthing/.../03/54760.aspx If you look in NSIS\Include\Win\COM.nsh you will see that we do have some support for the documented IStartMenuPinnedList which is the only Start Menu API provided for ISVs. If you are a OEM or are rolling out ISO's on machines there should be some options for you to control pinned items and the apps on the Start Screen by customizing the ISO... IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Aug 2014
Posts: 44
|
Thanks for looking into it. We are not an OEM but in 90% of the cases, our software comes with a new PC "attached" and the PC is only used for work with our software. Our customers actually asked if such a feature (pinning to start menu) would still be possible in windows 10. In the end, if it isn't possible, we can just train them to right-click on the exe and select Pin to Start.
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
It is possible something changed but I have no symbols so it is a bit of a pain to debug. What is clear is that the plugin you are using has the wrong value for StdUtils.Const.ISV_PinToStartmenu but I don't know if it ever worked or if MS changed the id.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 | |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Quote:
https://github.com/lordmulder/stduti...eases/tag/1.08 Works in my tests... (Background: The "problem" is that InvokeShellVerb uses a COM interface to invoke the exactly same operations - shell verbs - that you see when you right-click a shortcut in Windows Explorer or inside a standard Windows "File Open/Save" dialog. However, in Windows 10, the operation "Pin to Taskbar" is only visible in the Explorer process, but appears to missing from other processes - including NSIS installers. So, we now do this via the Shell process, which has fixed the problem for me. Note that I got positive feedback from others users too) My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
|
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
This thread is about broken Pin To Start, not Pin to Taskbar!
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#7 |
Moderator
Join Date: Aug 2004
Location: Poland
Posts: 563
|
@LoRd_MuldeR
Have you tested it with Menu Start in Win10? I am afraid it is not working... |
![]() |
![]() |
![]() |
#8 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Pinning to the Taskbar is working for me. I'll have to try with the Startmenu again...
My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Okay, I think I figured out why Startmenu pinning not working in Windows 10.
Guess what, Microsoft has screwed it up! Resource id #5381 no longer gives the correct string in Windows 10. Does anybody know what the correct string id is now? ResHacker doesn't show any resource strings in Shell32. What am I missing? BTW: Nice example that shows how important it is to detect the correct Windows version - especially form library code, where you have zero control over the EXE's manifesto... My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
#10 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Okay, hacked together a small tool to dump all Res-Strings from a DLL:
http://sourceforge.net/projects/muld...4.zip/download It can be seen that the required string does not exist in SHELL32.DLL anymore ![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
#11 |
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,891
|
Do you know that there is a limit to the number of items that the Windows 10 start menu can contain? It was 256 when Windows 10 was first released. Recent updates have increased the limit to 2048.
Also Microsoft wants users to focus on the tiles in the start menu, so I don't think preventing pinning of items on left side of the menu is an accident. If enough people complain, they may return the feature. Windows 11 Home 64-bit v22H2 desktop - Logitech Z906 5.1 speaker system |
![]() |
![]() |
![]() |
#12 | ||
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Quote:
Quote:
![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
||
![]() |
![]() |
![]() |
#13 |
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,891
|
Windows 7's "Pin to Start Menu" feature does not add applications to the recent items list. It adds the apps to a separate area at the top left side of it's Start Menu. Windows 10 does not have a similar separate area. Like I said in the other post, I don't think this design change was an accident. Microsoft's research probably showed that most people did not use the feature. Surely, a significant number of the preview testers must not have complained about the removal (or bug, as you call it).
Windows 11 Home 64-bit v22H2 desktop - Logitech Z906 5.1 speaker system |
![]() |
![]() |
![]() |
#14 | |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Quote:
Fair enough! The issue here is: To select the proper context menu item ("Shell Verb") we need to know what text we are looking for. This text is locale-specific and thus must be loaded from a Resource DLL - via some well-know fixed resource identifier. Up to and including Windows 7 this was working fine (ID was #5381). Now, in Windows 10, they seem to have "broken" that method ![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
|
![]() |
![]() |
![]() |
#15 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
5381 does not exist in Windows 8 so this has been broken for years...
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#16 | ||
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Quote:
(Adding something to the so-called "Start" screen, which most users didn't use anyway, doesn't count here) Quote:
In my German edition of Windows 10, the text of the required Shell Verb (context menu entry) is as follows: An "Start" anheften I dumped all Res-Strings from all DLL's in my Windows and System folders and then performed a full-text search for the above text. Not found ![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
||
![]() |
![]() |
![]() |
#17 | |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,369
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#18 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Quote:
I know how to fix it but like I have already said, I'm not going to help people programmatically pin things. IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#19 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
If you really know a proper solution, but are not willing to share it with the community, this is unfortunate...
My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
#20 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Quote:
I realize some people might be in situations where automatic pinning might be desirable but this also lets the cat out of the bag and allows everyone to pin themselves. Microsoft have already locked down the file associations to the point where it is now annoying in all sorts of ways because people have abused the ability to take them over for so long. IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#21 | |
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,891
|
Quote:
Use a process monitoring app (like Process Explorer) to see which folder(s) "shell32.dll" is being read from. In Windows 7, sometimes a system library file is read from a 'WinSyS' folder. Also, if running a 64-bit OS, there will be a 32-bit version and a 64-bit version. Windows 11 Home 64-bit v22H2 desktop - Logitech Z906 5.1 speaker system |
|
![]() |
![]() |
![]() |
#22 | |||
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Okay, please try again with the new TEST version, it (hopefully) fixes the problem on Windows 10 without breaking Windows 7:
http://sourceforge.net/projects/muld...6.zip/download Please note the changes in the include file. You'll need to build the installer with the new (updated) include file! Quote:
Quote:
Quote:
My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
|||
![]() |
![]() |
![]() |
#23 | |
Forum King
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,891
|
Quote:
It's things like this that will make me wait at least 6 months before upgrading to Windows 10, if I ever do. Windows 11 Home 64-bit v22H2 desktop - Logitech Z906 5.1 speaker system |
|
![]() |
![]() |
![]() |
#24 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Just FYI, Windows 8 does not provide a unpin from start verb in IContextMenu, the unpin action seems to only be visible on the start screen special menu...
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#25 |
Moderator
Join Date: Aug 2004
Location: Poland
Posts: 563
|
New "Test" version of the plugin works for me.
(InvokeShellVerb.nsi, both Ansi and Unicode) Win10 Home, Polish (pl-PL). Good job! How did you get it to work? I see you have changed "magic numbers"... - Pinning one application works nice. Did you test the plugin in scenario when you have to pin (unpin) for example 10 applications, one by one. - My antivirus software (Norton) was trying to block test installer when trying to pin, I wonder if there is a way to avoid this (I guess not) Ps: @Anders I think it is good that such tool exists. I know, it can be used by many installers to pin unwanted stuff... but, if it is only possible someone will do that anyway... I understand why Microsoft blocked app associations in Windows - In that case I think it was very clever - now user decide what he want to run as default for his system... I use @LoRd_MuldeR plugin in my installer (it installs plenty of apps). First, I was using VBS script (it was language depend, so I had to know Verbs for each language), but the plugin is much simple to use. I don't force user to pin stuff - user decide it (via nice custom page with app trees). I belive in that way such function (Pin, unpin actions) have sense. |
![]() |
![]() |
![]() |
#26 | ||||
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Quote:
Quote:
Didn't notice this at a first glance though. Maybe I needed some sleep ![]() The bad news is, that we need to look for a different resource id in Windows 10 than what we need to look for in Windows 7. That's because Windows 10 actually has a "new" string, with a different resource id. The "old" resource id now leads to some other (unrelated) text in Windows 10. The good news is that the "new" id used in Windows 10 has been unused in Windows 7. So we can first try to lookup the Windows 10 string and, if not found, revert to the Windows 7 string. Detecting the actual OS version is not required for now, for this task... Quote:
Quote:
A/V software tends to be overly parnoid when it comes to installers ![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
||||
![]() |
![]() |
![]() |
#27 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Quote:
Microsoft are free to break this whenever they want, these resource ids are not part of the API contract. (Some string ids that actually are documented (from the IE4 era) are now broken and gone!) IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#28 | |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Quote:
Until then, we are locked in the usual "Microsoft breaks stuff → developers invent the required workarounds" cycle ![]() (If everything just worked via a well-documented an stable API, things would be too much boring) Yup, seems like LoadStringW() transparently redirects the correct MUI file, when loading the string from SHELL32.DLL. My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
|
![]() |
![]() |
![]() |
|
Tags |
stdutils, windows 10 |
Thread Tools | Search this Thread |
Display Modes | |
|
|