Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
nsis GetTime安装日期存储在Windows注册表中_Nsis - Fatal编程技术网

nsis GetTime安装日期存储在Windows注册表中

nsis GetTime安装日期存储在Windows注册表中,nsis,Nsis,NSIS 当我安装程序时 安装日期存储在Windows注册表中 Section ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 ; $0="01" day ; $1="04" month ; $2="2006" year ; $3="Friday" day of week name ; $4="16" hour ; $5="05" minute ; $6="50" seconds WriteRegStr HKLM "Software\MyApp" "year" "

NSIS

当我安装程序时 安装日期存储在Windows注册表中

Section
${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6
; $0="01" day
; $1="04" month
; $2="2006" year
; $3="Friday" day of week name
; $4="16" hour
; $5="05" minute
; $6="50" seconds

WriteRegStr HKLM "Software\MyApp" "year" "$2"
WriteRegStr HKLM "Software\MyApp" "month" "$1"
WriteRegStr HKLM "Software\MyApp" "day" "$0"

${EndIf}

SectionEnd
我不知道如何运行以下命令:

在消息plz更新30天后,从注册表>计算>继续读取

当您保存要读取的文件时,程序将从上次记录的警告开始运行1个月

你能帮我查一下示例代码吗

对不起,我的英语很差

请帮帮我,我是业余爱好者


非常感谢…

。对于测试,请将${WFT_DAY}*30更改为${WFT_SEC}*30,并等待30秒,然后再次运行,等待时间到期。感谢亲爱的Anders,我也更改了测试。唯一的区别是,它运行了很多次,还是让我先说一下,在安装了nsis Windows注册表创建的文件后,我会在每次Windows启动时运行该文件。如果Windows注册表中已存储的日期与安装程序在比较前几天的安装日期时运行该文件,我会准确地进行第一次安装?在30天的时间里,我们将更新信息与感谢相比较……很难理解你到底想做什么。我发布的代码将允许您检测30天是否已经过去,如果您需要其他方面的帮助,您需要进一步解释(编辑您的问题)GetTime需要
!包括FileFunc.nsh
。InstallDate是您需要保存的注册表项<代码>WriteRegStr HKLM“软件\MyApp”“安装日期”“$2$1$0”
!include LogicLib.nsh

#support.microsoft.com/kb/188768
!define WFT_SEC 10000000
!define WFT_DAY 864000000000

var /GLOBAL installTime
var /GLOBAL expiredTime
var /GLOBAL currentTime

System::Call kernel32::GetSystemTimeAsFileTime(*l.s)
System::Call kernel32::FileTimeToLocalFileTime(*ls,*l.s)
Pop $currentTime

ReadRegStr $installTime HKCU "Software\MyCompany\MyApp" "InstallTime"
${If} $installTime = 0
    StrCpy $installTime $currentTime
    WriteRegStr HKCU "Software\MyCompany\MyApp" "InstallTime" $installTime
${EndIf}

System::Int64Op ${WFT_DAY} * 30 ; You could calculate this with calc.exe if it is always 30 days
Pop $0
System::Int64Op $installTime + $0
Pop $expiredTime


DetailPrint $$currentTime=$currentTime
DetailPrint $$installTime=$installTime
DetailPrint $$expiredTime=$expiredTime
System::Int64Op $currentTime > $expiredTime
Pop $0
DetailPrint "30 days after $$installTime: $0"