1. Starting Guide

<< Click to Display Table of Contents >>

Navigation:  1. Starting Guides >

1. Starting Guide

1.3.4 Compiling a package (SPRE)

Previous Top Next


Starting Guide

 

How to compile an Stand-Alone executable Package

Here is how you get additional Files packed into your Executable

 

clip0511

How do i include a folder into my package/executable?

 

You can easily include Setup-files into your executable.

Here is how to do this:

 

1. Create your project and Script as seen in the example above.

 

2. Copy the folder with the files that you want to include into the Project folder.

This look somehow like this:

 

 

graphic

 

3. Now click in the Editor Menu on "Compiler->Add folder to  EXE".

 

graphic

 

4. In the appearing dialog choose the folder that we want to add to the package, and click the OK Button.

 

graphic

 

5. You will now get something like this:

 

graphic

 

The Editor has inserted this line:

 

'#INC:?pfad\Help-Graphics\

 

into your script. In fact this line makes the folder "Help-Graphics" that is in your project folder (=?path\) to be inserted into the executable.

 

Let me give you just a quick hint at this place. In case there would be sub folders in that folder, for example:

 

 

graphic

 

then these Sub-Folders will not be included, unless you add a "*" (asterisk) to the Line.

Like this:

 

' This will include folders AND all subfolders

'#INC:?pfad\Help-Graphics\*

 

First we'll leave the asterisk away and see what happens.

 

6. Press "Compile".

 

7. What wee see is, that the executable is a bit larger then before.

 

graphic

 

8. The package is larger because of the size of the additional files, we have packed into the package. Let's now start the package and see if the files are really in there!

 

9. Click the the "HelloScript.exe" twice to start it. A folder opens, somehow like this:

 

graphic

 

10. Enter the folder and take a look inside if it's all there.

 

graphic

 

11. It's all there - just the subfolder is missing, because we did not specify the additional "*" asterisk. We'll do that now. But first click on

 

 

 

 

graphic

 

to make that folder disappear.

 

12. Now let's add that asterisk and re-compile our script:

 

 

graphic

 

13. Press "Compile" again. Now the package got larger:

 

graphic

 

This time it got 35 MB. Don't worry the size limit for a single package is somewhere

below 2 GB!

 

14. Now we'll start our package and see if anything gets unpacked properly.

Start the Package with a double click on "MyFirstEXE.exe".

 

 

graphic

 

15. Everything is there as expected. Now let's get get a bit more deep into packaging.

We do not want to include those ".ufo" and those ".png" files into our package.

 

16. For this we can use the '#EXC: - Directive. Like this:

 

 

graphic

 

It works!

 

graphic

 

Hint: The '#EXC: - Directive must always before ALL Include Directives to work as expected. It will not influence inclusions before above itself.

 

Can I use that feature to exclude folders from the package also?

 

1. Let us make an example for this also. Here is our project-folder and a sub-folder:

graphic

 

2. Inside the folder "Help-Graphics" there is an folder named "Olga". We do not want to include this folder into our final package.

Take note that there is another folder named "Olga" in the Main Project folder. This folder shall be included with our package.

 

graphic

 

Now comes the Exclusion. To exclude a folder, we can choose the name of the folder followed by a "\". We could simply write:

 

graphic

 

 

and here is what we get:

 

graphic

 

Good, the folder was not included in the package.

 

But look, the folder "Olga" from the Main-Project folder has also disappeared!

This way we told the compiler to exclude ALL Folders that have the name "Olga".

 

Now this is a special case, we'll solve it like this:

 

graphic

 

And this is the result as expected.

 

graphic

 

 

Hint: You can use WildCards like "*","?" and "#" within the Exclusion Patterns.

 

Therefore even wildcard-patterns like this:

 

'#EXC:Help-*\Olga\

'#EXC:*elp-*\Olg?\

 

will do what you expect. The important point is that you do not forget the "\" at the end of the pattern, to signal that you are excluding a folder and not a file.

 

 

 

 

  See also

 

    1.0 '#RAU: - Run As User

    1.3 '#SPI: - Special Instructions

    1.2 '#EXE: - Set Executable Path and Name

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

    3.3 Specialfolders