Archive: Change nsis error of UAC plugin on XP when user check "Protect my computer[...]"


Change nsis error of UAC plugin on XP when user check "Protect my computer[...]"
Hello,

When using the UAC plugin on XP with non-admin user, user is prompted to choose between run as current user and run as admin. If user chooses to run as current user there's a checkbox "Protect my computer and data from unauthorized program activity". With this checked, I get the error: "NSIS Error", "Error launching installer".

Instead of this message I want to show user a friendly message that explains they must run as admin. Is this possible? Where is that error message come from, nsis internals or the UAC plugin?

Thanks!


This message comes from nsis because checking that checkbox really locks down the process so it can't even access the temp folder (The same thing would happen if you right click on a nsis install that does not even use the UAC plugin and choose Run as...) I'm already hacking that dialog a bit (selecting other user as default and unchecking that checkbox) but I'm not going to hide it, if you really want to hide that thing, add code in MSRunAsDlgMod_ShellProc and recompile the plugin...


Hi Anders, thank you for your reply.

I am trying to display a friendly message instead of the "NSIS Error" message. I don't want to hide the elevation dialog. If users get a choice to keep running as a regular user they should at least know what the error is and why the installer isn't doing anything.

So is the "NSIS Error" message comes from the UAC plugin code or nsis itself? I would feel comfortable compiling the UAC plugin but not so much the core of nsis.


The error happens when ForkSelf calls ShellExecuteEx, so it probably comes from the newly run installer, and is probably an internal nsis error. Is there a way to display a different error message, or hide this one?

EDIT: I also set the installer as silent.


You can hide the checkbox, not the whole dialog. That error has to happen, there is no way around it, to use a plugin, you need write access to $temp, and if that checkbox is checked, you will not get write access, its that easy. So, tell your users not to check it, or just hide the checkbox