indy31
3rd January 2012 09:54 UTC
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
3rd January 2012 18:27 UTC
http://forums.winamp.com/showthread.php?t=320859
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
indy31
5th January 2012 13:42 UTC
Thanks.
So there is no easy way to get to the info.
Afrow UK
5th January 2012 15:17 UTC
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