question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mac Installer do not create .app folder in /Applications when launching .pkg

See original GitHub issue
  • Version: 19.16.0
  • Target: pkg (macos)

Let’s say the application name is myApp and the build config in the package.json is the following:

"build": {
    "appId": "com.myorg.myapp",
    "nsis": {
      "include": "nsis/refreshDesktop.nsh",
      "artifactName": "MyAppSetup.${ext}"
    },
    "publish": {
      "provider": "generic",
      "url": "${env.MYAPP_UPDATE_URL}"
    },
    "mac": {
      "target": [
        "pkg",
        "zip"
      ],
      "artifactName": "MyAppSetup.${ext}"
    }
  }

Reproduction

Ok, so repro steps are:

  1. build myApp
  1. launch the .pkg
  2. remove myApp.app from /Applications
  3. relaunch pkg

Expected

myApp installed into /Applications

Observed

myApp not installed into /Applications

Diagnostic

Having something already called myApp.app somewhere in the disc like the one generated by electron-builder in the mac folder prevent the myAppl.app folder to be re-created into the /Applications folder.

This is related to this stackoverflow One of the comment suggest to have the BundleIsRelocatable set to false in the plist file. Could this be added as a new option for the .pkg target ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
leonlianghtcommented, Dec 12, 2017

Somehow MyApp.app is installed in release/mac instead of /Applications.

I have checked that after running npm run build, the owner of release/mac/foo.app is my account, and after installing the MyApp.pkg, the owner of release/mac/MyApp.app becomes root. That means the installation put MyApp.app in release/mac instead of /Applications.

However like @johnryan said, if I delete the release/mac folder, the installation will install MyApp.app in /Applications

My guess is that macOS somehow find that myApp.app is somehow exists and needs a upgrade install of re-install, so it replaces the myApp.app instead of putting it into /Applications.

3reactions
johnryancommented, Nov 13, 2017

What I am noticing is that when building the app it gets built in release/mac. What seems to happen is that IF the MyApp.app file is present in the release/mac folder, the .pkg always installs to that directory (even if selecting /Applications). I can fix it by deleting the release folder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mac package installer installs the folder "Contents" in ...
app to create a Mac installer, and I run the installer, it creates me a folder named "Contents" in my /Applications folder, instead...
Read more >
macos - OSX .pkg installer sometimes does not install .app file
I have had roughly the same problem. It appears that the OS X installer uses information about already installed packages and application ......
Read more >
PostInstall script not running on MacOS - Apple Developer
I have created a package installer for MacOS with "productbuild" command line and adding the postinstall script in the package through command.
Read more >
Install and uninstall apps from the internet or a disc on Mac
For apps downloaded from the internet: In the Downloads folder, double-click the disk image or package file (looks like an open box). If...
Read more >
Open a Mac app from an unidentified developer - Apple Support
This doesn't necessarily mean that something's wrong with the app. For example, some apps were written before developer ID registration began. However, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found