问题
I'm making a non-elevated software installer for Windows 10. The installer saves the application into C:\Users\USER_NAME\AppData\Local\MY_APP_NAME
folder. It also creates a shortcut in C:\Users\USER_NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\
folder. The shortcut correctly appears in Start Menu, but it never appears in search results.
I tried rebuilding the search index and ran Start Menu troubleshooter with no luck. I'm from Poland and thus Cortana is disabled on my machine.
I investigated other shortcuts in that folder and found that some applications appear in search results while others do not. For example, a link to SourceTree appears in search results while a shortcut to R-Link 2 Toolbox do not appear there. Both SourceTree and R-Link 2 Toolbox are installed into AppData\Local
folder and both shortcuts are saved to AppData\Roaming\Microsoft\Windows\Start Menu\Programs\
. I don't see any difference between their shortcut files. Yet I can find SourceTree in search results while R-Link isn't there. This behavior isn't related to spaces in the app name. I tried renaming my app not to have a space in its name and this changes nothing.
Is there something I should do to register my shortcut for indexing?
回答1:
It seems the problem was related to indexing issues of the Windows OS. It seems sfc /scannow
command solved the problem and now indexing works correctly for all menu folders and apps.
来源:https://stackoverflow.com/questions/52366038/correct-way-to-create-shortcuts-in-user-start-menu-csidl-startmenu