Old 9th November 2015, 11:51   #1
Mircea M
Junior Member
 
Join Date: Aug 2014
Posts: 44
Question Pin to Start in Windows 10

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
Mircea M is offline   Reply With Quote
Old 9th November 2015, 22:30   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,316
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
Anders is offline   Reply With Quote
Old 10th November 2015, 10:05   #3
Mircea M
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.
Mircea M is offline   Reply With Quote
Old 15th November 2015, 16:06   #4
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
Quote:
Originally Posted by Anders View Post
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.
More accurately: they don't block people from doing this, just rogue installers
Yathosho is offline   Reply With Quote
Old 10th November 2015, 21:59   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,316
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
Anders is offline   Reply With Quote
Old 11th November 2015, 21:42   #6
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by Mircea M View Post
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?
Have you tried the latest plug-in version?
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
LoRd_MuldeR is offline   Reply With Quote
Old 11th November 2015, 22:39   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,316
Quote:
Originally Posted by LoRd_MuldeR View Post
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.
This thread is about broken Pin To Start, not Pin to Taskbar!

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th November 2015, 15:25   #8
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 525
Send a message via ICQ to Pawel
@LoRd_MuldeR
Have you tested it with Menu Start in Win10?
I am afraid it is not working...
Pawel is offline   Reply With Quote
Old 12th November 2015, 17:53   #9
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by Pawel View Post
@LoRd_MuldeR
Have you tested it with Menu Start in Win10?
I am afraid it is not working...
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
LoRd_MuldeR is offline   Reply With Quote
Old 14th November 2015, 12:43   #10
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
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
LoRd_MuldeR is offline   Reply With Quote
Old 14th November 2015, 14:29   #11
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
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
LoRd_MuldeR is offline   Reply With Quote
Old 15th November 2015, 22:30   #12
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,756
Quote:
Originally Posted by LoRd_MuldeR View Post
...

It can be seen that the required string does not exist in SHELL32.DLL anymore
If the only difference between this library file in Windows 7 and Windows 10 is the missing string, you could try replacing the file in Windows 10 with the one from Windows 7 or you could use a hex editor to add the string to the Windows 10 file.

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.

Winamp Pro v5.666.3516 fully-patched - Quinto Black CT v3.1 skin
Windows 10 Home 64-bit v20H2 desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 14th November 2015, 14:34   #13
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,756
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.

Winamp Pro v5.666.3516 fully-patched - Quinto Black CT v3.1 skin
Windows 10 Home 64-bit v20H2 desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 14th November 2015, 14:41   #14
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by Aminifu View Post
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.
Nope, didn't know about the limit.

Quote:
Originally Posted by Aminifu View Post
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.
Actually, you can do "Pin to Startmenu" from the Explorer context menu just fine. This will add a new "Tile", not add the application to the "Recent Items" on the left. The problem: To select the proper Shell Verb ("Pin to Startmenu") we need to load the corresponding resource string - using a well-known fixed resource id. Either that, or we need a LUT for all language versions of Windows that exist...

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 14th November 2015, 15:02   #15
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Phoenix, AZ
Posts: 4,756
Quote:
Originally Posted by LoRd_MuldeR View Post
... This will add a new "Tile", not add the application to the "Recent Items" on the left. ...
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).

Winamp Pro v5.666.3516 fully-patched - Quinto Black CT v3.1 skin
Windows 10 Home 64-bit v20H2 desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 14th November 2015, 15:06   #16
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by Aminifu View Post
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).
Yes. Just like I said: In Windows 10 the "Tile" area has replaced the area for "pinned shortcuts". But there still is an "Pin to Startmenu" entry in the Explorer context menu! And it still pins the application/shortcut to the Startmenu - now in the form of a new "Tile".

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
LoRd_MuldeR is offline   Reply With Quote
Old 15th November 2015, 14:25   #17
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,316
Quote:
Originally Posted by LoRd_MuldeR View Post

Up to and including Windows 7 this was working fine (ID was #5381). Now, in Windows 10, they seem to have "broken" that method
5381 does not exist in Windows 8 so this has been broken for years...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th November 2015, 04:06   #18
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 525
Send a message via ICQ to Pawel
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.
Pawel is offline   Reply With Quote
Old 16th November 2015, 08:12   #19
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by Pawel View Post
New "Test" version of the plugin works for me.
(InvokeShellVerb.nsi, both Ansi and Unicode)
Win10 Home, Polish (pl-PL).
Thanks for confirming.

Quote:
Originally Posted by Pawel View Post
Good job! How did you get it to work?
I see you have changed "magic numbers"...
With the help of my DumpStrings tool, I was able to figure out that the "missing" String is in SHELL32.DLL, after all. So I got its ID.

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:
Originally Posted by Pawel View Post
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..
Nope. But I'm confident if it works for one item, it will work for multiple items too...

Quote:
Originally Posted by Pawel View Post
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)
Report the false positive to Norton. There is no other way, except for switching to a less annoying A/V product.

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
LoRd_MuldeR is offline   Reply With Quote
Old 16th November 2015, 08:22   #20
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,316
Quote:
Originally Posted by LoRd_MuldeR View Post

With the help of my DumpStrings tool, I was able to figure out that the "missing" String and its ID in SHELL32.DLL, after all.
It is in the MUI file IIRC.

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
Anders is offline   Reply With Quote
Old 16th November 2015, 08:25   #21
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by Anders View Post
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!)
If somebody knows a better solution, I'd be happy to learn it.

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)

Quote:
Originally Posted by Anders View Post
It is in the MUI file IIRC.
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
LoRd_MuldeR is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
stdutils, windows 10

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump