mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-17 11:50:26 +03:00
enhance(nsis): include uninstaller size in estimated size (#10137)
This commit is contained in:
parent
e93ca1df3b
commit
77d44215ef
@ -673,17 +673,17 @@ fn generate_estimated_size(
|
||||
main: &PathBuf,
|
||||
binaries: &BinariesMap,
|
||||
resources: &ResourcesMap,
|
||||
) -> crate::Result<String> {
|
||||
) -> crate::Result<u64> {
|
||||
let mut size = 0;
|
||||
for k in std::iter::once(main)
|
||||
.chain(binaries.keys())
|
||||
.chain(resources.keys())
|
||||
{
|
||||
size += std::fs::metadata(k)
|
||||
.with_context(|| format!("when getting size of {}", main.display()))?
|
||||
.with_context(|| format!("when getting size of {}", k.display()))?
|
||||
.len();
|
||||
}
|
||||
Ok(format!("{:#08x}", size / 1024))
|
||||
Ok(size / 1024)
|
||||
}
|
||||
|
||||
fn get_lang_data(lang: &str) -> Option<(String, &[u8])> {
|
||||
|
@ -614,7 +614,12 @@ Section Install
|
||||
WriteRegStr SHCTX "${UNINSTKEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||
WriteRegDWORD SHCTX "${UNINSTKEY}" "NoModify" "1"
|
||||
WriteRegDWORD SHCTX "${UNINSTKEY}" "NoRepair" "1"
|
||||
WriteRegDWORD SHCTX "${UNINSTKEY}" "EstimatedSize" "${ESTIMATEDSIZE}"
|
||||
|
||||
${GetSize} "$INSTDIR" "/M=uninstall.exe /S=0K /G=0" $0 $1 $2
|
||||
IntOp $0 $0 + ${ESTIMATEDSIZE}
|
||||
IntFmt $0 "0x%08X" $0
|
||||
WriteRegDWORD SHCTX "${UNINSTKEY}" "EstimatedSize" "$0"
|
||||
|
||||
!if "${HOMEPAGE}" != ""
|
||||
WriteRegStr SHCTX "${UNINSTKEY}" "URLInfoAbout" "${HOMEPAGE}"
|
||||
WriteRegStr SHCTX "${UNINSTKEY}" "URLUpdateInfo" "${HOMEPAGE}"
|
||||
|
Loading…
Reference in New Issue
Block a user