Some parts of the script:
As you can see I've tried to use PAGE_CUSTOMFUNCTION_PRE on PAGE_DIRECTORY, and indeed the function CheckExistingSar updates the size of the CommonInstall section succesfully if it can find arc.sar. Only the 'Space required' value does not change, and the CheckExistingSar function is in fact called only once. Entering a different install path does not call the function again.
!insertmacro MUI_PAGE_COMPONENTS
;Custom page: asks where to find arc.sar
Page custom GetSarLocation CheckSarLocation
;Find arc.sar in $INSTDIR and substract filesize
!define MUI_PAGE_CUSTOMFUNCTION_PRE CheckExistingSar
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Function CheckExistingSar
IfFileExists "$INSTDIR\arc.sar" 0 NoExistingSar
Push "$INSTDIR\arc.sar"
Call FileSizeNew
Pop $EXISTING_SAR_SIZE
IntOp $EXISTING_SAR_SIZE $EXISTING_SAR_SIZE % -1000
SectionGetSize CommonInstall $2
IntOp $2 $2 - EXISTING_SAR_SIZE
SectionSetSize CommonInstall $2
NoExistingSar:
FunctionEnd
I've read some hints about using FindWindow etc commands to manually influence the label, but I have no clue how to go about this. Any help would be greatly appreciated.