Hey, @msavin. Sorry for the late answer. I will write a small manual about how to build the installer with the meteor-desktop.
-
Create an Apple developer account on developer.apple.com. The Apple Developer Program annual fee is 99 USD and the Apple Developer Enterprise Program annual fee is 299 USD.
-
Create a desktop project in the apple store connect appstoreconnect.apple.com
-
Create certificates and provisioning profiles. You could do this on xcode or on your apple developer account.
- Mac App Distribution
- Mac Installer Distribution
- Developer ID Application
- Developer ID Installer
- Mac Development
Export them into a single p12 file and export the path to this p12 file in the "CSC_LINK"
env var.
- Create a distribution
embedded.provisionprofile
for macOS on your apple developer account. And put in the root of your project.
- you can easy find the info about certifications and provisioning profiles in the internet.
-
Generate app-specific password. This is how to do it https://www.imore.com/how-generate-app-specific-passwords-iphone-ipad-mac
-
Create a special icns icon for your app. This is how to do it https://www.youtube.com/watch?v=3TPtHX9O3IU
-
Create an entitlements.mas.plist
file in the root of the project or somewhere else inside of it.
- YOUR_APPLE_TEAM_ID - it could be yours apple id if you doesn’t work in a team.
- YOUR.BUNDLE.ID - you can get it from the created app in the apple store connect in an ‘App information’ tab
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<string>YOUR_APPLE_TEAM_ID.YOUR.BUNDLE.ID</string>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>
- Meteor-Desktop settings:
{
"name": "TYPE_HERE_YOUR_PROJECT'S_NAME",
"version": "0.0.1",
"projectName": "TYPE_HERE_YOUR_PROJECT'S_NAME_BETTER_WITHOUT_SPACES",
"devTools": true,
"devtron": true,
"desktopHCP": true,
"desktopHCPIgnoreCompatibilityVersion": false,
"autoUpdateFeedUrl": "http://127.0.0.1/update/:platform/:version",
"autoUpdateFeedHeaders": {},
"autoUpdateCheckOnStart": true,
"webAppStartupTimeout": 60000,
"exposeLocalFilesystem": false,
"window": {
"icon": "@assets/meteor.png",
"_windows": {
"icon": "@assets/meteor.ico"
}
},
"windowDev": {
},
"uglify": true,
"plugins": {
"meteor-desktop-splash-screen": {
"version": "0.4.3",
"windowSettings": {
"width": 800,
"height": 600
},
"updateScreen": true,
"updateScreenSettings": {
"imagePath": "updating.gif",
"windowSettings": {
"width": 400,
"height": 300
},
"clickThrough": false,
"style": {
"background-size": "auto"
}
}
}
},
"dependencies": {},
"packageJsonFields": {
"description": "YOUR_PROJECT_DESCRIPTION",
"author": "AUTHOR",
"private": true
},
"builderOptions": {
"icon": ".desktop/assets/meteor.ico",
"appId": "YOUR.BUNDLE.ID",
"productName": "PROJECT'S_NAME",
"artifactName": "${productName}.${ext}",
"compression": "maximum",
"win": {
"target": ["nsis"]
},
"squirrelWindows": {
"iconUrl": "https://github.com/wojtkowiak/meteor-desktop/blob/beta/scaffold/assets/meteor.ico?raw=true",
"loadingGif": ".desktop/assets/loading.gif"
},
"publish": [
{
"provider": "generic",
"url": "http://127.0.0.1:8080/"
}
],
"mac": {
"type": "distribution",
"icon": "PATH_TO_YOUR icns ICON_FILE",
"extendInfo": {
"ElectronTeamID": "APPLE_TEAM_ID",
"com.apple.developer.team-identifier": "APPLE_TEAM_ID",
"com.apple.application-identifier": "APPLE_TEAM_ID.YOUR.BUNDLE.ID"
},
"entitlements": "PATH_TO entitlements.mas.plist",
"provisioningProfile": "embedded.provisionprofile",
"target": ["mas"],
"bundleVersion": "1"
},
"dmg": {
"icon": "PATH_TO_YOUR icns ICON_FILE",
"iconSize": 54,
"contents": [
{ "x": 377, "y": 190, "type": "link", "path": "/Applications" },
{ "x": 63, "y": 190, "type": "file" }
],
"window": {
"width": 480,
"height": 300
}
}
},
"packagerOptions": {
"icon": ".desktop/assets/meteor.ico",
"_osx": {
"icon": "PATH_TO_YOUR icns ICON_FILE"
},
"appVersion": "@version",
"buildVersion": "1",
"appCopyright": "COPYRIGHT_TEXT",
"win32metadata": {
"CompanyName": "COMPANY_NAME",
"FileDescription": "FILE_DESCRIPTION",
"OriginalFilename": "PRODUCT_NAME.exe",
"ProductName": "PRODUCT_NAME",
"InternalName": "PRODUCT_NAME.exe"
}
}
}
- Install mobile platforms for meteor (iOS or Android)
- if you didn’t run the mobile platform before run the ‘meteor rebuild’ - it would install the necessary cordova and meteor packages.
- Then run command:
npm run desktop -- build-installer https://YOUR_SERVER_ADRESS --mac --build-meteor --meteor-settings settings.json
if you don’t use meteor settings - just remove it from the command.
- If all is OK. You will have a folder with the desktop installer archive file. If you use the xcode 10 or higher upload the app package file with the command:
xcrun altool --upload-app -f "PATH_TO_YOUR pkg FILE" -u YOUR_APPLE_ID -p APPLE_APPLICATION_SPECIFIC_PASSWORD
if the xcode is lower than 10 version it might not found the altool
with xcrun
so run at once:
ln -s "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool" /usr/local/bin/altool
ln -s "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms" /usr/local/bin/itms #itms is needed, otherwise altool will not work correctly
then run the same without xcrun
altool --upload-app -f "PATH_TO_YOUR pkg FILE" -u YOUR_APPLE_ID -p APPLE_APPLICATION_SPECIFIC_PASSWORD
It should upload it to the apple store connect.
One main thing is to secure your p12 certificate file, provisioning profile, apple_app_specific_password, plist file. Add it to gitignore file if you use github.
That’s it!
The most of the settings for macOS build I took form electron-build docs
https://www.electron.build/configuration/configuration