Skip to content

Commit 159446b

Browse files
committed
fix(AppImage): use app name as a executable name
1 parent 0b0ed62 commit 159446b

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ install:
2828
- nvm install $NODE_VERSION
2929
- nvm use --delete-prefix $NODE_VERSION
3030
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$NODE_VERSION" == "4" ]]; then npm install npm -g ; fi
31-
- npm install --registry http://registry.npmjs.eu
31+
- npm install
3232
- npm prune
3333

3434
script:

src/targets/appImage.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class AppImageTarget extends TargetEx {
3939
"-map", appOutDir, "/usr/bin",
4040
"-map", path.join(__dirname, "..", "..", "templates", "linux", "AppRun.sh"), `/AppRun`,
4141
"-map", await this.desktopEntry, `/${appInfo.name}.desktop`,
42-
"-move", `/usr/bin/${appInfo.productFilename}`, "/usr/bin/app",
42+
"-move", `/usr/bin/${appInfo.productFilename}`, `/usr/bin/${appInfo.name}`,
4343
]
4444
for (let [from, to] of (await this.helper.icons)) {
4545
args.push("-map", from, `/usr/share/icons/default/${to}`)
@@ -51,15 +51,16 @@ export default class AppImageTarget extends TargetEx {
5151
}
5252
args.push("-map", this.helper.maxIconPath, "/.DirIcon")
5353

54-
// args.push("-zisofs", `level=0:block_size=128k:by_magic=off`, "-chown_r", "0")
55-
// args.push("/", "--", "set_filter_r", "--zisofs", "/")
54+
args.push("-chown_r", "0", "/", "--")
55+
args.push("-zisofs", `level=0:block_size=128k:by_magic=off`)
56+
args.push("set_filter_r", "--zisofs", "/")
5657

5758
await exec(process.platform === "darwin" ? path.join(appImagePath, "xorriso") : "xorriso", args)
5859

5960
await new BluebirdPromise((resolve, reject) => {
6061
const rd = createReadStream(path.join(appImagePath, arch === Arch.ia32 ? "32" : "64", "runtime"))
6162
rd.on("error", reject)
62-
const wr = createWriteStream(image)
63+
const wr = createWriteStream(image, {flags: "r+"})
6364
wr.on("error", reject)
6465
wr.on("finish", resolve)
6566
rd.pipe(wr)
@@ -83,6 +84,6 @@ export default class AppImageTarget extends TargetEx {
8384
stdio: ["ignore", debug.enabled ? "inherit" : "ignore", "inherit"],
8485
})
8586

86-
packager.dispatchArtifactCreated(image)
87+
packager.dispatchArtifactCreated(`${image}.xz`)
8788
}
8889
}

templates/linux/AppRun.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ NUMBER_OF_ARGS="$#"
3333
# such as desktop integration daemons
3434
VENDORPREFIX=appimagekit
3535

36-
BIN="${APPDIR}/usr/bin/app"
37-
3836
trap atexit EXIT
3937

4038
# Note that the following handles 0, 1 or more arguments (file paths)
@@ -126,6 +124,8 @@ check_dep xdg-desktop-menu
126124

127125
DESKTOP_FILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
128126
DESKTOP_FILE_NAME=$(basename "${DESKTOP_FILE}")
127+
APP=$(echo "$DESKTOP_FILE_NAME" | sed -e 's/.desktop//g')
128+
BIN="$APPDIR/usr/bin/$APP"
129129

130130
if [ ! -f "$DESKTOP_FILE" ] ; then
131131
echo "Desktop file is missing. Please run ${THIS} from within an AppImage."
@@ -165,8 +165,6 @@ fi
165165

166166
# If the user has agreed, rewrite and install the desktop file, and the MIME information
167167
if [ -z "$SKIP" ] ; then
168-
APP=$(echo "$DESKTOP_FILE_NAME" | sed -e 's/.desktop//g')
169-
170168
# desktop-file-install is supposed to install .desktop files to the user's
171169
# applications directory when run as a non-root user,
172170
# and to /usr/share/applications if run as root

0 commit comments

Comments
 (0)