Skip to content
⌘ NSIS Forum Archive

How to use calculated size from Directory Page?

4 posts

indy31#

How to use calculated size from Directory Page?

The Modern Interface Directory Page (MUI_PAGE_DIRECTORY) shows the 'Space required' for the total installation. Is there an easy way to get access to this value?

I want to store this value in the Uninstaller registry key EstimatedSize.

Now I'm doing:
!include "FileFunc.nsh"

# Add package size information to Uninstaller registry.
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
WriteRegDWORD HKLM "${UninstallRegKey}" "EstimatedSize" "$0"

But seeing the value ready computed makes me wonder if there is an easier way to get to this info.
Afrow UK#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


I think reading the values from the label might be better though but I don't think anyone has written code for that (maybe I will).

Stu
Afrow UK#
See attached. GetSpaceRequired gets the space required and space available values from either the components page (required only) or the directory page (both required and available values). It should only be used in the page leave functions. It should also work for different languages.

Stu