0

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

Community
  • 1
  • 1
mgphall
  • 67
  • 3
  • 9

1 Answers1

0

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).

Community
  • 1
  • 1
Anders
  • 97,548
  • 12
  • 110
  • 164
  • Thanks for your Reply anders, its a requirement that some applications can only be run if your an admin.. – mgphall Jul 11 '12 at 08:02