message: Use APPDIR from env in the child writer
  Change-type: patch
diff: @@ -206,7 +206,7 @@ exports.performWrite = (image, drives, onProgress) => {
  })
  const argv = _.attempt(() => {
  - const entryPoint = getApplicationEntryPoint()
  + let entryPoint = getApplicationEntryPoint()
  // AppImages run over FUSE, so the files inside the mount point
  // can only be accessed by the user that mounted the AppImage.
  @@ -214,18 +214,13 @@ exports.performWrite = (image, drives, onProgress) => {
  // mount-point, and as a workaround, we re-mount the original
  // AppImage as root.
  if (os.platform() === 'linux' && process.env.APPIMAGE && process.env.APPDIR) {
  + entryPoint = _.replace(entryPoint, process.env.APPDIR, '')
  return [
  process.env.APPIMAGE,
  -
  - // Executing the AppImage with ELECTRON_RUN_AS_NODE opens
  - // the Node.js REPL without loading the default entry point.
  - // As a workaround, we can pass the path to the file we want
  - // to load, relative to the usr/ directory of the mounted
  - // AppImage.
  - _.replace(entryPoint, path.join(process.env.APPDIR, 'usr/'), '')
  + '-e',
  + `require(\`\${process.env.APPDIR}${entryPoint}\`)`
  ]
  }
  -
  return [
  _.first(process.argv),
  entryPoint
  