简体   繁体   中英

Nsis shortcuts for different users

Advice Nsis – windows7 I have two users on the same computer (Admin and standard), I will be running my nsis installer when logged in to the standard user. My problem is that I need to create shortcuts on both desktops!! Example

Standard User - Desktop - Shortcut 1 - Shortcut 2 - Shortcut 3

Admin User - Desktop - Shortcut 2 - Shortcut 4

I'm new to nsis- I have managed to create the Shortcut on the standard user account - If it helps I know the admin username and password.

NSIS - Desktop Shortcut For All Users I saw this link but it does not seem to be working When I try

CreateShortCut "${ProfilePathAllUsers}\Desktop\simpleApp.lnk" "$INSTDIR\ApplicationsLocation\ Applications.simpleApp.Host.exe"

I fear I may be going in the wrong direction- Im also using Unicode Nsis

Any Advice will be welcome - Thank you

You cannot write to another users profile without administrator rights so make sure you are elevated .

Creating a shortcut for another user is wrong IMHO. If you want to create a shortcut for all users you can do:

; This code assumes you are elevated...
SetShellVarContext all
CreateShortcut "$desktop\myapp.lnk" "$instdir\myapp.exe"

Knowing the username/password would indeed help if you really wanted to do it for a single user; you would have to call LogonUser + SHGetFolderPath with the system plugin to get the path (Or the code you linked to but that uses undocumented stuff).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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