PDA

View Full Version : Getting run code from #run



NewsArchive
07-21-2008, 03:14 AM
Hi Friedrich,

In one of my installs I call an external program that goes through some
files and checks for spaces in the filenames. If a filename has a space I
have to change it so I pop up a message to remind me - which I do in my
external program.

When I call the compiler from the Build Automator I would like to just make
the compile process fail if my external program fails.

Note that this is the compile process, not the compiled install. Is there a
way for me to do something like this:

#if #run myprogram.exe %MYPATH%
#terminate compile
#endif

Any ideas?

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
07-21-2008, 03:14 AM
Hi Arnór,

> In one of my installs I call an external program that goes through some
> files and checks for spaces in the filenames. If a filename has a space I
> have to change it so I pop up a message to remind me - which I do in my
> external program.
>
> When I call the compiler from the Build Automator I would like to just
> make the compile process fail if my external program fails.
>
> Note that this is the compile process, not the compiled install. Is there
> a way for me to do something like this:
>
> #if #run myprogram.exe %MYPATH%
> #terminate compile
> #endif
>
> Any ideas?

See release notes for Build 2243 (May 2008)

> IMPROVEMENT: IDE: Add a SB_ERROR preprocessor symbol to retrieve return
> values from executed compiler directives

From the latest #run documentation:

If the function succeeds, the SB_ERROR preprocessor symbol value is zero.
If the function fails, the SB_ERROR preprocessor symbol value is nonzero.

The SB_ERROR symbol "should" do what you want.

Does this help?

Friedrich

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
07-21-2008, 03:15 AM
Hi Friedrich,

> From the latest #run documentation:
>
> If the function succeeds, the SB_ERROR preprocessor symbol value is zero.
> If the function fails, the SB_ERROR preprocessor symbol value is nonzero.
>
> The SB_ERROR symbol "should" do what you want.
>
> Does this help?

Is SB_ERROR symbol returned when the SB compiler exits? I.e. if I call a SB
script from Build Automator, the script calls a clarion exe that does a
HALT(1), does the SB compiler fail? Or can I make the compile fail with the
SB_ERROR returned from the #run?

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
07-21-2008, 03:15 AM
Hi Arnór,

> Is SB_ERROR symbol returned when the SB compiler exits? I.e. if I call a
> SB
> script from Build Automator, the script calls a clarion exe that does a
> HALT(1), does the SB compiler fail? Or can I make the compile fail with
> the
> SB_ERROR returned from the #run?

It is returned after you execute the #run directive.

For example:

#run c:\test\clariontest.exe
#ifdef SB_ERROR Equals "1" Then
#msg "Clarion executable returned 1"
#halt
#else
#msg "no error"
#end

Does this help?

Friedrich

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
07-21-2008, 03:16 AM
Hi Friedrich,

> #run c:\test\clariontest.exe
> #ifdef SB_ERROR Equals "1" Then
> #msg "Clarion executable returned 1"
> #halt
> #else
> #msg "no error"
> #end
>
> Does this help?

Yes! The #halt was what I was missing:)

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
07-22-2008, 02:13 AM
Hi Friedrich,

>> #run c:\test\clariontest.exe
>> #ifdef SB_ERROR Equals "1" Then
>> #msg "Clarion executable returned 1"
>> #halt
>> #else
>> #msg "no error"
>> #end
>>
>> Does this help?

Finally got around to do some testing with this. Is there a way to set a
return code with #halt? What happens is that SB just terminates normally
and the exit code is 0 from SB and the compile error log is not created so I
have no way of knowing that the compile process was halted and didn't finish
normally.

The only way I can think of is to use an ini file or the registry to write
some value to if I hit the #halt condition and then check for that in Build
Automator and add a log entry...

Not a big deal, but I think it would be nice to be able to set the exit code
in #halt, similar to what you can do with HALT() in Clarion.

--
Arnor Baldvinsson
Icetips Creative, Inc

NewsArchive
07-30-2008, 02:05 AM
Hi Arnór,

> Finally got around to do some testing with this. Is there a way to set a
> return code with #halt? What happens is that SB just terminates normally
> and the exit code is 0 from SB and the compile error log is not created so
> I have no way of knowing that the compile process was halted and didn't
> finish normally.
>
> The only way I can think of is to use an ini file or the registry to write
> some value to if I hit the #halt condition and then check for that in
> Build Automator and add a log entry...
>
> Not a big deal, but I think it would be nice to be able to set the exit
> code in #halt, similar to what you can do with HALT() in Clarion.

Added to SetupBuilder 6.9 (see attached screenshot).

You can set an exit code now. SB69 should be available later this week.

Thank you for your suggestion!

Friedrich

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

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

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
07-30-2008, 02:06 AM
Hi Friedrich,

>> Not a big deal, but I think it would be nice to be able to set the exit
>> code in #halt, similar to what you can do with HALT() in Clarion.
>
> Added to SetupBuilder 6.9 (see attached screenshot).
>
> You can set an exit code now. SB69 should be available later this week.
>
> Thank you for your suggestion!

Welcome:)

What I needed this for was to execute a program that goes through files in a
folder that are included with wildcards in SB. However, I have to make sure
that the filenames do not contain spaces and that's why I wrote this simple
exe to do that. I could probably do that in SB by now but I think this
started back in SB4<g> So what I would do is just pop up a message in my
exe if there was a space in the filenames and then I'd terminate the install
compile manually. As I as getting this into a Build Automator project I
realized that this caused a problem;)

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php