Skip to content

Add support for disabling blockmap generation for macOS ZIP files via zip.writeUpdateInfo option #9479

@iamghous

Description

@iamghous

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.blockmap files on macOS
  • DMG files support dmg.writeUpdateInfo: false to 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

  1. DMG implementation (works correctly):

    • packages/dmg-builder/src/dmg.ts:97 - Checks this.options.writeUpdateInfo === false
    • packages/app-builder-lib/src/options/macOptions.ts:315 - DmgOptions interface includes writeUpdateInfo?: boolean
  2. ZIP implementation (missing the option):

    • packages/app-builder-lib/src/targets/ArchiveTarget.ts:73 - Only checks this.isWriteUpdateInfo (constructor parameter)
    • packages/app-builder-lib/src/macPackager.ts:121 - Hardcodes isWriteUpdateInfo = true when creating zip target
    • ArchiveTarget reads options from (this.packager.config as any)[this.name] but doesn't check for writeUpdateInfo

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 .zip file itself would still be generated (required for auto-update)
  • Only the .zip.blockmap file generation would be skipped
  • This matches the existing pattern used for DMG targets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions