Installation Nsis安装程序获取文件大小

Installation Nsis安装程序获取文件大小,installation,nsis,Installation,Nsis,我正在使用NSIS安装程序。 我想解压文件,但在此之前,我不想知道它的大小。 可能吗? 谢谢 基本上,您可以使用FileSeek从末尾获取第0个字节的位置 FileOpen $0 somefile.txt r ;open somefile in read mode FileSeek $0 0 END $1 ;ask for the 0th byte from the end, and put the value in $1 FileClose $0 ;here you h

我正在使用NSIS安装程序。 我想解压文件,但在此之前,我不想知道它的大小。 可能吗?
谢谢

基本上,您可以使用
FileSeek
从末尾获取第0个字节的位置

FileOpen $0 somefile.txt r    ;open somefile in read mode
FileSeek $0 0 END $1          ;ask for the 0th byte from the end, and put the value in $1
FileClose $0
;here you have the size in $1
这是以一种更方便的方式使用的,即在中保留获取文件名的变量,并通过堆栈返回结果。

您可以使用宏,它与NSIS一起预装