alfonser Нуда такой пример есть в
Inno Setup Extensions Knowledge Base [more]
;
[Setup]
AppName=DateTimeStop
AppVerName=DateTimeStop
Uninstallable=false
UpdateUninstallLogAppName=false
DisableDirPage=true
DisableProgramGroupPage=true
DefaultDirName={pf}\DateTimeStop
DisableStartupPrompt=true
[_ISTool]
EnableISX=true
[_Code]
type
TSystemTime = record
wYear : Word;
wMonth : Word;
wDayOfWeek : Word;
wDay : Word;
wHour : Word;
wMinute : Word;
wSecond : Word;
wMilliseconds : Word;
end;
procedure GetLocalTime(var lpSystemTime: TSystemTime); external
'GetLocalTime@kernel32.dll';
//
// compare dt1 and dt2, return false id dt1 is lower than dt2
// thanks to Bruno Gellweiler that provide a working function
function IsOKDateTime( dt1, dt2: TSystemTime ) : Boolean;
begin
Result := true;
if dt2.wYear < dt1.wYear then
result := false
else if dt2.wYear = dt1.wYear then
if dt2.wMonth < dt1.wMonth then
result := false
else if dt2.wMonth = dt1.wMonth then
if dt2.wDay < dt1.wDay then
result := false ;
end;
function InitializeSetup: Boolean;
var
lt, datelimit: TSystemTime;
s, crlf: string;
begin
crlf := #13#10;
// let's say it is not allowed to install after 1 May 2003
datelimit.wYear := 2008;
datelimit.wMonth := 6;
datelimit.wDay := 10;
GetLocalTime(lt);
Result := IsOKDateTime( lt, datelimit );
s := 'Install time limit, it is not possible to install this program.';
if not Result then
// just to show datetime infos
MsgBox( s , mbError, MB_OK );
end;
[/more]