PDA

View Full Version : Calling Setup Builder Return Status



NewsArchive
12-28-2015, 10:14 AM
I have an application that will allow the installation, or not, based on a
number of database content analyisis. Then, I'm calling the Setup.exe from
the application using the Run function.

When Setup completes, how can I detect if the Setup.exe completed the
installation successfully? My calling application is a Clarion 9.1 app.

Mike Springer

NewsArchive
12-28-2015, 01:06 PM
Hi Mike,

> I have an application that will allow the installation, or not, based on a
> number of database content analyisis. Then, I'm calling the Setup.exe from
> the application using the Run function.
>
> When Setup completes, how can I detect if the Setup.exe completed the
> installation successfully? My calling application is a Clarion 9.1 app.

Maybe have the install write a build number or some such identifier to a
registry key or an ini file at the very end of the install. I.e.
something like:

ThisBuild = GETINI('Build','Current','','.\update.ini')
RUN(...)
NewBuild = GETINI('Build','Current','','.\update.ini')
IF ThisBuild = NewBuild
!! Install not successful
ELSE
!! Install successful
END

Best regards,

--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
12-29-2015, 10:04 AM
Thanks Arnor,
Great idea!
Mike

NewsArchive
12-29-2015, 10:05 AM
Mike,

Or you can set your own Exit Code (at the end of the script) and catch this
from your application. But to do this, you have to "wait" for the
termination of the setup.

Friedrich

NewsArchive
12-29-2015, 11:00 AM
Friedrich, the installation is coming from a CD, and if, for example, there
was a read error failure as SB was loading the files, is there a way to
identify such an failure, as opposed, for example, to the user canceling the
installation.
Mike

NewsArchive
12-30-2015, 04:02 AM
Hi Mike,

> Friedrich, the installation is coming from a CD, and if, for example, there
> was a read error failure as SB was loading the files, is there a way to
> identify such an failure, as opposed, for example, to the user canceling the
> installation.

I think a better way would be to copy the install from the CD to a temp
folder and install from there. That way you can separate the process of
reading the install and running it. If you cannot copy the file, you
can't run it, but then you can trap for errors after the COPY fails:)
If you MUST run it from the CD, then perhaps you could just read the
file into memory - or use the DOS driver to read chunks of it and check
for errors after each chunk. With the Icetips Utilities you could do
this with something like this:

ITS ITShellClass
Res LONG
CODE
Res = ITS.CopyFiles('CD:\whatever.exe',ITS.GetTempFolder ())
!! 0 if it succeeded
IF Res<> 0
!! Show error message using the last API error.
Message('Copying failed: ' & ITS.GetLastAPIError())
ELSE
RUN(ITS.GetTempFolder() & '\whatever.exe',TRUE)
IF ERRORCODE()
Message('Error running install: ' & ITS.ErrorMsg(True))
ELSE
!! Install ran - doesn't mean it finished! Check if the program
updated...
END
END

Note this code is untested and not compiled so I may have missed something;)

Best regards,

--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
12-30-2015, 09:19 AM
Mike,

> Friedrich, the installation is coming from a CD, and if, for example,
> there was a read error failure as SB was loading the files, is there
> a way to identify such an failure, as opposed, for example, to the
> user canceling the installation.

A file installation error (e.g. read error) is always a fatal error and the
installation terminates immediately. So if you write a specific value
('magic code') at the end of the installation to a .log file, then it will
not be written in case of an installation failure. You can then test for
this value from the calling application.

Friedrich