Try the SysUtils.FileSetDate function from the SysUtils block, which internally calls the SetFileTime WinApi function.
this function has two versions
function FileSetDate(const FileName: string; Age: Integer): Integer; function FileSetDate(Handle: THandle; Age: Integer): Integer;
The Age parameter is the installation time. To convert a TDateTime value to a Windows timestamp.
Like this
FileSetDate(FileName, DateTimeToFileDate(Now));
source share