![]() |
#1 |
Junior Member
Join Date: Jan 2011
Posts: 8
|
![]()
I am using the NSIS RunAs plugin in order to call another install program if the user has only user privileges. In XP the RunAs is working fine. Under Win7 the RunAs always exits with error.
I have tried both methods: 1. StrCpy $1 $ADMIN_LOGON StrCpy $2 $ADMIN_PASSWD StrCpy $3 “$INST_TEMP\Update_Monitor\UpdateMon_Installer.exe " StrCpy $4 0 System::Call 'RunAs::RunAsW(w r1,w r2,w r3,*w .r4) i .r0 ? u' 2. RunAs::RunAs `"$INST_TEMP\Update_Monitor\UpdateMon_Installer.exe` `$ADMIN_LOGON` `$ADMIN_PASSWD` Any ideas why this works does not work anymore on Win7? Many thanks. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,451
|
2 is never going to work, this thing is not a NSIS plugin...
As to why 1 does not work is hard to say when you don't post the error message. But I'd say this "plugin" code is horrible and buggy, it leaks handles and the error string buffer. To get the error string, you would have to treat $4 as a WCHAR* and extract it with the system::call struct syntax, then you will get a error string that may give some hints as to why it is failing, alternatively, do something like PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jan 2011
Posts: 8
|
I have found the runas problem.
Method 1 is another runas plugin for NSIS and I have used this dll to run method 2. The good thing with method 1 was that it does not require any dll file to be located with the installer. But as the method does not longer work with Windows 7 I have to switch to the other runas plugin. |
![]() |
![]() |
![]() |
|
Tags |
nsis, plugin, run as administrator, runas, windows 7 |
Thread Tools | Search this Thread |
Display Modes | |
|
|