PDA

View Full Version : cd security/only run cd in code ?


esen
01-05-2009, 03:45 AM
this code run build&publish target in Burn data cd/dvd. But everybody see in project then file.

drive_type = Drive.GetType(_SourceDrive);

if (drive_type ~= DRIVE_CDROM) then
Dialog.Message("Notice", "This Application Must be run from the original CD ROM", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1)
Application.Exit()
end

but build&publish target in Web/Email executable in stops working even if the CD is in the driver.

How do build&publish target in Web/Email executable in write that code? or any only run in cd code... Help me.

shanex252
01-10-2009, 01:06 PM
DrivesTB = Drive.Enumerate();
for nIndex, DrvLetter in DrivesTB do
if Drive.GetType(DrvLetter) == 5 then
result = File.Find(DrvLetter, "autorun.exe", false, false, nil, nil);
if not (result) then
Dialog.Message("Notice", "This Application Must be run from the original CD ROM", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1)
Application.Exit()
end
error = Application.GetLastError();
if (error ~= 0) then Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
Application.Exit()
end
end
end