Archive: IsAdminDll question


IsAdminDll question
I just tried using IsAdminDll with my installer. Works great on my Win2000 box, but on a Win98 box it returns 0 (not admin) every time. I guess this is correct, but in my mind it seems like it should return 1 for Win95-based machines since users have complete control. I was expecting it to return 0 only for NT-based machines with few priveleges.

But just to be sure, do I have this straight:

- Perform a check to see if the machine is 95 or NT based.

- If it is 95 based, skip the IsAdminDll check and proceed with the install.

- If it is NT based, perform the IsAdminDll check. If 1 (admin) proceed, if 0 (not admin) abort.


Instead of the IsAdminDll, you can use UserInfo.dll which is included in the latest NSIS versions.

UserInfo fails and sets the error flag when there is no NT operating system. I think IsAdminDll has the same behavior, so you can use IfErrors.


I'd rather not upgrade NSIS at the moment unless I have to. Can the UserInfo.dll be used with v2.0b0?


It will probably work, but I highly recommend you to upgrade to the latest version. You only have to change some very small things in your script if you are using the Modern UI, otherwise you don't even have to change anything.

Lots of bugs have been solved in later versions, using an outdated beta version is not a good idea.


OK, I upgraded and hit a few snags (still using nextpage & previouspage functions) but I think I have everything straight except for one thing. The v2.0b0 makensis.exe had the command line parameter /cd. It doesn't anymore I assume because it won't compile with /cd. Any clue as to what /cd did, because I can't remember and I am using it in my old batch file to create my installer. I took it out and it seems to work OK, but that has me a bit worried.


/CD made makensis change the working directory to the directory of the script. It is now the default and the switch has been replaced with /NOCD that will disable this behavior. You can safely remove the switch from your batch file.