Version 2 Beta v3 error

Hi

After compiling a portable app, I get the following error at startup, preventing the app from running.

Exception EArgumentOutOfRangeException dans le module
TestApp.exe en 0004CAA2.
Argument hors limities.

The source files are from an app using version 1.7, which works fine.

Thanks

Please try with Beta 4.

Just tried the Beta 4 version but still get an error.

Exception EArgumentOutOfRangeException in module
TestApp.exe at 0004CB86.
Argument out of range.

Is it possible for you to send us your EXE file for review?
Does this error occur with the General Demo that ships with ExeOutput 2?

Sorry for the late reply.

It seems the error is something to do with some custom code in the UserMain script. It works in version 1.7 ok though. Could this possibly be a bug ? If so, I’ll send you the exe.
If not I’ll need to have someone fix it.

Please post your UserMain script. Maybe there is an outdated function no more available in ExeOutput 2.

Below is the UserMain script code. Custom code has been added to work with a licensing script TrackMySoftware. This works fine with version 1.7.

uses
Classes;
// UserMain
// This script contains special functions related to some of the events triggered by the application.
// You can then optionally add new commands.

// TrackMySoftware
// Blank script
// Add your own procedures and functions.

const
URL = “http://website.co”;
AuthKey = “xxxxxxxxxxxxxxxxxxxxx”;
ProdID = “00003”;
ProdVer = “1.1”;
LicFile = “”; //default location

function tms_GetStatus(URL, AuthKey, ProdID, ProdVer, LicKey, LicFile: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_Uninstall(URL, ProdID, LicKey: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_CloseApp(URL, ProdID, LicKey: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_SetInfo(URL, ProdID, Info1, Info2, Info3: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_GetInfo(URL, ProdID: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_SendFeedback(URL, ProdID, Name, Email, Feedback: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_GetProdVer(URL, ProdID: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_GetAPIVer(URL: PWideChar): BOOL; stdcall; external “tms.dll”;
function tms_GetDeviceID: PWideChar; stdcall; external “tms.dll”;
function tms_GetLastMsg: PWideChar; stdcall; external “tms.dll”;
function tms_Decrypt(Authkey, LicFile: PWideChar): BOOL; stdcall; external “tms.dll”;

//==========================================================================
function GetStatus(URL, AuthKey, ProdID, ProdVer, LicKey, LicFile: string): Boolean;
begin
Result := tms_GetStatus(URL, AuthKey, ProdID, ProdVer, LicKey, LicFile);
end;

function GetStoredLicenseKey: string;
begin
Result := GetGlobalVar(“LicKey”, “”);
end;

function IsUnregisteredOrExpired: Boolean;
var
LastStatus: string;
var
LastMsg: TStringList;
begin
Result := not tms_GetStatus(URL, AuthKey, ProdID, ProdVer,
GetStoredLicenseKey, LicFile);

LastMsg := TStringList.Create;
try
LastMsg.CommaText := tms_GetLastMsg;
SetGlobalVar(“LastStatus”, LastMsg[0], False);
finally
LastMsg.Free;
end;
end;

function GetLastStatus: string;
begin
Result := GetGlobalVar(“LastStatus”, “”);
end;

function OnBeforeNavigate(NewURL, TargetFrame: String): Boolean;
begin
// Before the application displays a page. Set Result to True to stop the operation.
Result := False;
end;

procedure OnPHPErrorMessage(ErrorMsg: String);
begin
// When an error is returned by the PHP runtime.
end;

procedure OnNavigateComplete(URL: String);
begin
// When a page has been displayed.
end;

function OnPubLoaded: Boolean;
var
// s: string;
DLLPath: String;
begin
// When the application is starting.
// Set Result to True if you want to exit immediately without any warning.
DLLPath := GetGlobalVar(“HEPublicationPath”, “”);
UnpackVirtualResource(“tms.dll”,DLLPath + “tms.dll”);
if IsUnregisteredOrExpired then
begin
S := InputBox(“Trial period expired, please enter registration key:”, “Unregistered”, “”);
if S = “” then
begin
// Start the browser and quit
// Result := True;
Result := False;
exit;
end;

 SetGlobalVar("LicKey", S, True);
  if IsUnregisteredOrExpired then     
  begin
      MessageBox("Invalid registration key", "Error", 0);

// Result := True;
Result := False;
// GoToPage (“register-software.php”, “”)
Exit;
end;
end;

Result := False;
end;

procedure OnPubBeingClosed;
begin
// When the application is going to be closed.
end;

procedure OnDisplayWindow(WindowName: String);
begin
// When a window is going to be displayed (including main and secondary windows).
end;

procedure OnStartMainWindow;
var
i: Integer;
begin
if IsUnregisteredOrExpired then
begin
ShowMessage("GetStoredLicenseKey: " + GetStoredLicenseKey);
ShowMessage("GetLastStatus: " + GetLastStatus);
if GetLastStatus = “LicExpired” then
begin
OpenFile(“http://something.com”, “”, SW_SHOWNORMAL);
ExitPublication;
end;
else
GoToPage (“register-software.php”, “”)
end
else
begin
//license is valid, checking for custom status
if GetLastStatus = “CustomStatus” then
begin
ShowMessage(“Handle some custom status”)
end;
end;
end;

procedure OnCloseWindow(WindowName: String);
begin
// When a window is closed by the user.
end;

function OnTimer(TimerName: String): Boolean;
begin
// Occurs when a specified amount of time, determined by StartTimer HEScript function, has passed.
// Note: use StopTimer to disable the timer or set Result to True.
Result := False;
end;

function OnInvalidPasswordAtStartup: Boolean;
begin
// Occurs when an invalid global password is provided.
// Note: set to True if you want the application NOT to display an error message and exit.
Result := False;
end;

function OnExpiredPublication: Boolean;
begin
// Occurs when the global expiration date is reached.
// Note: set to True if you want the application NOT to display an error message and exit.
Result := False;
end;

procedure OnTrayIconClick;
begin
// The user clicks on the tray icon.
end;

procedure OnTrayIconDblClick;
begin
// The user double-cclicks on the tray icon.
end;

procedure OnPrintPage;
begin
// When a user wants to print the current page.
end;

Any idea on this ?
Just needing to know whether I can move forward using V2 Beta4 for my project or not.

Looks like a possible error in how your custom DLL is loaded and handled. We’re making tests to find out if the DLL part of the HEScript engine is working fine in ExeOutput 2.

"We’re making tests to find out if the DLL part of the HEScript engine is working fine in ExeOutput 2."
Can you tell me, is it working ok ?

We’re upgrading all internal components to the most recent versions. Then, we’ll publish the new update.