KurtWagner
Junior Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Почему этот скрипт не работает! Срабатывает только если стоит 2007 год а если поставить 2008 не запускаеться вообше! [Setup] AppName=DateTimeStop AppVerName=DateTimeStop Uninstallable=false UpdateUninstallLogAppName=false DisableDirPage=true DisableProgramGroupPage=true DefaultDirName={pf}\DateTimeStop DisableStartupPrompt=true OutputDir=. [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" [Messages] BeveledLabel=- "DateTimeStop" Copyright (c) K.W.N. [_ISToolPreCompile] #dim M[64] ;Add language files (Messages, License, InfoBefore, InfoAfter) #define TimeLimit '2007:12:31' [Code] type TSystemTime = record wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds: word; end; procedure GetLocalTime(var lpSystemTime: TSystemTime); external 'GetLocalTime@kernel32 stdcall delayload'; function SystemTimeToFileTime(const lpTime: TSystemTime; var lpFileTime: TFileTime): Boolean; external 'SystemTimeToFileTime@kernel32 stdcall delayload'; function CompareFileTime(const lpFileTime1, lpFileTime2: TFileTime): LongInt; external 'CompareFileTime@kernel32 stdcall delayload'; #ifdef TimeLimit Function TimeLimit: Boolean; var lt, dateLimit: TSystemTime; LocalTime, LimitTime: TFileTime; Begin #for {M[0] = 59; Pos(':', TimeLimit); M[0]++} M[M[0]] = Int(Copy(TimeLimit,,Pos(':', TimeLimit)-1)), TimeLimit = Copy(TimeLimit,Pos(':', TimeLimit)+1) #expr M[M[0]] = TimeLimit dateLimit.wYear:= {#Int(M[59])}; dateLimit.wMonth:= {#Int(M[60])}; dateLimit.wDay:= {#Int(M[61])}; dateLimit.wHour:= {#Int(M[62])}; dateLimit.wMinute:= {#Int(M[63])}; GetLocalTime(lt); SystemTimeToFileTime(lt, LocalTime); SystemTimeToFileTime(dateLimit, LimitTime) Result:= not(CompareFileTime(LimitTime, LocalTime) = -1) End; #endif function InitializeSetup: Boolean; begin if not TimeLimit then MsgBox('Внимание! Вы исчерпали лимит времени.', mbError, MB_OK) end; |