Last active
April 10, 2023 20:08
-
-
Save Bumboobee/97f7a341080a84517ac3522c782f48fd to your computer and use it in GitHub Desktop.
Delete delphi dcus runtime files π{put it right on close form event}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TfrmYourForm.FormClose(Sender: TObject; var Action: TCloseAction); | |
var | |
SearchRec : TSearchRec; | |
dcuDirectory: string; | |
begin | |
try | |
dcuDirectory := ExtractFilePath(Application.ExeName); | |
FindFirst(dcuDirectory + '*.dcu', faAnyFile, SearchRec); | |
repeat | |
DeleteFile(dcuDirectory + SearchRec.name); | |
until FindNext(SearchRec) <> 0; | |
finally | |
FindClose(SearchRec); | |
end; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment