Old 29th October 2009, 07:32   #1
Bill2
Junior Member
 
Join Date: Jan 2007
Location: France
Posts: 5
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.
Bill2 is offline   Reply With Quote
Old 29th October 2009, 07:47   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
the easy way: disable the run checkbox

the hard way: use the UAC plugin

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 29th October 2009, 07:51   #3
Bill2
Junior Member
 
Join Date: Jan 2007
Location: France
Posts: 5


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 ?
Bill2 is offline   Reply With Quote
Old 29th October 2009, 09:22   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.)
MSG is offline   Reply With Quote
Old 29th October 2009, 09:44   #5
Bill2
Junior Member
 
Join Date: Jan 2007
Location: France
Posts: 5
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
Bill2 is offline   Reply With Quote
Old 29th October 2009, 11:31   #6
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
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.
pengyou is offline   Reply With Quote
Old 29th October 2009, 11:49   #7
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.
MSG is offline   Reply With Quote
Old 29th October 2009, 12:10   #8
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
Quote:
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.
pengyou is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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