Archive: Windows 8 problem - shorcuts are not created for a non-admin account


Windows 8 problem - shorcuts are not created for a non-admin account
Hello,

i have created a nullsoft installer. it works as expected on all OS's except for windows 8.

on windows 8, i am having a problem with the CreateShortCut command.

i have set the proper execution level:

RequestExecutionLevel admin


i am getting the start menu directory from here:
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder


and here are the CreateShortCut commands that i am using:
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\MyProgram.lnk" "$INSTDIR\MyLauncher.exe"
CreateShortCut "$DESKTOP\MyProgram.lnk" "$INSTDIR\MyLauncher.exe"


when i run the installer on a user account that has admin privileges, a desktop shortcut is created, the startmenu folder is created, and shortcuts are created in the start menu folder. also, my application shows up in the windows 8 "apps" interface. i also verify that the startmenu shortcuts were created at:
C:\Users\myuser\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\MyProgram


however, when i run the installer on a user account that does not have admin privileges, the shortcuts do not get created. i do experience the execution level request (i have to enter the credentials for an admin account). once entered, the program does install, but the shortcuts are not created and my program does not show up in the windows 8 "app" interface.

any ideas?

thanks,

This is how UAC works, if a non-admin user elevates with a admin account the new process runs as that admin.

If you are installing into $programfiles / HKLM you are doing a machine/all users install and you should call "SetShellVarContext all" so your shortcuts are visible for all users...


i know how UAC works. the permission elevation was not the issue, but setting SetShellVarContext to "all" and verifying Local Machine vs Current User solved my problem.

thanks