Archive: Application Error when running installer through "runas"


Application Error when running installer through "runas"
Hi, I'm using NSIS 2.07 and trying to run the "C:\Program Files\NSIS\Examples\Modern UI\Basic.exe" on WinXp SP2,
my problem is this:
when a "Power User" on the computer is running the installer through the "runas" option and choosing the "current user" (default) and checking the "protect my computer..." checkbox and clicking "ok" - the result is Application Error - "the application failed to initialize properly (0xc0000022). click on ok to terminate the application"
can you please tell me what's the problem?


This option severely limits the executed application. Almost every privilege is denied including even the user's default temporary directory (%USERPROFILE%\Local Settings\Temp). Even the dialog itself mentions possible problems.

This option can prevent computer viruses from harming your computer or personal data, but selecting it might cause the program to function improperly.
However, for me, the installer still starts-up and works, assuming the temporary folder problem is resolved.

As Basic.nsi doesn't create any other processes, the error you got suggests the installer didn't even start. I guess it failed loading some DLL because of the denied privileges. Do other applications start when ran in the same method?

Out of curiosity... Is there any way to detect the user having chosen this option? Google's giving me tons of generic results that aren't very helpful.

When executed locally via this 'run as -> protect my computer' method, the installer simply fails to run. When executed across the network, that same "the application failed to initialize properly" prompt pops up.
Would be more user-friendly to tell the user that the installer does not support the 'protect my computer' bits.


Originally posted by Animaether
Out of curiosity... Is there any way to detect the user having chosen this option? Google's giving me tons of generic results that aren't very helpful.

When executed locally via this 'run as -> protect my computer' method, the installer simply fails to run. When executed across the network, that same "the application failed to initialize properly" prompt pops up.
Would be more user-friendly to tell the user that the installer does not support the 'protect my computer' bits.
those are two different problems, the "protect my computer" checkbox is pointless to try to detect because $pluginsdir is in $temp, and we can't write to $temp, so there is no way for us to do things (If you really wanted to find out, you would have to write a native win32 (not in nsis) app that checks the process token, see http://blogs.msdn.com/aaron_margosis...10/227727.aspx for more, but then you would have to wrap the nsis installer in this detector app)

The network error is a different problem, when using run-as and running as a different user, you will not have access to the same share's etc since that is per logon session IIRC the same would probably apply when using the protect checkbox (would depend on the ACL for the actual share maybe)