MQL5 Program Packager - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources


This script allows you to automatically assemble a zip file of an MQL5 program containing all dependencies.
The dependencies are:
The script is based on the file scanner MQL parsed via MQL originally published in the article.
In order for the script to work properly, the user should perform a simple but important preparatory step.
Create the file makelink.bat in the mql5/files folder containing the following command and run it:
mklink /J MQL5 "..\..\MQL5\"
This file is provided with the script (binding), but has a txt extension, since the use of bat files is prohibited in MQL5 resources. You should copy the generated links.txt to the generated links file manually.
This command will create the virtual pseudo-folder "MQL5" (the so-called file system junction point ) of the real internal MQL5/files folder. The pseudo-folder is actually a link/jump to the real MQL5 folder, accessible from the MQL5 sandbox. Do not confuse the real MQL5 folder with the "MQL5" link (usually marked with a shortcut overlaid on the icon).
The first occurrence of "MQL5" in the above command is a pseudonym. You can choose another one, but at the cost of a non-standard directory structure in the generated ZIP file (the top-level folder in the ZIP will have this name). The second occurrence of "MQL5" in the command is the real name of the MQL5 folder - this part should remain intact. Run the command in the MQL5/files folder.

Access the MQL5 Sandbox from the MQL5/Files folder via connection points (symbolic links)
Important! Please note that this command creates a circular reference MQL5/file from the lower-level folder to the upper-level MQL5 folder. This can be dangerous if the software you are using is not smart enough to detect recursion in the path. For example, a loosely written backup program, antivirus software, or file manager can get stuck in an infinite loop and potentially damage your computer. operating system. Check the compatibility of your software, including MQL5 into the exception list, or remove links/jumps after completing the packaging task.
The pseudo-folder "MQL5" link is just a special file, if you no longer need it, feel free to delete it, just make sure to delete the file so that there is a link inside the MQL5/Files folder and not the real MQL5 folder in the terminal data path.
The zip file will contain the complete structure of subfolders and files in MQL5 that are referenced from the MQL5 program.
The script handles ZIP archives in pure MQL5 using the ZIP library published in the article, but with some minor fixes and improvements.
Here is an example of the log:
Processing MQL5/Scripts/mql5pack.mq5
#Property icon "mql5pack.png"
Includes MQL5/Scripts/mql5pack.png
#resource "\\Files\\makelink.txt" as string __cmd1Folder
Includes MQL5/Files/makelink.txt
#resource "\\Files\\mql5pack.txt" as string __exceptionListExample
Includes MQL5/Files/mql5pack.txt
#include
IncludeMQL5/Include/mql5/FileReader.mqh
#include "RubbArray.mqh"
IncludeMQL5/Include/mql5/RubbArray.mqh
#include "HashMapTemplate.mqh"
IncludeMQL5/Include/mql5/HashMapTemplate.mqh
#include
IncludeMQL5/Include/Zip/Zip.mqh
#include <object.mqh>
IncludeMQL5/Include/Object.mqh
#include "StdLibErr.mqh"
IncludeMQL5/Include/StdLibErr.mqh
#include
IncludeMQL5/Include/Arrays/ArrayObj.mqh
#include "array.mqh"
IncludeMQL5/Include/Arrays/Array.mqh
#include <object.mqh>
IncludeMQL5/Include/Object.mqh
#include <dictionary.mqh>
IncludeMQL5/Include/Dictionary.mqh
#include <object.mqh>
IncludeMQL5/Include/Object.mqh
#include
IncludeMQL5/Include/Arrays/List.mqh
#include <object.mqh>
IncludeMQL5/Include/Object.mqh
#include "ZipDefines.mqh"
IncludeMQL5/Include/Zip/ZipDefines.mqh
#include "ZipHeader.mqh"
IncludeMQL5/Include/Zip/ZipHeader.mqh
#include "ZipDefines.mqh"
IncludeMQL5/Include/Zip/ZipDefines.mqh
#include "ZipDirectory.mqh"
IncludeMQL5/Include/Zip/ZipDirectory.mqh
#include "ZipDefines.mqh"
IncludeMQL5/Include/Zip/ZipDefines.mqh
#include "ZipContent.mqh"
IncludeMQL5/Include/Zip/ZipContent.mqh
#include <object.mqh>
IncludeMQL5/Include/Object.mqh
#include "ZipDefines.mqh"
IncludeMQL5/Include/Zip/ZipDefines.mqh
#include "ZipHeader.mqh"
IncludeMQL5/Include/Zip/ZipHeader.mqh
#include "ZipFile.mqh"
IncludeMQL5/Include/Zip/ZipFile.mqh
#include "ZipDefines.mqh"
IncludeMQL5/Include/Zip/ZipDefines.mqh
#include "ZipContent.mqh"
IncludeMQL5/Include/Zip/ZipContent.mqh
Files processed: 19
Source length: 152757
+ MQL5/scripts/mql5pack.mq5
+ MQL5/script/mql5pack.png
+ MQL5/Documents/makelink.txt
+ MQL5/Documents/mql5pack.txt
+ MQL5/includes/mql5/FileReader.mqh
+ MQL5/includes/mql5/RubbArray.mqh
+ MQL5/includes/mql5/HashMapTemplate.mqh
+ MQL5/include/Zip/Zip.mqh
- MQL5/include/Object.mqh
- MQL5/include/StdLibErr.mqh
- MQL5/include/Array/ArrayObj.mqh
- MQL5/include/Array/Array.mqh
+ MQL5/include/dictionary.mqh
- MQL5/include/array/List.mqh
+ MQL5/Include/Zip/ZipDefines.mqh
+ MQL5/Include/Zip/ZipHeader.mqh
+ MQL5/include/Zip/ZipDirectory.mqh
+ MQL5/contains/Zip/ZipContent.mqh
+ MQL5/includes/Zip/ZipFile.mqh
Saved packaging file: MQL5/Scripts/mql5pack.mq5.zip
Files marked with "+" are added, files marked with "-" are skipped since they come from the exception list.
Attachment download
📎 dictionary.mqh (19.27 KB)
📎 rubbarray.mqh (3.7 KB)
📎 hashmaptemplate.mqh (3.17 KB)
📎 filereader.mqh (17.36 KB)
📎 zipfile.mqh (6.32 KB)
📎 zipcontent.mqh (11.81 KB)
📎 zip.mqh (17.46 KB)
📎 zipheader.mqh (12.47 KB)
📎 zipdefines.mqh (1.17 KB)
📎 zipdirectory.mqh (1.85 KB)
📎 mql5pack.txt (0.37 KB)
📎 mql5pack.mq5 (6.31 KB)
Source: MQL5 #27955
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •