Old 23rd February 2011, 21:40   #1
joe131
Junior Member
 
Join Date: Jun 2006
Posts: 23
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!
joe131 is offline   Reply With Quote
Old 23rd February 2011, 22:04   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,321
You are probably executing the uninstaller incorrectly, are you using the _?= parameter and ExecWait?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th February 2011, 01:02   #3
joe131
Junior Member
 
Join Date: Jun 2006
Posts: 23
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!
joe131 is offline   Reply With Quote
Old 24th February 2011, 02:16   #4
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
You could RTFM.
demiller9 is offline   Reply With Quote
Old 24th February 2011, 14:47   #5
joe131
Junior Member
 
Join Date: Jun 2006
Posts: 23
There isn't ONE WORD in the FM about "_?="!
joe131 is offline   Reply With Quote
Old 24th February 2011, 14:49   #6
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
Quote:
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.
...
jpderuiter is offline   Reply With Quote
Old 24th February 2011, 15:09   #7
joe131
Junior Member
 
Join Date: Jun 2006
Posts: 23
Sorry, I found it in the Uninstaller section. It wasn't in anything doing with
ExecWait

Thanks
joe131 is offline   Reply With Quote
Old 24th February 2011, 15:59   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK 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