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:
- build myApp
- launch the .pkg
- remove myApp.app from /Applications
- 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:
- Created 6 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Somehow MyApp.app is installed in
release/mac
instead of/Applications
.I have checked that after running
npm run build
, the owner ofrelease/mac/foo.app
is my account, and after installing the MyApp.pkg, the owner ofrelease/mac/MyApp.app
becomes root. That means the installation put MyApp.app inrelease/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
.What I am noticing is that when building the app it gets built in
release/mac
. What seems to happen is that IF theMyApp.app
file is present in therelease/mac
folder, the.pkg
always installs to that directory (even if selecting /Applications). I can fix it by deleting therelease
folder.