File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
tooling/bundler/src/bundle/windows/templates Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' tauri-bundler ' : ' patch:bug'
3+ ---
4+
5+ Fix incorrect estimated app size for NSIS bundler when installed to a non-empty directory.
Original file line number Diff line number Diff line change @@ -500,23 +500,31 @@ SectionEnd
500500 app_check_done:
501501!macroend
502502
503+ Var AppSize
503504Section Install
504505 SetOutPath $INSTDIR
506+ StrCpy $AppSize 0
505507
506508 !insertmacro CheckIfAppIsRunning
507509
508510 ; Copy main executable
509511 File " ${MAINBINARYSRCPATH}"
512+ ${GetSize} " $INSTDIR" " /M=${MAINBINARYNAME}.exe /S=0B" $0 $1 $2
513+ IntOp $AppSize $AppSize + $0
510514
511515 ; Copy resources
512516 {{# each resources}}
513517 CreateDirectory " $INSTDIR\\{{this.[0]}}"
514518 File /a " /oname={{this.[1]}}" " {{@key}}"
519+ ${GetSize} " $INSTDIR" " /M={{this.[1]}} /S=0B" $0 $1 $2
520+ IntOp $AppSize $AppSize + $0
515521 {{/each}}
516522
517523 ; Copy external binaries
518524 {{# each binaries}}
519525 File /a " /oname={{this}}" " {{@key}}"
526+ ${GetSize} " $INSTDIR" " /M={{this}} /S=0B" $0 $1 $2
527+ IntOp $AppSize $AppSize + $0
520528 {{/each}}
521529
522530 ; Create uninstaller
@@ -540,9 +548,9 @@ Section Install
540548 WriteRegStr SHCTX " ${UNINSTKEY}" " UninstallString" " $\" $INSTDIR\uninstall.exe$\" "
541549 WriteRegDWORD SHCTX " ${UNINSTKEY}" " NoModify" " 1"
542550 WriteRegDWORD SHCTX " ${UNINSTKEY}" " NoRepair" " 1"
543- ${GetSize} " $INSTDIR " " /S=0K " $0 $1 $2
544- IntFmt $0 " 0x%08X" $0
545- WriteRegDWORD SHCTX " ${UNINSTKEY}" " EstimatedSize" " $0 "
551+ IntOp $AppSize $AppSize / 1000
552+ IntFmt $AppSize " 0x%08X" $AppSize
553+ WriteRegDWORD SHCTX " ${UNINSTKEY}" " EstimatedSize" " $AppSize "
546554
547555 ; Create start menu shortcut (GUI)
548556 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
You can’t perform that action at this time.
0 commit comments