Skip to content

Commit

Permalink
fix(linux): use full path in .desktop file (#405)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yuya-oc authored and develar committed May 14, 2016
1 parent 8d9b952 commit 1164ca1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/linuxPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<LinuxBuildOptions> {
private readonly debOptions: LinuxBuildOptions
Expand Down Expand Up @@ -77,7 +78,7 @@ export class LinuxPackager extends PlatformPackager<LinuxBuildOptions> {
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}
Expand Down Expand Up @@ -218,7 +219,7 @@ Icon=${this.metadata.name}

use(options.fpm, it => args.push(...<any>it))

args.push(`${appOutDir}/=/opt/${this.appName}`)
args.push(`${appOutDir}/=${installPrefix}/${this.appName}`)
args.push(...<any>(await this.packageFiles)!)
await exec(await this.fpmPath, args)
return destination
Expand All @@ -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
}
}

0 comments on commit 1164ca1

Please sign in to comment.