PDA

View Full Version : Commandline does not fail if SB* file does not exist



NewsArchive
08-22-2014, 01:44 AM
Hi Friedrich,

I just ran into an interesting problem. I'm building a new install of
Build Automator and had updated the SB script to SB8. However, I had
not updated the file extension in BA to use SB8, rather SB7. The .SB7
files however no longer exists and the command line compiler doesn't
seem to pick this up as a problem<g> The return code was success so it
took me a few minutes to figure out what was going on.

I will add a file exist check in BA, but you may want to do the same in
SB and make the compile fail if the script doesn't exist.

Best regards,

--
Arnor Baldvinsson - Icetips Alta LLC

NewsArchive
08-22-2014, 01:54 AM
> I will add a file exist check in BA, but you may want to do the same in
> SB and make the compile fail if the script doesn't exist.

Let me know when you have a build that you want me to test for you Arnor.

I've gotten bitten by that one before too and it threw me for a loop until
I figured out what was going on!

:-)

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
08-22-2014, 01:54 AM
Hi Charles,

> Let me know when you have a build that you want me to test for you Arnor.
>
> I've gotten bitten by that one before too and it threw me for a loop until
> I figured out what was going on!

I have added a check in BA so that it will fail the compile if the
project filed doesn't exist:) It's working perfectly:) I'm in the last
throes of getting BA 2014 ready and out the door. Had hoped for this
week, but the darn docs are taking longer than I expected - what else is
new?<g>

Best regards,

--
Arnor Baldvinsson - Icetips Alta LLC

NewsArchive
08-22-2014, 07:53 AM
Just for fun, I tried it with our own in-house batch compiler (it's used to
compile the SetupBuilder images for production). I changed all .sb8 project
file extenstions to .sb7 (so all files do not exist) and started the batch
run.

The compiler always returned "1" (failed). Then I changed it back from .sb7
to .sb8 and the command line compiler returned "0" (success).

Perhaps I am missing a step on how to reproduce this.

Friedrich

NewsArchive
08-22-2014, 07:54 AM
Arnor,

> I will add a file exist check in BA, but you may want to do the same in
> SB and make the compile fail if the script doesn't exist.

As far as I can see, SetupBuilder already does it for years. I have tested
it on three different machines with the same results.

If a command line compile fails, the error code level is set to the number
of errors. If the command line compile cannot be started (e.g. project file
not found), the return value is 1.

BTW, this is the original SB compiler source code:

---

IF SB_access(GLO:MainScript, 0) = 0 THEN
SB_GetLongPath(GLO:MainScript, 260) ! New: 29-Oct-2007

GLO:CommandLineCompiler = TRUE ! New: 18-Jan-2012

yada
...
ELSE HALT(1)
END

---

See attached screenshots.

I called a script (C:\test\doesnotexist.sb6) which does NOT exist and the
compiler returned "1". Command line FAILS!

I called an existing script (C:\test\IsElevated.sb8) and the compiler
returns "0".

Friedrich

NewsArchive
08-22-2014, 07:55 AM
And another test on Windows 8.1. If the scripts did not exist then the SB
command line compiler returned "1" (failure) to our batch compiler (written
in SetupBuilder itself). If the scripts where accessible then the compiler
returned "0" (success) to the batch compiler.

Perhaps I am missing a step.

Friedrich

NewsArchive
08-22-2014, 10:01 AM
Hi Friedrich,

> As far as I can see, SetupBuilder already does it for years. I have tested
> it on three different machines with the same results.

YOu are absolutely correct of course! THe problem was in my code where
I run SB. At some point way in the past SB didn't return an exit code
and I cooked up a different way to detect if it had compiled or not and
never added a check for the exit code! I've got this fixed now:)

Best regards,



--
Arnor Baldvinsson - Icetips Alta LLC

NewsArchive
08-22-2014, 11:16 AM
> I have added a check in BA so that it will fail the compile if the
> project filed doesn't exist:) It's working perfectly:)

Cool!

> I'm in the last
> throes of getting BA 2014 ready and out the door. Had hoped for this
> week, but the darn docs are taking longer than I expected - what else is
> new?<g>

LOL - so true.

:-)

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
08-22-2014, 11:20 AM
Perfect :) Thanks for the update, Arnor !!!

Friedrich