#七八年前写着玩的小东西,实际用途不大,但对刚接触nsis的新手来说应该还有一些帮助,包括创建控件,获取系统时间等,与诸位共勉!

!system '>blank set/p=MSCF<nul'

!packhdr temp.dat 'cmd /c Copy /b temp.dat /b +blank&&del blank'

SetCompressor bzip2

#编写:水晶石

#限制程序运行次数和使用日期

!include "nsdialogs.nsh"

XPStyle on

BrandingText "水晶石 ${__DATE__}"

OutFile "NSIStest.exe"

Name "test"

Page Custom page.custom

Function page.custom

  nsDialogs::Create 1018

  Pop $0

  nsDialogs::CreateControl EDIT \

    "${__NSD_Text_STYLE}|${WS_VSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN}" \

    "${__NSD_Text_EXSTYLE}" \

      0 10% 100% 80% \

    "有效运行次数:3 $\r$\n$\r$\n首次运行后第二天报错禁止使用。$\r$\n$\r$\n第$1次运行"

    Pop $0

  nsDialogs::Show

FunctionEnd

Section "test"



SectionEnd



Function .onInit

  System::Alloc 16

  System::Call "kernel32::GetLocalTime(isR0)"

  System::Call "*$R0(&i2.R1,&i2.R2,&i2.R3,&i2.R4)"

  System::Free $R0

  StrCpy $3 $R1 $R2 $R4

  ReadRegStr $2 SHCTX "Software\Microsoft\test" "time"

${if} $2 = ''

  StrCpy $2 $3

  WriteRegStr SHCTX "Software\Microsoft\test" "time" "$2"

${endif}

  IntOp $4 $2 + 1

${if} $4 <= $3

System::Call "user32::MessageBox(i $HWNDPARENT, t 'Installer integrity check has failed.\

  Common causes include $\r\

  incomplete download and damaged media.Contactthe $\r\

  installer is author to obtain a new copy.$\r$\r\

  More information at: $\r\

  https://blog.csdn.net/shuijing_0'\

  ,t 'NSIS Error', i0x10)"

  Quit

${endif}

  ReadRegStr $1 SHCTX "Software\Microsoft\test" 'Number'

  IntOp $1 $1 + 1

  WriteRegStr  SHCTX  "Software\Microsoft\test" "Number" "$1"

${if} $1 > 3

System::Call "user32::MessageBox(i $HWNDPARENT, t 'Installer integrity check has failed.\

  Common causes include $\r\

  incomplete download and damaged media.Contactthe $\r\

  installer is author to obtain a new copy.$\r$\r\

  More information at: $\r\

  https://blog.csdn.net/shuijing_0'\

  ,t 'NSIS Error', i0x10)"

  Quit

${endif}

FunctionEnd

最新文章

  1. 【MVC 4】8.SportsSore:管理
  2. POJ2186 Popular Cows(强连通分量)
  3. linux内核分析之进程地址空间管理
  4. Android图片压缩
  5. js 按元素向数组中最佳删除元素
  6. 脚本控制向Android模拟拨打电话,发送短信,定位设置功能
  7. jquery第一期:运行第一个jquery
  8. Pydev--unresolved import:解决办法
  9. MongoDB学习第七篇 --- sql和mongodb对比
  10. PHP 5.6 微信上传临时素材的坑
  11. Java 学习笔记 (一) If 语句
  12. 如何用TortoiseSVN对文件进行操作
  13. JavaScript 中repalce的使用
  14. centos6.7环境下kvm虚拟机之virt-install和virsh及virt-manager工具的使用
  15. L248 词汇题 2006
  16. 架构:Introducing Expert Systems and Distributed Architecure
  17. ajax传递参数给springmvc总结[转]
  18. 使用SAE(VAE)检测信用卡欺诈——感觉误报率还是比较高啊 70%+误报 蛋疼
  19. 2015ACM-ICPC长春E题(hdu5531)题解
  20. c++11多线程学习笔记之一 thread基础使用

热门文章

  1. 【亲测有效】Tecnomatix PDPS 软件安装及常见问题!附授权文件
  2. 沙漠世界1.0 c++小游戏
  3. DQL条件查询模糊查询和约束概述
  4. Bert不完全手册6. Bert在中文领域的尝试 Bert-WWM &amp; MacBert &amp; ChineseBert
  5. linux 判断变量是否相等方法
  6. 开发 supermall 的一些
  7. 分享一款免费OPC UA服务器
  8. 重看Java教学视频时的查漏补缺
  9. RocketMQ保姆级教程
  10. Vite + TS 项目导入 jQuery 包时报错:Could not find a declaration file