Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/targets/ArchiveTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class ArchiveTarget extends Target {

if (this.isWriteUpdateInfo && format === "zip") {
if (isMac) {
updateInfo = await createBlockmap(artifactPath, this, packager, artifactName)
updateInfo = await createBlockmap(artifactPath, this, packager, artifactName, arch)
} else {
updateInfo = await appendBlockmap(artifactPath)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { log } from "builder-util"
import { Arch, log } from "builder-util"
import { BlockMapDataHolder, PackageFileInfo } from "builder-util-runtime"
import * as path from "path"
import { Target } from "../core"
Expand Down Expand Up @@ -67,15 +67,21 @@ export async function appendBlockmap(file: string): Promise<BlockMapDataHolder>
return await executeAppBuilderAsJson<BlockMapDataHolder>(["blockmap", "--input", file, "--compression", "deflate"])
}

export async function createBlockmap(file: string, target: Target, packager: PlatformPackager<any>, safeArtifactName: string | null): Promise<BlockMapDataHolder> {
export async function createBlockmap(
file: string,
target: Target,
packager: PlatformPackager<any>,
safeArtifactName: string | null,
arch: Arch | null = null
): Promise<BlockMapDataHolder> {
const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`
log.info({ blockMapFile: log.filePath(blockMapFile) }, "building block map")
const updateInfo = await executeAppBuilderAsJson<BlockMapDataHolder>(["blockmap", "--input", file, "--output", blockMapFile])
await packager.info.emitArtifactBuildCompleted({
file: blockMapFile,
safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,
target,
arch: null,
arch,
packager,
updateInfo,
})
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export class NsisTarget extends Target {
if (this.isWebInstaller) {
updateInfo = createNsisWebDifferentialUpdateInfo(installerPath, packageFiles)
} else if (this.isBuildDifferentialAware) {
updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName)
updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName, primaryArch)
}

if (updateInfo != null && isPerMachine && (oneClick || options.packElevateHelper)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/dmg-builder/src/dmg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class DmgTarget extends Target {
}

const safeArtifactName = packager.computeSafeArtifactName(artifactName, "dmg")
const updateInfo = this.options.writeUpdateInfo === false ? null : await createBlockmap(artifactPath, this, packager, safeArtifactName)
const updateInfo = this.options.writeUpdateInfo === false ? null : await createBlockmap(artifactPath, this, packager, safeArtifactName, arch)
await packager.info.emitArtifactBuildCompleted({
file: artifactPath,
safeArtifactName,
Expand Down
Loading