Archive: Install for all users


Install for all users
Hi I am having a problem and hope someone can help me see what I am doing wrong. My script uses the UserInfo section example to get the users admin rights. If the user has full admin rights I set setShellVarContext in the same section to ALL. This seems to work OK and install properly. The uninstall is were the problem shows. The folders and files uninstall OK except for the desktop Icon which remains after everything else is gone. I may be doing something wrong but dont understand what as I have used the help files and believe I am using setShellVarContext OK so examples may help. Many thanks


Try setting setShellVarContext to both options and call the delete after each one. That should take care of the icon being created either way.


Hi Thanks for the reply. I am not sure how to call the delete. What I am doing is getting the user as admin by using the userinfo plug in section and in the same section using
Pop $1
StrCmp $1 "Admin" 0 +3
;MessageBox MB_OK 'User "$0" is in the Administrators group'
Goto Alluser
Alluser:
SetShellVarContext all

How do I go about deleting this and were, or am i not using this properly at all. an example would maybe help me to see how to use this properly. I have looked at the example in the NSIS help file but not sure if I ma using this in the correct way. Many thanks


I use something like this


SetShellVarContext current
Delete "$DESKTOP\Here Is My Shortcut.lnk"
SetShellVarContext all
Delete "$DESKTOP\Here Is My Shortcut.lnk"

and this gets the links for both.

Many thanks for the reply this has solved the problem, I have also found that you can use
setShellVarContext all
and then in the uninstall section do the same again