[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 DateToInt(ATime: TSystemTime): Cardinal;
begin
//Converts dates to a integer with the format YYYYMMDD,
//which is easy to understand and directly comparable
Result := ATime.wYear * 10000 + aTime.wMonth * 100 + aTime.wDay;
end;
function InitializeSetup(): Boolean;
var
LocTime: TSystemTime;
begin
GetLocalTime(LocTime);
if DateToInt(LocTime) > 20121001 then //(10/1/2012)
begin
Result := False;
MsgBox('Now it''s forbidden to install this program', mbError, MB_OK);
end;
end;
这就是我需要的吗,一个有有效期的安装程序。我添加了这段代码:它在日期过去并给出消息时工作,但在日期有效时不启动安装程序。
给出消息:InitializeSetup 返回 False;中止。得到 EAbort 异常。取消初始化设置。***设置退出代码:1
你能帮助我吗?谢谢