Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   UAC plugin, installer window goes behind (http://forums.winamp.com/showthread.php?t=329555)

pbeisel 12th April 2011 03:27

UAC plugin, installer window goes behind
 
using the nullsoft UAC plugin v0.2.2d.zip, i find that the installer window often launches behind other windows (like the browser that opened it).

any ideas how to force it front most?

Anders 12th April 2011 03:37

You could try 2.3, I can't remember if it is fixed there or not.

pbeisel 12th April 2011 04:05

I tried 2.3 but I think it didn't work on Vista (I should reverify this).

Nonetheless, was this a known bug and fixed at some point?

MSG 12th April 2011 05:41

This is a known issue (somewhat), but like Anders said, he doesn't remember whether he already fixed it or not.

pbeisel 12th April 2011 15:24

if a fix was made to bring the installer window frontmost, can you kindly tell me where in the code? i will compare the two builds to confirm which version has the fix. thanks.

Anders 12th April 2011 16:17

There is no simple fix you can just apply

Highcoder 12th April 2011 16:33

Quote:

Originally Posted by Anders (Post 2762901)
There is no simple fix you can just apply

No? What about System::Call 'user32::SetForegroundWindow(i r0)' in .onGuiInit?

EDIT: $0 (r0) should contain the Installer HWND

Anders 13th April 2011 00:54

SetForegroundWindow only works if your process has set foreground rights (During .onInit we have no window and so we lose the foreground "lock")

Highcoder 13th April 2011 06:10

*facepalm* yes you are right. :-) (or not? i wrote .onGUIinit not .onInit)
An if you put this in the "show_function" of the first window?
Or create a (immediately leaved) custom page before the first internal page and put this in the leave_function?

cheers

MSG 13th April 2011 10:00

Feel free to give it a try and find out. :-)

I don't have this problem because I don't elevate in .onInit, but that opened up a whole other bag of trouble. Like, getting the outer instance to hide properly.

Highcoder 13th April 2011 11:07

I don“t have to... user pbeisel have to try it. :-)
I have no problem.

jlh 13th April 2011 19:54

hi all,

first, just wanted to thank everyone for nsis. i have worked with a bunch of installers over the years and my experience with nsis has been, by far, the best. thanks for the hard work and great product!

at the moment, i am struggling with the uac plugin. i think my issue is similar to the one being discussed here. when running my installer, when i get to the elevate permissions step, the dialog doesn't show up on the screen -- instead, i just see a shield icon in the tray at the bottom of the screen. when i click the shield, then is see the dialog. after that, everything works correctly. but i am concerned the my customers won't see shield and will get stuck.

i am hoping there is just a problem with my installer script. does anyone know what might be causing this?

i noticed that the dropbox installer (http://www.dropbox.com) appears to use nsis and the uac plugin and their elevate permissions dialog shows up right away as it should.

anyone have any ideas?

thanks

MSG 14th April 2011 04:57

Where are you trying to elevate? .onInit? .onGuiInit? Somewhere else?

jlh 14th April 2011 14:34

we are elevating in onInit()

code:


Function .onInit

UAC_Elevate:
!insertmacro UAC_RunElevated
StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user?
StrCmp 0 $0 0 UAC_Err ; Error?
StrCmp 1 $1 0 UAC_Success ;Are we the real deal or just the wrapper?
Quit

UAC_Err:
MessageBox mb_iconstop "Unable to elevate, error $0"
Abort

UAC_ElevationAborted:
# elevation was aborted, run as normal?
MessageBox mb_iconstop "The installer requires admin access."
Abort

UAC_Success:

System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
Pop $R0

StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
Abort

StrCmp 1 $3 +4 ;Admin?
StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
MessageBox mb_iconstop "The installer requires admin access. Please try again."
goto UAC_Elevate

FunctionEnd


pengyou 15th April 2011 11:48

What is the RequestExecutionLevel setting in your script?

MSG 15th April 2011 12:05

I don't think that should matter, as far as I know UAC_elevate will runas admin $EXEPATH regardless of the current level.

I guess if noone else has a solution, you could always try elevating after the window has been created... >_>

Anders 15th April 2011 17:40

Asking about RequestExecutionLevel is pointless, if you set it to admin, the plugin becomes pointless and has no effect

LoRd_MuldeR 15th April 2011 23:42

Quote:

Originally Posted by pbeisel (Post 2762727)
using the nullsoft UAC plugin v0.2.2d.zip, i find that the installer window often launches behind other windows (like the browser that opened it).

any ideas how to force it front most?

Doing the elevation in .onGuiInit rather than .onInit solved that issue for me ;)


All times are GMT. The time now is 17:33.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.