Old 10th January 2021, 11:41   #1
zamrate
Junior Member
 
Join Date: Jan 2021
Posts: 2
Getting size of file which is part of installer

How can one get the size of a file which is part of the NSIS installer, without using GetSectionSize() ? So let's say for example my installer would contain 2 files called "myApp.exe" (100 000 bytes) and "myPicture.png" (5000 bytes), I would like to be able to do something like GetFileSize("myApp.exe") and get 100 000 as result (which would be the amount of space the file would use if being on disk in the installation folder).
This seems like a really simple thing, yet I couldn't find how to do it. I don't want to store the file to disk for being able to determine the size.
zamrate is offline   Reply With Quote
Old 10th January 2021, 12:14   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
Put the file alone in a hidden unchecked section.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th January 2021, 17:43   #3
zamrate
Junior Member
 
Join Date: Jan 2021
Posts: 2
OK that worked. Thanks
zamrate is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
file, size

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump