Smart Package Robot 's "Script to Executable" Compiler

<< Click to Display Table of Contents >>

Navigation:  2. Components > 2. EXE-Compiler >

Smart Package Robot 's "Script to Executable" Compiler

'#INC: - Include Files or Folders

Previous Top Next


Compiler-Directives

 

'#INC: - Include Files & Folders

Used to add files and folders to your executable package

 

 

Intention

 

Compiler-Directives start with  the Sequence:

'#

Which is a comment-sign on the left and then the #.

 

Because of the comment sign, the running script ignores these commands at Runtime (at time of script execution).

 

Compile-Time, that is, when the script is being compiled to an Standalone EXE-File. At Compile-Time these commands can change several behaviors.

 

'#INC:

The "#INC:" statement can be used to include Files or folders into the final EXE-Package

 

How do I include files or folders into the package?

 

Using the "\" Option with '#INC: will include the folder but no subfolders.

'#INC:myfolder\

 

Using the "\*" with '#INC: will include the folder and all subfolders.

'#INC:myfolder\*

 

This will include only the given file, which should be placed in the same folder as the script file (shortname for the script-file folder is ?path\).

'#INC:?path\myfile.txt

 

All of the above examples will only make sense if the specified files are within the project folder.

Now you can also include files from other places, outside the project folder.

For this the:

               ->

 

Operator can be used. Usage is like this:

 

'#INC:?desktop\Infos.pdf->?path\

 

Anything on the right sider of the -> Operator is treated as a folder.
Therefore, you can not use the -> Operator to rename files.

 

For example:

 

'#INC:?desktop\Infos.pdf->?path\XY.pdf

 

Will result in a Folder "XY.pdf" to be created. Insider the folder you will find then "Infos.pdf"-file.

 

You can use the -> Operator for files, and also for folders and sub-folders.

 

'#INC:c:\inetpub\*->?path\inetfiles\

 

Will result in something like this, when the executable is unpacked.

 

Include3

 

 

What happens if there are files that can not be included, because they are "Locked" by windows?

 

In this case the Compiler will bring up an error-message like this.

 

Detailed Description of Error-codes about files can be found online, here and on other places:
API-File Error-Codes

 

Include-Error

 

Autoinclude:

Script-Files that are used with JNF. JNJ. or #INC: (Preprocessor File-Include) are automatically added to a executable package, if the path does not contain any variables.

Thats is, because the value of variables is undefined at compiletime. Specialfolders like ?path\ are ok, and will not block Autoinclude of Scriptfiles.

 

 

Will Include-Directives in Library files be found?

 

Yes, any ".mrt"  file that is referenced with a "JNF."-like command or included in the EXE, will be read completely and all include statements that are found will be evaluated.

 

This way, you can include selective Library files, using:

 

'#INC:?path\..\MyLib\Thisfile.mrt->?path\LibXXSPR\

 

Inside the Library file.Therefore in the calling Script you do not need to do anything else then to call the Script-file using JNF. or #INC:, if this is specified inside the Library-file.

 

 

Syntax:

 

'#INC:

 

 

 

Example:

 

'----------------------------------------

' Compile-Time Commands

'----------------------------------------

' The following line will include the specified folder and all its subfolders into compiled EXE.

'#INC:C:\Files\*->?remote\

'

' More Examples follow

'#INC:C:\Files02\*

'#INC:?path\Install-Pack\*->?remote\install-Pack

'#INC:TabMdi.h.bak

'

' The following line will change the target path for the EXE-Compiler.

'#EXE:?desktop\

'

EXO.?path\

MBX.!

END.

 

 

Parameter Explanation:

 

-

 

 

Remarks:

 

Please note that the '#INC: and the #INC: (no comment sign) are two different instructions. #INC is the Preprocessor-File-Include.

 

Using the code sequence:

 

EXO.?path\

MBX.!

 

with an executable, will show you the content of the package. In case you add a "Setup.exe" File to your package, make sure that you also change the EXE. or EXX. calls to that file, in the script.

 

For example:

 

EXE.?exeloc\Setup.exe

 

must be changed to

 

EXE.?path\Setup.exe

 

to use the file that is inside the package, instead of a Setup that is in the same folder like the executable.

.

 

 

Limitations:

 

-

 

 

See also:

 

    1.4 '#EXC: - Exclude Files or Dirs from Executable

    1.3 '#SPI: - Special Instructions

    1.7 #ONCE / # OEND - Multiple Include Protection

    Specialfolders

    1.6 #INC: - Pre-Processor File-Include

    2.1.A #LIB: - User-Library Path