Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 10th January 2007, 14:45   #1
coco_vc
Senior Member
 
Join Date: Jan 2006
Location: Germany
Posts: 138
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:
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
coco_vc is offline   Reply With Quote
Old 11th January 2007, 20:15   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Vista automatically runs NSIS installers as administrator, even with the manifest. It recognizes you're running an installer and automatically kicks UAC in action. The manifest can change that behavior, but without it you're always ran as administrator.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 12th January 2007, 09:35   #3
coco_vc
Senior Member
 
Join Date: Jan 2006
Location: Germany
Posts: 138
Ah, ok, thx for the info.

Viv
coco_vc is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump