GetFileTime Example
Hey, Basically I need to replace a file only if its newer than the existing one. I can't find any examples using the GetFileTime function. Some help would be appreciated.
4 posts
!define LOW1 $0
!deinfe HIGH1 $1
!define LOW2 $2
!deinfe HIGH2 $3
GetFileTime ${FILENAME} ${HIGH1} ${LOW1}
GetFileTimeLocal "c:\\program files\\local file.dat" ${HIGH2} ${LOW2}
IntCmpU ${HIGH1} ${HIGH2} 0 local_is_newer user_has_newer
; compare lows
IntCmpU ${LOW1} ${LOW2} 0 local_is_newer user_has_newer
; files has the same time
Return
local_is_newer:
; user has an old file, install a newer version
File /oname=${FILENAME} "localfile.dat"
Return
user_has_newer:
; user has a newer version
MessageBox MB_OK "cheater!"