my "old" setup and Vista
Hi all,
I have a setup that I used for Win2k and WinXP without issues. Now I gave it a try with Windows Vista and I noticed the following issue (when running it when logged in as a user from the admin group):
- NSIS runs an exe called instlsp.exe that installs an LSP (layered service provider) and this exe installs successfully the LSP.
- if for the exact same user I manually run the instlsp.exe, the LSP doesn't get installed, b/c I get "access denied" for some functions.
As far as I read about the changes in Vista for an LSP, the desired behavior is indeed that only the build-in admin is able to install an LSP, so it's normal that by manually running the instlsp.exe the LSP installation fails. What I can't understand, and maybe someone could explain, is how can NSIS successfully run this exe? Actually, not only is able to successfully run instlsp.exe, which when ran manually fails, but also can write into Program Files, which seems to normally not be possible. How can NSIS do that?
Please note that:
- I use NSIS version 2.18 .
- I didn't specifically said "Run as administrator", but just double-click the setup.exe.
- I didn't use the "RequestExecutionLevel" in my script.
- I have no manifest that specifies privileges whatsoever for no exe.
- in the script I check if the user is admin by using the following code:
!macro checkAdminAndTakeAction UN
Function ${UN}checkAdminAndTakeAction
ClearErrors
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" done_checkAdminAndTakeAction 0
; we need to show a multilanguage msgbox and b/c this function is called also in .onInit where we can't show
; by default multilanguage msgboxes, do the switch (the language is set by NSIS once the .onInit is finished, so in .onInit we need this switch)
!insertmacro language_define $0 NEED_TO_BE_ADMIN
MessageBox MB_ICONEXCLAMATION|MB_OK $0 /SD IDOK
; log this
FileWrite $FileHandle "$0\n"
Quit ; quit the whole installer
done_checkAdminAndTakeAction:
FunctionEnd
!macroend
Thanks in advance,
Viv