Bill2
29th October 2009 09:32 UTC
Vista/Win7, and UAC control
Hi from a french guy, (Hope you can understand what I want ...)
I have a question, and I don't find anwser anywhere.
I user RequestExecutionLevel=user, so the UAC is not launched when the installer starts.
But with user lever, the soft can't be installed in "program files"
If I use "admin" level, UAC prompt for password, and then NSIS can install my soft in Prg files
But with this level, at the end of install, if the user choose to launch the soft, it is launched with admin rights, and not user right.
And my soft save datas in user profile, so at the firt start after install, datas are saved in the admin profile, and the user don't find them when he wants to user the soft another day.
Is there a way to install soft with UAC in program files, and then launch soft at the end of install with user rights ?
Thanks for your help.
Anders
29th October 2009 09:47 UTC
the easy way: disable the run checkbox
the hard way: use the UAC plugin
Bill2
29th October 2009 09:51 UTC
:)
Well, I have a look at UAC plugin, but I don't like the fact that it is the install that prompt for the admin password ... It may be not appears as very safe for the user.
So, I will use the first method.
An other question: if I use a ExecShell function, does it run with admin rights, or user rights "from the shell" ?
In the second cas, it could be a great things, no ?
MSG
29th October 2009 11:22 UTC
The program you execute with ExecShell will be run at the same level as the installer that executed it. Just like with Exec, ExecWait, nsExec or any other method of executing programs.
(Expect for the CallAsUser function in the UAC plugin, but like Anders hinted that's a world of pain.)
Bill2
29th October 2009 11:44 UTC
Right. I disable the finispage_run, and that' all!
(And may be this issue can be fixed in a future version of NSIS, I saw in other post that I'm not the only one to have this problem ...)
Thanks for you help :)
pengyou
29th October 2009 13:31 UTC
I have found that the UAC plugin works very well. It lets my installer do some things as an administrator and some as a standard user. I had to spend some time experimenting with the UAC plugin but soon found it suits my needs very well.
As far as I am concerned the "world of pain" mentioned elsewhere in connection with the UAC plugin is an exaggeration.
MSG
29th October 2009 13:49 UTC
Of course it is an exaggeration, but for NSIS newbies it most definitely is pain. Also I'll add that most people using the UAC plugin are NOT using it the way they should. It's a more complex problem than most people think or realize.
pengyou
29th October 2009 14:10 UTC
It's a more complex problem than most people think or realize.
I completely agree. After reading the documentation I thought I knew what I was doing but soon found that I was wrong - my installer was not doing what I expected it to do.
Once I took the time to write a few simple test programs and looked at what happened when I ran them I was able to see where I had gone wrong.