Archive: NSIS in multiuser env (XP/NT)


NSIS in multiuser env (XP/NT)
  I am a newbie, so I am sorry for theese 2 stupid questions.

1. What really does the "XPStyle" tag?

2. I have the following script:


[...]

; The default installation directory
InstallDir $PROGRAMFILES\xxxxxxxx

; Registry key
InstallDirRegKey HKLM SOFTWARE\xxxxxxxx "Install_Dir"

[...]


; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
file "qqqqqqqq"
file "wwwwwwww"
file "eeeeeeee"

; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\xxxxxxxx "Install_Dir" "$INSTDIR"

; Write the uninstall keys for Windows
WriteRegStr HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\xxxxxxxx" \
"DisplayName" "xxxxxxxx"
WriteRegStr HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\xxxxxxxx" \
"UninstallString" '"$INSTDIR\uninstall.exe"'
WriteUninstaller "uninstall.exe"

; menu
SetOutPath $INSTDIR
CreateDirectory "$SMPROGRAMS\xxxxxxxx"
CreateShortCut "$SMPROGRAMS\xxxxxxxx\xxxxxxxx.lnk" \
"$INSTDIR\xxxxxxxx.EXE"
CreateShortCut "$SMPROGRAMS\xxxxxxxx\Help and Docs.lnk" \
"$INSTDIR\xxxxxxxx.HTM"

; shortcut
SetOutPath $INSTDIR
CreateShortCut "$DESKTOP\title.lnk" "$INSTDIR\xxxxxxxx.exe"
CreateShortCut "$SMSTARTUP\title.lnk" "$INSTDIR\xxxxxxxx.exe"
CreateShortCut "$QUICKLAUNCH\title.lnk" "$INSTDIR\xxxxxxxx.exe"

SectionEnd


The script put a shortcut in the desktop, in the startup folder and into the
quick launch. Works fine in a single user enviroment, like w95/w98 and ME.

How I can do the same shortcuts in a multiuser enviroment like XP and W2K?

I understood I should use "SetShellVarContext" but the way it is not
so clear in my reading the docs.

Thanks for any help

Hello, there..... :)
  Ok, about your questions:

1. XPStyle is when you installer ran into a XP OS, get the current XP theme from the end-user...

XPStyle on/off


2.- I don't know about the shorcuts from all users for XP, but read the manual in ${NSISDIR}\Docs ... It explains all about that...

Good luck :up: :p

SetShellVarContext sets an installer flag (at runtime) which tells the installer wheather to get the current user's folder, or all users' folder. It affects the values of $SMPROGRAMS, $SMSTARTUP, $DESKTOP, $STARTMENU and $QUICKLAUNCH.

Try this little piece of code on Windows NT/2000/XP:

SetShellVarContext current #the default

>StrCpy $0 $SMPROGRAMS
SetShellVarContext all
StrCpy$1 $SMPROGRAMS
MessageBox MB_OK "$0$\r$\n$1"

No question is stupid, since you don't know the answer and we're glad to help you.
But could you leave the filenames and such in the script? It would make reading it a lot easier. If it's a long script, you can attach it to the post instead of pasting all the code in it.


tanks to all people for the help


xp / 2000 permissions, DLLs
  kichik, your code is great! Thanks!

What about folder permissions and registering DLLs to all users on XP/2000?

I have an app the creates files in its own folder, and I get file access errors if I switch users on Win 2K server. I believe this is because the folders creadted during the installation only grant access to the person installing. Is there any way to set permissions to Everyone when installing?

I also have problems with DLLs. Is there a way to register a DLL to all users? When I switch users and run my app, I get the infamous "MS Office trying to install crap..." dialog, which is quite odd, since my app has NOTHING to do with Office whatsoever.

You guys are great! Any help is appreciated.


I don't know about the folder permissions, but as far as I know, registered DLL's are always available for all users.


WOW, thanks for the quick reply!

Maybe it's the folder permission (security) that is denying access to the DLL then. Is that possible?

For example, user Bob installs a program which contains activex DLLs in the app path. Only Bob has full access to the app path, according to the security/permission settings on the folder. Later, user John logs in and tries to run the program. Does Windows deny access to the DLLs since he doesn't have full permissions in the app's folder?

Thanks again


There is a new plug-in in the Archive that sets access controls. Give it a shot:
http://nsis.sourceforge.net/archive/...php?pageid=212

As far as I know you need to be logged on as an adminstrator user to register DLLs for all users.


The AccessControl.dll was just what I needed.

You guys totally rock and NSIS lives up to its name of not sucking!

Thanks!


Hi kichik-

I have two testers running XP. The AccessControl.dll worked great on one computer, but the other got the following error:

Cannot build new access controllist. Error code: 1332

Any ideas? Or maybe tbf can help, if he's listening.


Quick launch icon missing for a different windows user
  Hi there!
I have the following problem: I want to install to all users so I use:
SetShellVarContext all
at the very beginning of my first install and uninstall sections inside which I copy the shortcuts. The problem is that when I install the product under one windows user which has administrator rights, and then I log as another windows user, the quick launch icon is not present (but all other icons are there...).
Any idea why is it happening and how to fix it?

I create the shortcuts with CreateShortCut after I use SetShellVarContext all...
Thanks in advance!


The quick launch bar doesn't have an all users folder.

mike7373, I have no idea. I would have suggseted you contact the author of the plug-in, but many have already tried and failed :(


Thanks!


Hi mike7373,

I also have some users of my install reporting this error with this AccessControl plugin - "Cannot build new access control list Error Code 1332 Error code: 1332".

Did you ever solve the problem?

Joe A.


I found the problem. I was using the Windows group "Users", and the customers having trouble where not using the English version of Windows, thus this group is NOT called "Users". The solution is to use the SID, in my case "(S-1-5-32-545)" for the "Users" group.

Joe A.


Hello again!
Now I have a problem with win98. I run the installer and install to all users (is it possible at all with win 98?) so the installer runs ok. Then when I uninstall, the shortcut on the desktop remains there. I put a message box to see what is the value of $DESKTOP variable so during the installation time it was: "c:\windows\all users\desktop" while during the uninstallation it was: "c:\windows\desktop". So what am I supposed to do? I'm thinking about checking during install time if the OS is win95/98 and forcing it to run only for the current user or the other solution: during uninstall time to check again for win 95/98 and to delete "manually" the shortcut from "windwos\all users\desktop" but I think both methods are a "patcher's" methods (especially the second one) and I wonder if there is a better one?


krisbg, see:

http://sourceforge.net/tracker/index...49&atid=373085

Please open new threads instead of appending to unrelated threads.


sorry, i thought it was connected to this topic! and 10x for the reply!