杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2228|回复: 0

Inno Steup 程序保质期

[复制链接]
发表于 2017-2-26 14:16:36 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. [Setup]
  2. AppName=DateTimeStop
  3. AppVerName=DateTimeStop
  4. Uninstallable=false
  5. UpdateUninstallLogAppName=false
  6. DisableDirPage=true
  7. DisableProgramGroupPage=true
  8. DefaultDirName={pf}\DateTimeStop
  9. DisableStartupPrompt=true

  10. [_ISTool]
  11. EnableISX=true


  12. [Code]|
  13. type
  14.   TSystemTime = record
  15.     wYear : Word;
  16.     wMonth : Word;
  17.     wDayOfWeek : Word;
  18.     wDay : Word;
  19.     wHour : Word;
  20.     wMinute : Word;
  21.     wSecond : Word;
  22.     wMilliseconds : Word;
  23.   end;


  24. procedure GetLocalTime(var lpSystemTime: TSystemTime); external
  25. 'GetLocalTime@kernel32.dll';

  26. //
  27. // compare dt1 and dt2, return false id dt1 is lower than dt2
  28. // thanks to Bruno Gellweiler that provide a working function :)


  29. function IsOKDateTime( dt1, dt2: TSystemTime ) : Boolean;
  30. begin
  31.     Result := true;
  32.     if dt2.wYear < dt1.wYear then
  33.         result := false
  34.     else if dt2.wYear = dt1.wYear then
  35.         if dt2.wMonth < dt1.wMonth then
  36.             result := false
  37.         else if dt2.wMonth = dt1.wMonth then
  38.             if dt2.wDay < dt1.wDay then
  39.                 result := false ;
  40. end;

  41. function InitializeSetup: Boolean;
  42. var
  43.   lt, datelimit: TSystemTime;
  44.   s, crlf: string;

  45. begin

  46.   crlf := #13#10;

  47.   // 超过2003.05.01之后,该程序禁止安装
  48.   datelimit.wYear := 2003;
  49.   datelimit.wMonth := 5;
  50.   datelimit.wDay := 1;

  51.   GetLocalTime(lt);

  52.   Result := IsOKDateTime( lt, datelimit );

  53.   s := '该程序保质期已过,不允许安装';

  54.   if not Result then
  55.    // just to show datetime infos
  56.    MsgBox( s , mbError, MB_OK );

  57. end;
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-12 12:07 , Processed in 0.108445 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表