You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DMDircUpdater.dpr 816B

123456789101112131415161718192021222324252627282930313233
  1. program DMDircUpdater;
  2. {$MODE Delphi}
  3. {$APPTYPE GUI}
  4. {$R UAC.rc}
  5. uses Windows, SysUtils, classes;
  6. var
  7. updateFile: String = '';
  8. i: integer;
  9. jarName: String;
  10. begin
  11. jarName := ExtractFileDir(paramstr(0))+'\DMDirc.jar';
  12. if ParamCount > 0 then begin
  13. for i := 1 to ParamCount do begin
  14. updateFile := updateFile+' '+paramstr(i);
  15. end;
  16. if FileExists(pchar(jarName)) then begin
  17. if not DeleteFile(pchar(jarName)) then begin
  18. MessageBox(0, 'Unable to delete DMDirc.jar', 'Update Failed', MB_ICONSTOP);
  19. end;
  20. end;
  21. if MoveFile(pchar(trim(updateFile)), pchar(jarName)) then begin
  22. MessageBox(0, 'Client update was successful.', 'Update Completed', MB_OK);
  23. end
  24. else begin
  25. MessageBox(0, pchar('Unable to move '''+updateFile+''' to DMDirc.jar'), 'Update Failed', MB_ICONSTOP);
  26. end;
  27. end;
  28. end.