! Smart Package Robot 's Compiler

<< Click to Display Table of Contents >>

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

! Smart Package Robot 's Compiler

Smart Package Robot 's "Script to Executable" Compiler

Previous Top Next


Compiler-Directives

 

Smart Package Robot 's Script-Compiler

graphic

 

Smart Package Robot 's script compiler allows you to compile your script into a small,

fast, standalone, executable.file.

To do this, just press the button "compile" in the Editor.

 

Smart Package Robot 's script compiler offers features like:

  Compile your Script to Standalone Executable(-package)

  Add your Files to the package

     Add your Folders and Subfolders to the package using '#INC:

     Large Set of Special Instructions (see '#SPI:)

     utilizes Compression to remove data-redundancy

     utilizes Hashing, to verify the authenticity of your packages

     has multiple Special Options, like:

     "'#SPI:SelfDel" (Executable can delete itself after running)

  and many more.

 

The generated executable are completely Standalone, they do not need any Runtime Files to be on the Target PC.

 

We call the process of the Package-Creation "compiling", as we compile the script-code into an Standalone Executable.

 

The Compilation process can be influences using a special sort of commands, called "Compiler Directives". These commands are not real commands, as they do not influence the script-behavior at runtime. They are used by the Editor, the Compiler and the "Runtime Environment" which is used to unpack your Data, when the Executable is been started.

 

Where is my compiled executable?

 

A short example for a "Compiler Directive" would be:

 

'#EXE:?desktop\MyExe.exe

 

Placing this line at the top of your script will change the name and path where the executable is been created. In that special case it would be created on your "user-desktop" and would use the filename "MyExe.exe".

 

If you omit any line with the Compiler Directive "'#EXE:" then the file is been created on the desktop. Note that in the script there may per default be a

 

'#EXE:?path

 

or something like that. In that case the executable is been created in the same folder, where the actual script-file was saved (that is "?path\").

 

 

How do i recognize a Compiler Directive?

 

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).

 

The comment sign is important. Omitting or forgetting the comment sign, you will not get '#INC: but #INC: (no comment sign). Both are two different instructions.

#INC (no comment sign) is the Preprocessor-File-Include.

 

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

 

   There is another term, you should know and that is Unpack-Time.

   Unpack-Time is the time after the executable was started on the Target PC.

   It will then unpack all included data, together with some Runtime Files into the Temporary

   Folder of the Target-PC..This happens at "Unpack-Time".

 

 

  (User presses "Compile")     (Executable is starting)        (Script-Execution starts)

   Compile-Time        ->            Unpack-Time              ->         Run-Time

 

  All Options that influence the creation of compiled executable / packages are specified using

   such Compiler Directives. Therefore they are saved with your script.

 

  What is "?path\" ?

 

  Be sure that you understand the concept of Sprecialfolders and "?path\" before you start to

  include files or folders into your package. Normally you copy all files and/or folders that you

   want to include with your package into the same folder, where your script file is been located.

  This place is called "?path\".

 

During the Unpacking of your executable on the target system, Smart Package Robot  will re-create the situation in "?path\" on the target system, in a temporary folder.

Therefore you address all files that are included in your script with "?path\". Because only then, they will be found on the target system.

 

"?path\" will always be evaluated at runtime to the path where the actual running script file is located. This way we have a relative path that can be used to find any inluded file or directory, as long as it is below "?path\".

 

What is "?exeloc\"?

 

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.

 

?exeloc\ will evaluate at runtime to the location where the executable itself resides.

For example, if you have compiled a script to the file "MyScript.exe". And the location of "MyScript.exe" is on your desktop. Then ?exeloc\ will evaluate to the desktop-path at runtime.

 

See also:

2.0.0 Smarty's EXE-Compiler

2.1.1 '#RAU: - Run As User

2.1.2 #AOS: - Choose valid OS for executable

2.1.3 '#EXE: - Set Executable Path and Name

2.1.4 '#EXV: - Execute on System Desktop

2.1.5 '#HID: - Hidden Desktop Scripts

2.1.7 '#SPI: - Special Instructions

2.1.8 '#INC: - Include Files and Folders into the Executable

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

2.1.A #LIB: - User-Library Path

2.1.B #CRY: - enCrypt the Script

2.1.C '#AFT: - Run AFTER Compile

2.2.1 '#ICO: - Choose own Icon

2.2.2 '#ICF: - Icon from Icon-Folder

2.2.3 '#ICS: / '#ICS: Icon-Set

2.3.0. '#MAN: - Manifest for Executable

2.3.1. '#MAU: - UI-Access for Manifest for Executable

2.4.0. '#VER: - Version-Informations

2.5.0. '#CIL: - Direct Compiler Interface