-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Problem
Currently, there's no way to disable blockmap (.zip.blockmap) file generation for macOS ZIP targets, even though this option exists for DMG targets via dmg.writeUpdateInfo: false. Blockmap generation can be time-consuming for large applications, and users should have the option to disable it.
Use Case
I need to build both .pkg and .zip files for macOS (zip is required for auto-update), but I want to skip the .zip.blockmap file generation to speed up the build process. The blockmap is used for differential updates, but if build time is more important than update efficiency, users should be able to opt out.
Current Behavior
- ZIP files always generate
.zip.blockmapfiles on macOS - DMG files support
dmg.writeUpdateInfo: falseto disable blockmap - No equivalent option exists for ZIP files
Desired Behavior
Add support for zip.writeUpdateInfo: false configuration option, similar to how dmg.writeUpdateInfo works.
Code References
-
DMG implementation (works correctly):
packages/dmg-builder/src/dmg.ts:97- Checksthis.options.writeUpdateInfo === falsepackages/app-builder-lib/src/options/macOptions.ts:315-DmgOptionsinterface includeswriteUpdateInfo?: boolean
-
ZIP implementation (missing the option):
packages/app-builder-lib/src/targets/ArchiveTarget.ts:73- Only checksthis.isWriteUpdateInfo(constructor parameter)packages/app-builder-lib/src/macPackager.ts:121- HardcodesisWriteUpdateInfo = truewhen creating zip targetArchiveTargetreads options from(this.packager.config as any)[this.name]but doesn't check forwriteUpdateInfo
Suggested Solution
Modify ArchiveTarget.ts to check for writeUpdateInfo option from config, similar to how DmgTarget does it:
script
// In ArchiveTarget.ts build() method
const shouldWriteUpdateInfo = this.options.writeUpdateInfo === false ? false : this.isWriteUpdateInfo
if (shouldWriteUpdateInfo && format === "zip") {
// ... create blockmap
}This would allow users to configure:
son
{
"build": {
"mac": {
"target": ["pkg", "zip"],
"zip": {
"writeUpdateInfo": false
}
}
}
}
Additional Notes
- This should maintain backward compatibility (default behavior unchanged)
- The
.zipfile itself would still be generated (required for auto-update) - Only the
.zip.blockmapfile generation would be skipped - This matches the existing pattern used for DMG targets