简体   繁体   English

已安装的 NSIS 应用程序未显示在其他用户(非管理员用户)的开始菜单/系统托盘中

[英]Installed NSIS application is not shown in start menu/system tray for other users (non admin users)

I have installed an application using NSIS with administrative permissions.我已经使用具有管理权限的 NSIS 安装了一个应用程序。 Then switched to normal user (without administrative permissions) to launch the application.然后切换到普通用户(没有管理权限)启动应用程序。 But here I am not seeing start menu and system tray.但在这里我没有看到开始菜单和系统托盘。

Below is the code snippet I used:下面是我使用的代码片段:

RequestExecutionLevel admin

; To show the system tray notification 

ExecShell "" "$INSTDIR\test.exe"

; To show the installer icon at the start menu

createDirectory "$SMPROGRAMS\${COMPANYNAME}"
createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\Myapp.exe" "" "$INSTDIR\test.ico"

I Need to check the Admin user only when installing the installer and not for launching the application.我只需要在安装安装程序而不是启动应用程序时检查管理员用户。

Please help me by providing the changes required to show the start menu and the system tray for the normal user as well.请帮助我提供为普通用户显示开始菜单和系统托盘所需的更改。

Use SetShellVarContext to switch constants to "all users"/machine mode:使用SetShellVarContext将常量切换到“所有用户”/机器模式:

RequestExecutionLevel Admin

Function .onInit
SetShellVarContext All
FunctionEnd

Section
CreateShortcut "$SMPrograms\Test.lnk" "$SysDir\Notepad.exe" ; Created in the shared startmenu folder
SectionEnd

Create a shortcut in the Startup folder or Run registry key if you want your application to start when a user logs in.如果您希望应用程序在用户登录时启动,请在 Startup 文件夹或 Run 注册表项中创建快捷方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM