ps2
Posts: 16
Joined: Fri May 02, 2008 9:54 pm

Delaying Script action

Hi,

At the end of the installation process I launch a browser to access the application. In some cases the web server doesn't come up before the browser times out. Ideally I'd like to delay 30 seconds before launching the browser as that should be sufficient time for everything to initialize - is this possible?

Thanks again,

ps.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Delaying Script action

Hi,

I'm afraid that this is not supported directly by Windows Installer. However, you can add to the package another custom action which runs right before your custom action. This new custom action should do something for 30 seconds and then exit (if it set as synchronous, the installer will wait for it to finish).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ps2
Posts: 16
Joined: Fri May 02, 2008 9:54 pm

Re: Delaying Script action

Thanks Cosmin,

I had a similar thought but wasn't certain it would run in the correct order - do I need to do anything to ensure this? Is the order that they appear the list the order they are guaranteed to run in? Also, does it matter that the browser event is launched asyncrhonously?

Thanks again,

ps.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Delaying Script action

Hi,
Is the order that they appear the list the order they are guaranteed to run in?
Yes, the order shown in the "Custom Actions" page is the order in which the standard and custom actions are executed.
Also, does it matter that the browser event is launched asyncrhonously?
This doesn't matter since the installation has already been delayed.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ps2
Posts: 16
Joined: Fri May 02, 2008 9:54 pm

Re: Delaying Script action

Hi Cosmin,

I tried an inline vbs script along the lines of WScript.sleep 30000 but it doesn't seem to work. I've decided instead to write a simple java class to perform this delay and include it as part of the distribution. My only remaining question is which action do I use to execute the class file? The java distribution is part of a pre-requisite package so I know it will be available at [BASE_INSTALL_DIR]\jre1.5.0\bin\java.exe and the executable class file is in [APPDIR]. I've tried everything I can think of and it only returns an error indicating that "a program required for this install to complete could not be run".

Thanks,

ps.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Delaying Script action

Hi,

There is a discussion on the forum about delaying a custom action, please take a look:
http://www.advancedinstaller.com/forums ... f=2&t=4849

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”