joe131
23rd February 2011 21:40 UTC
Uninstall window running under Welcome screen..
Hi All,
Here's the problem. As soon as my Installer runs it looks to see if there
is an existing version, and if it finds it, it runs the Uninstaller to remove the
previous version first.
The problem is that after the Uninstall window runs for a second,
the Welcome screen opens directly above it, and the user doesn't see the Uninstall
window running, so they can easily hit "Next", on the Welcome screen,
and the Uninstall will be hosed.
I'm currently using the Ultra Modern UI, but I've seen it happen with the MUI2.nsh
also.
What I'm currently doing is pretty kludgey. I let the Uninstall run for a second
and a half, then do a "BringToFront", and that brings it back to the top,
but it doesn't always work.
Ideally I'd set a flag variable, in the Uninstall, saying that it's running
and before the Welcome screen opens, it would check the flag, and if it was
set, it would "wait" till the Uninstaller was finished before it opens.
But it looks like you can't do any pre-opening stuff with the Welcome screen.
Maybe, if I could create a Custom screen that looks exactly like the Welcome screen,
then I could control it better.
If anyone has any suggestions on how I can keep the Uninstall window from
being covered over by the Welcome screen, I'd appreciate it!
Oh, my Installer only runs on Windows, I'm not using it for any other platform.
Thanks!
Anders
23rd February 2011 22:04 UTC
You are probably executing the uninstaller incorrectly, are you using the _?= parameter and ExecWait?
joe131
24th February 2011 01:02 UTC
Thanks for your reply.
I was using:
ExecWait "${INSTALL_DIRECTORY}\Webserver\bin\${UNINSTALLER}"
And tried changing it to:
ClearErrors
ExecWait "${INSTALL_DIRECTORY}\Webserver\bin\${UNINSTALLER}" $0
And not doing anything with the return code '$0'
I ran the Installer several times, and it seems to work, but the Welcome
screen is under the Uninstall window every time. It won't take much
for it to "decide" to come to the front.
I looked around and only found _?= used once in Examples\makensis.nsi
and couldn't find any docs on how it's used.
I did find out that I CAN add a MUI_PAGE_CUSTOMFUNCTION_PRE
before my !insertmacro MUI_PAGE_WELCOME
And I wrote this Function:
Function WelcomePre
Loop_Start:
StrCmp $UninstallRunning "TRUE" Loop_Start Loop_End
Loop_End:
FunctionEnd
And it looks like it works pretty well.
How do I use _?= ?
Thanks!
demiller9
24th February 2011 02:16 UTC
You could RTFM.
joe131
24th February 2011 14:47 UTC
There isn't ONE WORD in the FM about "_?="!
jpderuiter
24th February 2011 14:49 UTC
3.2.2 Uninstaller Specific Options
_?= sets $INSTDIR. It also stops the uninstaller from copying itself to the temporary directory and running from there. It can be used along with ExecWait to wait for the uninstaller to finish. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
...
joe131
24th February 2011 15:09 UTC
Sorry, I found it in the Uninstaller section. It wasn't in anything doing with
ExecWait
Thanks
Afrow UK
24th February 2011 15:59 UTC
That is because it has nothing to do (directly) with ExecWait. _?= is a specific option for the NSIS uninstall executable.
http://nsis.sourceforge.net/When_I_u...he_uninstaller
Stu