Karbid87
[more=После определённой даты]
Код: [Setup]
AppName=Gradient
AppVerName=Gradient
CreateAppDir=false
[_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';
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 NextButtonClick(CurPageID: Integer): Boolean;
var
lt, datelimit: TSystemTime;
s, crlf: string;
begin
if CurPageID=wpWelcome then begin
datelimit.wYear := 2011;
datelimit.wMonth := 09;
datelimit.wDay := 21;
GetLocalTime(lt);
Result := IsOKDateTime( lt, datelimit );
s := 'Install time limit, it is not possible to install this program.';
if not Result then MsgBox( s , mbError, MB_OK );
end;
end;
[more=После определённой даты]
Код: [Setup]
AppName=Gradient
AppVerName=Gradient
CreateAppDir=false
[_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';
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 NextButtonClick(CurPageID: Integer): Boolean;
var
lt, datelimit: TSystemTime;
s, crlf: string;
begin
if CurPageID=wpWelcome then begin
datelimit.wYear := 2011;
datelimit.wMonth := 09;
datelimit.wDay := 21;
GetLocalTime(lt);
Result := IsOKDateTime( lt, datelimit );
s := 'Install time limit, it is not possible to install this program.';
if not Result then MsgBox( s , mbError, MB_OK );
end;
end;