const
GetFileExInfoStandard = $0;
type
FILETIME = record
LowDateTime: DWORD;
HighDateTime: DWORD;
end;
WIN32_FILE_ATTRIBUTE_DATA = record
FileAttributes: DWORD;
CreationTime: FILETIME;
LastAccessTime: FILETIME;
LastWriteTime: FILETIME;
FileSizeHigh: DWORD;
FileSizeLow: DWORD;
end;
SYSTEMTIME = record
Year: WORD;
Month: WORD;
DayOfWeek: WORD;
Day: WORD;
Hour: WORD;
Minute: WORD;
Second: WORD;
Milliseconds: WORD;
end;
function GetFileAttributesEx (
FileName: string;
InfoLevelId: DWORD;
var FileInformation: WIN32_FILE_ATTRIBUTE_DATA
): Boolean;
external '[email protected] stdcall';
function FileTimeToSystemTime(
FileTime: FILETIME;
var SystemTime: SYSTEMTIME
): Boolean;
external '[email protected] stdcall';
procedure InitializeWizard();
var
FileInformation: WIN32_FILE_ATTRIBUTE_DATA;
SystemInfo: SYSTEMTIME;
begin
GetFileAttributesEx('C:\Users\Gangadhar\Desktop\white_plain.gif', GetFileExInfoStandard , FileInformation);
FileTimeToSystemTime(FileInformation.LastWriteTime, SystemInfo);
MsgBox(format('%2.2d-%2.2d-%4.4d', [SystemInfo.Day, SystemInfo.Month, SystemInfo.Year]), mbInformation, MB_OK);
end;
I am using Inno setup to create custom installers, I need this to add some thing to my installer. By this code I can able to find the last modified date of the file , but I want to give the file name as input while running the setup. see here
GetFileAttributesEx('C:\Users\Gangadhar\Desktop\white_plain.gif', GetFileExInfoStandard , FileInformation);
in this function I was passed filename as a parameter.i want to select this filename while running the setup , as like select destination folder wizard and then pass that selected filename as parameter to the above function.
any help would be appreciated. Thanks in advance