kalverson
11th July 2011 19:04 UTC
MUI_FINISHPAGE_RUN question
In one of our older installs, I have run into a situation where the application has the wrong configuration path. This is due to admin elevation on a standard user profile during the install. The application is launched at the end using the admin profile rather than the standard user profile and thus has the wrong configuration path. Is there an easy wait to either disable the checkbox on the finish page in this situation, or just launch the application with the correct standard user profile instead?
MSG
11th July 2011 21:02 UTC
Simply don't add the RUN macro.
Or, if you want to disable the run option only for elevated installs, you can do that in the page's SHOW function. The HWND of the run checkbox is stored in a variable. See NSIS\Contrib\Modern UI 2\Pages\Finish.nsh to find out what it's called.
kalverson
12th July 2011 13:08 UTC
I found what I needed in the System.nsh header here since I am not using MUI 2:
!ifdef MUI_FINISHPAGE_RUN
GetDlgItem $MUI_TEMP1 $MUI_HWND 1203
SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
EnableWindow $MUI_TEMP1 0
!endif
Now all I have to do is figure out if I am a standard user that was elevated at install time.
Thanks for your help.
kalverson
12th July 2011 18:40 UTC
On second thought, I was reading what the UAC plug-in does and discovered I can launch my application as the user which is what I really wanted to do in the first place. It looks like using the UAC plug-in to launch the installled applicaiton is the way to go. One additional question if any knows, has the UAC plug-in been tested on MS servers 2003 or 2008? I did not see these in the OS test environment list.
http://nsis.sourceforge.net/UAC_plug-in
MSG
13th July 2011 06:43 UTC
UAC plugin works fine on WinServer 2003. I never tested on 2008.
The reason I never mentioned the UAC plugin is that it makes installers a lot more complex, and it adds a hundred things that can go wrong. It's definitely not recommended for beginners. That being said, the plugin was indeed designed to do exactly what you want to do. Just make sure to examine and understand the example scripts.
kalverson
13th July 2011 14:09 UTC
Thanks for you help and the additional comments on UAC. I have implemented the UAC plug-in and it does solve our issue. There is one minor thing that occurs now, but I am not sure anything can be done about it. The UAC security dialog that asks for logon credentials sometimes is minimized and blinking on the task bar. If you user does not notice this, they might think nothing happened when they double clicked the installer exe.