[Setup] ;Название программы - инсталлятора, а также заголовок инсталлятора, (пожеланию можно версию указать): AppName=about.button ;Версия программы - инсталлятора, (пожеланию можно указать - название + версию): AppVerName=about.button ;Директория установки для программы - инсталлятора: DefaultDirName={pf}\about.button ;Название выходного файла компилятора: OutputBaseFilename=about.button.by.nightw0lf [Code] type TFileTime = record lowdatatime: longint; highdatatime: longint; end; TSystemTime = record wYear: Word; wMonth: Word; wDayOfWeek: Word; wDay: Word; wHour: Word; wMinute: Word; wSecond: Word; wMilliseconds: Word; end; const MB_ICONINFORMATION = $40; MB_ICONEXCLAMATION = $30; MB_ICONQUESTION = $20; MB_ICONSTOP = $10; MB_ICONNONE = $0; function MessageBox(hWnd: Integer; lpText, lpCaption: string; uType: Cardinal): Integer; external 'MessageBoxA@user32.dll stdcall'; function GetFileTime(hfile: longint; var lpcreation, lpaccess, lpwrite: TFileTime): boolean; external 'GetFileTime@kernel32.dll stdcall'; function FileTimeToSystemTime(var tftm: TFileTime; var systm: TSystemTime): boolean; external 'FileTimeToSystemTime@kernel32.dll stdcall'; function FileTimeToLocalFileTime(utct: TFileTime; var loct: TFileTime): boolean; external 'FileTimeToLocalFileTime@kernel32.dll stdcall'; function GetDateFormat(Locale: Integer; dwFlags: LongInt; var lpDate: TSystemTime; lpFormat: PChar; lpDateStr: string; cchDate: Integer): Integer; external 'GetDateFormatA@kernel32.dll'; function GetTimeFormat(Locale: Integer; dwFlags: LongInt; var lpTime: TSystemTime; lpFormat: PChar; lpTimeStr: string; cchDate: Integer): Integer; external 'GetTimeFormatA@kernel32.dll'; var strFile: string; strCreTime: string; strModTime: string; strAccessTime: string; function FormattedTime(t: TSystemTime): string; var s, fmt: string; begin fmt := StringOfChar(' ', 64); GetDateFormat(0, 0, t, 'yyyy-MM-dd', fmt, 63); fmt := CastIntegerToString(CastStringToInteger(fmt)); s := ' -- built on ' + fmt; fmt := StringOfChar(' ', 64); GetTimeFormat(0, 0, t, 'hh:mm:ss tt', fmt, 63); fmt := CastIntegerToString(CastStringToInteger(fmt)); s := s + ' at ' + fmt; Result := s; end; function GetFileSysTime(nomef: string; var stime: string; idx: Integer): TSystemTime; var fs: TFileStream; risul: TSystemTime; creat, access, write, local: TFileTime; begin fs := TFileStream.Create(nomef, fmOpenRead); GetFileTime(fs.handle, creat, access, write); fs.Free; case idx of 1: FileTimeToLocalFileTime(creat, local); 2: FileTimeToLocalFileTime(access, local); 3: FileTimeToLocalFileTime(write, local); end; FileTimeToSystemTime(local, risul); stime := FormattedTime(risul); Result := risul; end; procedure AboutButtonOnClick(Sender: TObject); var hWnd: Integer; begin hWnd := StrToInt(ExpandConstant('{wizardhwnd}')); MessageBox(hWnd, '' + + #13 'Released: '+strCreTime, 'Инфо', MB_OK or $40); end; procedure InitializeWizard(); var Width, Height, I: Integer; AboutButton, CancelButton: TButton; filename, s: string; t: TSystemTime; begin filename := ExpandConstant('{srcexe}'); strFile := filename; t := GetFileSysTime(filename, s, 1); strCreTime := s; t := GetFileSysTime(filename, s, 2); strAccessTime := s; t := GetFileSysTime(filename, s, 3); strModTime := s; CancelButton := WizardForm.CancelButton; AboutButton := TButton.Create(WizardForm); AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width; AboutButton.Top := CancelButton.Top; AboutButton.Width := CancelButton.Width; AboutButton.Height := CancelButton.Height; AboutButton.Caption := 'About'; AboutButton.ShowHint := True AboutButton.Hint := 'О программе' AboutButton.OnClick := @AboutButtonOnClick; AboutButton.Parent := WizardForm; AboutButton.Cursor := crHand; AboutButton.Font.Style := AboutButton.Font.Style + [fsUnderline]; end; |