PDA

View Full Version : Custom Uninstall Script Problem



NewsArchive
03-12-2007, 08:28 AM
Version 6.0.1750

I am creating a custom uninstall script which is contained in an SBI file. This in turn is included in my install project.

During the uninstall I want to offer the user the opportunity to visit a special web page. First I check to see if there is currently a connection to the internet. If so, I ask the user permission to launch the browser and go to the web site.

With users permission, using the "Run Program" function, I launch the browser and open the web page.

*** Code Snip **** (Lines May Wrap)
Set Variable % SB PARAM1% to ScriptItem->Check HTTP Connection "http://www.domain.com/index.htm"
If % SB PARAM1% Equals "0" Then
Display Message Box "Body Text" -- "Header Text"
If % SB RETURN% Equals "$IDYES$" Then
*Run Program http://www.domain.com/index.htm (Always Install) [Wait]*
If % SB ERRORCODE% Not Equals "0" Then
Display Message Box "No Internet" -- "No Internet"
End
End
End

If % SB INSTALLERFLAG% Not Equals "1" on Position "$SB SILENTMODEFLAG$" Then
Display Message Box "#UNINST CONFIRM#" -- "#UNINST HEADING#"
Else
**** END SNIP ****

All the code above works perfectly except for one problem. The uninstall script does not wait while I execute the "Run Program" function no matter how I set up the parameters. (Wait, Hide etc.) I have literally tried all combinations. The #UNINST CONFIRM# message box above opens immediately on top of the web browser window and stays on top.

Can anyone tell me what I need to do to get the #UNINST CONFIRM# message box to delay opening until the "Run Program" function has completed?

Thanks a bunch.

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
03-12-2007, 08:28 AM
Lee,

Internet Explorer does not allow you to "wait".

HTH,

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
03-12-2007, 08:29 AM
Ouch....

Is there any other way you can think of to do what I want or am I going to
have to launch the call to the web after the install has taken place?

As always, thank you for your excellent assistance.

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
03-12-2007, 08:29 AM
Lee,

Perhaps write your own little Clarion app that makes use of the Internet
Explorer control and then run this app instead of IE to display
http://www.domain.com/index.htm. Your Clarion Internet Explorer window can
"wait". I think there is a small source code demo available on the net.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
03-12-2007, 08:29 AM
By the way, another idea. Instead of creating a "Clarion Internet Explorer"
..exe, create a DLL and then call this from your uninstall script.

Friedrich

NewsArchive
03-12-2007, 08:29 AM
Hi Friedrich,

Thank you for the ideas. I'm certain I'll be able to work something out.

Is there a way to make the uninstall confirm message window "Non Modal" so
that it doesn't stay on top? If it weren't for that I would be good to go as
I don't mind if the uninstaller window is hidden behind the browser.

Thanks again for your help.

--
Regards,

Lee
http://www.cya2day.com

NewsArchive
03-14-2007, 04:51 AM
Hi Lee,

If you can ensure that only one instance of the browser is opened and
then is subsequently closed then you can use the following to keep the
script from continuing. I've tried it and it works. Watch out for
wordwrap.

Set Variable %LOOPID% to "1"
Loop
Set Variable %LOOPID% to (Increment Variable by 1)
Sleep for "3" seconds
Set Variable %_SB_PARAM2% to ScriptItem->Detect Active
Application(iexplore.exe)
If %_SB_PARAM2% Equals "603" Then
Display Message Box "Browser Closed" -- ""
Break Loop
End
If %LOOPID% Equals "11" Then
Display Message Box "Timed out" -- ""
Break Loop
End
End

I use the %LOOPID% to close after approximately 30 seconds in the
event that the browser isn't closed.

Best Regards,
Geoff Spillane
Data Down Under

NewsArchive
03-14-2007, 04:51 AM
Hi Geoff,

Thanks for the code. I'll give it a try.

Actually, it would probably be fine just as it is if I could only get the
"Uninstall Confirm" message box to be hidden by the browser window. I guess
it is internally programmed to "Stay On Top".

--
Regards,

Lee
http://www.cya2day.com