USB Locked Application

kandarpmistry

New member
Dear Sirs,

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.

Regards,

Kandarp Mistry.
 
Last edited:
Dear Sirs,

I have entered the following code for a portable application in UserMainscript.
Code:
function OnPubLoaded: Boolean;
var HDID : Boolean;
var HDID1 : String;
begin                     
 // 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
begin
      GetManualHardwareID(1);  
      HDID := GetGlobalVar("HEPublicationOnUSB","");
end;
      if HDID = True then
       MessageBox("Application exists on USB", "Error", MB_OK+MB_ICONERROR)
      else
       MessageBox("Application does not exist on USB", "Error", MB_OK+MB_ICONERROR)
end;
but on executing the exe application, the following error is displayed:
index.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
Please tell me the problem. Please reply soon.

Kind Regards,

Kandarp Mistry.
 
Last edited:
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.
 
Last edited:
Back
Top