//+------------------------------------------------------------------+
//| Traders Toolbox Licence Create.mq5 |
//| Copyright 2020, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property script_show_inputs
#include <Licence.mqh>
//--- input parameters
input string EncyptionKey; // Encryption Key
input string Broker; // Broker Name
input string AccountNameStr; // Account Name
input string FileName; // File Name
input bool CommonFolder = true; // Put in Common Folder
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
string KeyStr = "thekeygoeshere";
string AccountStr = AccountInfoString(ACCOUNT_NAME);
string BrokerStr = AccountInfoString(ACCOUNT_COMPANY);
string FileStr = "Filename.lic";
// if no input was specified defaults to Setttings above...
if(EncyptionKey != "")
KeyStr = EncyptionKey;
if(AccountNameStr != "")
AccountStr = AccountNameStr;
if(Broker != "")
BrokerStr = Broker;
if(FileName != "")
FileStr = FileName;
CLicence *CEALicence;
CEALicence = new CLicence(FileStr,KeyStr, true); // true if file must be placed in common folder...
if(CEALicence.m_Write(AccountStr, BrokerStr))
{
MessageBox("Licence Created for "+AccountStr+" "+BrokerStr,"Licence Created", MB_OK);
};
delete CEALicence;
}
//+------------------------------------------------------------------+
Comments