Compare file sizes
Hello. I want to add a section in my installer that would allow me to compare some file sizes to ensure the installer did its job, and newer files were copied into place. I'm trying to guard against a user not having rights, or having a file locked, and not updated.
I did some searching and I found a thread from about 2 years ago. It said I could use the following script to compare file sizes. I don't really understand how to incorporate or use this code within my own. Could someone help me out. Thanks.
outfile FileSizeNew.exe
name FileSizeNew
; FileSizeNew
;
; Script to find the size of a file.
; Much more efficient than the
; ExtensionDLL FileSize :-)
;
; by Hendri Adriaens
; HendriAdriaens@hotmail.com
section
Push "$EXEDIR\FileSizeNew.nsi"
Call FileSizeNew
Pop $0
MessageBox MB_OK "File size: $0 bytes."
sectionend
function FileSizeNew
Exch $0
Push $1
FileOpen $1 $0 "r"
FileSeek $1 0 END $0
FileClose $1
Pop $1
Exch $0
functionend