Skip to content

Commit

Permalink
fix(AppImage): do not pack into archive, add .AppImage suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Jul 7, 2016
1 parent 56b3450 commit f59c7bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"cli-cursor": "^1.0.2",
"debug": "^2.2.0",
"electron-osx-sign": "^0.4.0-beta4",
"electron-packager-tf": "~7.5.2",
"electron-winstaller-fixed": "~2.11.6",
"electron-packager-tf": "~7.5.3",
"electron-winstaller-fixed": "~2.11.7",
"fs-extra-p": "^1.0.5",
"hosted-git-info": "^2.1.5",
"image-size": "^0.5.0",
Expand Down Expand Up @@ -141,5 +141,8 @@
"release": {
"verifyConditions": []
},
"typings": "./out/electron-builder.d.ts"
"typings": "./out/electron-builder.d.ts",
"publishConfig": {
"tag": "next"
}
}
4 changes: 0 additions & 4 deletions src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ export default class MacPackager extends PlatformPackager<MacOptions> {

private async sign(appOutDir: string, masOptions: MasBuildOptions | null): Promise<void> {
let keychainName = (await this.codeSigningInfo).keychainName
if (process.env.CSC_LINK != null) {
throw new Error("keychainName is null, but CSC_LINK defined")
}

const masQualifier = masOptions == null ? null : (masOptions.identity || this.platformSpecificBuildOptions.identity)

let name = await findIdentity(masOptions == null ? "Developer ID Application" : "3rd Party Mac Developer Application", masOptions == null ? this.platformSpecificBuildOptions.identity : masQualifier, keychainName)
Expand Down
13 changes: 3 additions & 10 deletions src/targets/appImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class AppImageTarget extends TargetEx {
async build(appOutDir: string, arch: Arch): Promise<any> {
const packager = this.packager

const image = path.join(this.outDir, packager.generateName(null, arch, true))
const image = path.join(this.outDir, packager.generateName("AppImage", arch, false))
const appInfo = packager.appInfo
await unlinkIfExists(image)

Expand All @@ -52,7 +52,7 @@ export default class AppImageTarget extends TargetEx {
args.push("-map", this.helper.maxIconPath, "/.DirIcon")

args.push("-chown_r", "0", "/", "--")
args.push("-zisofs", `level=0:block_size=128k:by_magic=off`)
args.push("-zisofs", `level=${packager.devMetadata.build.compression === "store" ? "0" : "9"}:block_size=128k:by_magic=off`)
args.push("set_filter_r", "--zisofs", "/")

await exec(process.platform === "darwin" ? path.join(appImagePath, "xorriso") : "xorriso", args)
Expand All @@ -76,14 +76,7 @@ export default class AppImageTarget extends TargetEx {
}

await chmod(image, "0755")
// we archive because you cannot distribute exe as is - e.g. Ubuntu clear exec flag and user cannot just click on AppImage to run
// also, LZMA compression - 29MB vs zip 42MB
// we use slow xz instead of 7za because 7za doesn't preserve exec file permissions for xz
await spawn("xz", ["--x86", "--lzma2", "--compress", "--force", packager.devMetadata.build.compression === "store" ? "-0" : "-9e", image], {
cwd: path.dirname(image),
stdio: ["ignore", debug.enabled ? "inherit" : "ignore", "inherit"],
})

packager.dispatchArtifactCreated(`${image}.xz`)
packager.dispatchArtifactCreated(image, packager.generateName("AppImage", arch, true))
}
}

0 comments on commit f59c7bd

Please sign in to comment.