View Single Post
Old 13th June 2019, 15:34   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,148
for <= 4GiB files:
Quote:
StrCpy $1 ""
FileOpen $9 "D:\VMWARE\Disk.vhd" r
StrCmp $9 "" +3
FileSeek $9 0 END $1
FileClose $9
IntFmt $1 "%u" $1
DetailPrint $1
64-bit limit:
Quote:
!include LogicLib.nsh
StrCpy $1 -1
FileOpen $9 "D:\VMWARE\Disk.vhd" r
StrCmp $9 "" +3
System::Call 'KERNEL32::GetFileSize(p$9,*i.r2)i.r1'
FileClose $9
${If} $1 = -1
DetailPrint Failed
${Else}
IntFmt $2 "%#x00000000" $2
System::Int64Op $2 | $1
Pop $1
DetailPrint $1
${EndIf}

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote