As you already know, all EXE files contain several sections. One section is used to store application resources. So why not use it to store the files needed for the script to run? We called this feature Embedded Files.
To add files, select the Embedded Files tab and click the Add button. During compilation, all files will be compressed into a ZIP archive and added to the resources section. If your files have the same names, but are located in different directories, then this is no longer a problem either. Starting from version 5.3 it is possible to add directories.
After running the compiled application, the embedded files will be unpacked before running the main script. The location for unpacking is determined by the project settings specified before compilation. To avoid conflicts when running several copies of the script at the same time, the files are unpacked into subdirectories with a unique name. The %MYFILES% environment variable will contain the path to this folder.
The compiler offers a choice of three locations for unpacking embedded files.
After the script completes, all files will be deleted. Please note that after the normal launch of external programs from a script, its execution ends immediately. In this case, the embedded files may continue to be used by the external application and cannot be deleted. This problem can be solved by calling external applications with the CALL command. The script will wait for the program to complete and the files will be deleted successfully.
For example, you want to display a program manual when you use the -HELP switch. To do this, create a text file "help.txt" with program help and add it in the embedded files. In the main script use this code:
TYPE "%MYFILES%\help.txt" PAUSE
Compile the project and run executable from command line with "-HELP" switch. Program will show manual and wait for user input. If the text does not fit on the screen then use the MORE command will be a good idea.