Waiting for WBRun completion

9 posts / 0 new
Last post
Hans
Hans's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-12-09 22:04
Waiting for WBRun completion

ZitaFTP Server's install script currently uses WBRun to start the installer. Unfortunately, WBRun doesn't wait for completion (it isn't supposed to), and AmiUpdate will delete the installer's files right from under its nose.

I don't see a command line option to make WBRun wait for completion before returning. Is this possible? If not, what's an alternative way to run something as if it were started from Workbench that will wait for completion?

I suppose that I could also call the installer directly, but that's not very flexible (e.g., what if I change the installer tool; WBRun reads it from the icon file).

Hans

OldFart
OldFart's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2010-11-30 14:09
Re: Waiting for WBRun completion

Hi Hans,

Have you tried using tooltype 'DONOTWAIT'?

OldFart

Edit:
This one subject is maybe about simmilar issues?
https://amigaworld.net/modules/newbb/viewtopic.php?topic_id=44672&forum=14

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 6 days ago
Joined: 2013-05-30 00:53
Re: Waiting for WBRun completion

...
I suppose that I could also call the installer directly, but that's not very flexible (e.g., what if I change the installer tool; WBRun reads it from the icon file).
...

If you change Installer tool then maybe the (installer) script won't be usable neither.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Hans
Hans's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: Waiting for WBRun completion

@OldFart

Have you tried using tooltype 'DONOTWAIT'?

No, because I DO want it to wait... WBRun not waiting is the root cause of the problem I need to solve.

@jabirulo

If you change Installer tool then maybe the (installer) script won't be usable neither.

True, but irrelevant. The current AutoInstall script could handle me changing to a classic AmigaOS installation script with no changes. Alas, being unable to get the script to wait for completion renders it useless.

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

jap
jap's picture
Offline
Last seen: 9 months 2 weeks ago
Joined: 2011-06-04 05:53
Re: Waiting for WBRun completion

Hi Hans,

There is an old WBRun version with source code in Aminet: https://aminet.net/package/util/cli/WBRun

Perhaps it can be modified to wait for Installation Utility's completion?

hypex
hypex's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2011-09-09 16:20
Re: Waiting for WBRun completion

I suppose this is one of those situations where opening an icon on Workbench (or from WBRun) loads up a program that multitasks so just sets it off and leaves it to be.

How much control does the installer have with things like setting environment variables? Slightly dirty way about it, but if the installer could set a variable for error or completion, your spawning script with WBRun could check every few seconds or so for the variable. Then when it finds it check the contents and act on the result.

A better way that just came to mind is if the actual installer script could run a DOS command to break your script. Then your script catches it. But you'd need to send it a process number and WAIT only waits for time.

It may be best to simply script it. That is use some command to extract the default tool from the icon and project file, then call it directly from the script. That way it should block your script until it's done.

Or, if your script needs to be dynamic, find some way of finding or storing what installer and files needs to be used, and call it direct.

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
Re: Waiting for WBRun completion

Workbench knows when a program is finished. It has to know, because it has to clean up the WBStartup message. So in theory it could make you wait for completion, if only there was a way to tell it to do so. Currently there is not. If you look at the autodocs for OpenWorkbenchObject, it seems like its primary function is to open drawer windows and only by chance it can also be used to run tools or projects. A new tag WBOPENA_WaitForCompletion would be needed.

IMHO jap's suggestion is the most promising. If you send the WBStartup message to the new process, you can also wait for it to return.

A solution by variables or similar seems possible, but I find this a stupid approach. If the called program knows that it is part of the installation process, it can be changed so that it can be called synchronously from the script. It wouldn't need to take special action to synchonise an otherwise asynchronous process.

As you are the master of the installer script as well as the autoinstall script, I would call the installer from the shell script with the command line options set to the icon's tool types. This would even make it possible to let autoinstall run the installer silently without user interaction while when run from icon it shows all the dialogue options.

Hans
Hans's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: Waiting for WBRun completion

@thomas

Thanks. I'm probably going to call the installer directly.

Hans

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

Hans
Hans's picture
Offline
Last seen: 3 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: Waiting for WBRun completion

Yuck! Another reason for not wanting to call the "Installation Utility" directly, is because it won't read the tool-types from the command line. The tool-types store details such as the package name and the logo image. So, I now need to update that info twice...

Hans

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

Log in or register to post comments