From 1164ca1aa769ca682fba3df7e17586e786c61f0a Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 15 May 2016 00:35:28 +0900 Subject: [PATCH] fix(linux): use full path in .desktop file (#405) In previous version, "Exec" parameter of .desktop file used only executable name. This depends on user's $PATH, that might cause the problem when launching the app. So this commit uses the full path for "Exec" parameter. --- src/linuxPackager.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/linuxPackager.ts b/src/linuxPackager.ts index 18fde509251..bc968461272 100755 --- a/src/linuxPackager.ts +++ b/src/linuxPackager.ts @@ -12,6 +12,7 @@ const template = require("lodash.template") const __awaiter = require("./awaiter") const tmpDir = BluebirdPromise.promisify(<(config: TmpOptions, callback: (error: Error, path: string, cleanupCallback: () => void) => void) => void>_tpmDir) +const installPrefix = "/opt" export class LinuxPackager extends PlatformPackager { private readonly debOptions: LinuxBuildOptions @@ -77,7 +78,7 @@ export class LinuxPackager extends PlatformPackager { await outputFile(tempFile, this.debOptions.desktop || `[Desktop Entry] Name=${this.appName} Comment=${this.debOptions.description} -Exec="${this.appName}" +Exec="${installPrefix}/${this.appName}/${this.appName}" Terminal=false Type=Application Icon=${this.metadata.name} @@ -218,7 +219,7 @@ Icon=${this.metadata.name} use(options.fpm, it => args.push(...it)) - args.push(`${appOutDir}/=/opt/${this.appName}`) + args.push(`${appOutDir}/=${installPrefix}/${this.appName}`) args.push(...(await this.packageFiles)!) await exec(await this.fpmPath, args) return destination @@ -235,4 +236,4 @@ async function writeConfigFile(tempDir: string, templatePath: string, options: a const outputPath = path.join(tempDir, path.basename(templatePath, ".tpl")) await outputFile(outputPath, config) return outputPath -} \ No newline at end of file +}