www.icetips.com  Icetips Utilities Documentation 11/30/2010    

SetupBuilder Class: CompileSBProject

Previous  Top  Next  


Prototype: (String pProjectToCompile),Long,PROC

 

pProjectToCompilePath and name of the SetupBuilder project (*.sb5 or *.sb6 files) to compile.

 

ReturnsTrue if the project compiled.

       False if the project failed. 

       -1 if the SetupBuilder executable could not be found.

       -2 if the command line is too big.

 

This method takes the project file passed to it and executes the SetupBuilder compiler to compile it.  The example below shows the code that is in the TestSetupBuilderClass proceudure in the UtilDemo.app example application in your "Clarion\3rdParty\Examples\ITUtilities" folder.

 

Example:

 

CompileTheProject           ROUTINE

Data

R  Long

Code

If Loc:SBProjectDestFolder

  ! Set the destination folder if it is specified.  Comment this out if you

  ! want to use the SetupBuilder default destination.

  ITS.SetDestinationFolder(Loc:SBProjectDestFolder)

End

 

! First parameter is the SB Compiler Variable.

! Second parameter is the value to place into the compiler variable

! Third parameter determines if the VALUE is enclosed in double quotes or not.

ITS.AddCompilerVariable('PRODUCTVER','0.95.000',True)

ITS.AddCompilerVariable('EXENAME','TestBuild_0.95.000.EXE',True)

 

! NOTE:  This information is sent via the command line to SetupBuilder. 

!        The length of the command line is limited, depending on what

!        Operating System you are using.  The class will not run the

!        compiler if the command line exeeds the OS limit, avoiding

!        making a mess of things.  In order to keep the command line

!        as short as possible, make sure that you use ShortPath()

!        on any paths that you need to pass to the SB compiler.

 

! Compile the project

R =  ITS.CompileSBProject(Loc:SBProjectToCompile)

ITS.ODS('Return value: ' & R)

Case R

Of 1

  If Message('The project was compiled successfully.  ' &|

             'Do you want to view the Build HTML file?',|

             'Project compiled successfully',ICON:Exclamation,|

              BUTTON:No+BUTTON:Yes,BUTTON:Yes) = BUTTON:Yes

   ITS.ShowHTMLLogFile

  End

Of 0

  If Message('Error occured while compiling the project.  ' &|

             'Do you want to view the compile log?',|

             'Errors occurred',ICON:Hand,|

             BUTTON:Yes+BUTTON:No,BUTTON:Yes) = BUTTON:Yes

   ITS.ShowLogFile(IniMGR)

End

Of -1

  Message('Both SetupBuilder 5 and SetupBuilder 6 are installed ' &|

          'on this machine.  In that case only SetupBuilder 6.x is ' &|

          'supported and a SetupBuilder 5.x project can not be compiled.',|

          'SetupBuilder 5 and 6 detected',ICON:Hand)

Of -2

  Message('The Command line was too long.',|

          'Command Line is too long',ICON:Hand)

 

End

 

 

See also:

AddCompilerVariable

BuildCommandLine

 

 

 



Direct link to this page: http://www.icetips.com/manuals/utilities/compilesbproject_setupbuilder.htm