How to use the Global variables HEPublicationDiskInfo, GetManualHardwareID, HEPublicationOnUSB in a combination so that one can run ExeOutput Application on a particular usb only and not on any other usb or computer, thus creating an application that is locked to the usb or a hardware locked application.
I have entered the following code for a portable application in UserMainscript.
function OnPubLoaded: Boolean;
var HDID : Boolean;
var HDID1 : String;
// When the application is starting.
// Set Result to True if you want to exit immediately without any warning.
Result := False;
HDID1 := GetManualHardwareID(1);
if Length(HDID1) > 0 then
HDID := GetGlobalVar("HEPublicationOnUSB","");
if HDID = True then
MessageBox("Application exists on USB", "Error", MB_OK+MB_ICONERROR)
MessageBox("Application does not exist on USB", "Error", MB_OK+MB_ICONERROR)
but on executing the exe application, the following error is displayed:
Please tell me the problem. Please reply soon.
I think the “OnPubLoaded” event is not the place where you can call any built-in script function, because it is called at the very beginning of the application. Not all internal systems are ready, and GetManualHardwareID is probably not ready to be called in OnPubLoaded.
Try another event.