NSIS: automatically compute install size
This commit is contained in:
parent
2cbe12a662
commit
c0c3afe170
@ -4,8 +4,6 @@
|
|||||||
!define VERSION 2.5.1946
|
!define VERSION 2.5.1946
|
||||||
!define API sdl
|
!define API sdl
|
||||||
|
|
||||||
!define INSTALLSIZE 10072
|
|
||||||
|
|
||||||
!define FREETYPEDLL libfreetype-6.dll
|
!define FREETYPEDLL libfreetype-6.dll
|
||||||
!define JPEGDLL libjpeg-9.dll
|
!define JPEGDLL libjpeg-9.dll
|
||||||
!define PNGDLL libpng16-16.dll
|
!define PNGDLL libpng16-16.dll
|
||||||
@ -85,6 +83,13 @@ FunctionEnd
|
|||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Installer Sections
|
;Installer Sections
|
||||||
|
|
||||||
|
Section "Desktop shortcut" SecShortcut
|
||||||
|
|
||||||
|
SetOutPath "$INSTDIR"
|
||||||
|
CreateShortCut "$DESKTOP\Grafx2-${API}.lnk" "$INSTDIR\bin\grafx2-${API}.exe" "" "" "" SW_SHOWNORMAL
|
||||||
|
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
Section "Grafx2" SecProgram
|
Section "Grafx2" SecProgram
|
||||||
SectionIn RO
|
SectionIn RO
|
||||||
SetOutPath "$INSTDIR"
|
SetOutPath "$INSTDIR"
|
||||||
@ -148,8 +153,13 @@ Section "Grafx2" SecProgram
|
|||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
|
||||||
"NoRepair" 1
|
"NoRepair" 1
|
||||||
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
|
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
|
||||||
|
SectionGetSize ${SecProgram} $0
|
||||||
|
${If} ${SectionIsSelected} ${SecShortcut}
|
||||||
|
SectionGetSize ${SecShortcut} $1
|
||||||
|
IntOp $0 $0 + $1
|
||||||
|
${EndIf}
|
||||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-${API}" \
|
||||||
"EstimatedSize" ${INSTALLSIZE}
|
"EstimatedSize" $0
|
||||||
|
|
||||||
;Store installation folder
|
;Store installation folder
|
||||||
WriteRegStr HKLM "Software\Grafx2" "" $INSTDIR
|
WriteRegStr HKLM "Software\Grafx2" "" $INSTDIR
|
||||||
@ -159,13 +169,6 @@ Section "Grafx2" SecProgram
|
|||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "Desktop shortcut" SecShortcut
|
|
||||||
|
|
||||||
SetOutPath "$INSTDIR"
|
|
||||||
CreateShortCut "$DESKTOP\Grafx2-${API}.lnk" "$INSTDIR\bin\grafx2-${API}.exe" "" "" "" SW_SHOWNORMAL
|
|
||||||
|
|
||||||
SectionEnd
|
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Descriptions
|
;Descriptions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user