You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/makers/appx.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,16 +29,20 @@ module.exports = {
29
29
{
30
30
name:'@electron-forge/maker-appx',
31
31
config: {
32
-
publisher:'CN=developmentca',
33
-
devCert:'C:\\devcert.pfx',
34
-
certPass:'abcd'
32
+
publisher:'CN=UUID',
33
+
publisherDisplayName:'CompanyName',
34
+
displayName:'AppName',
35
+
version:'1.0.0',
36
+
identityName:'CompanyName.AppName'
35
37
}
36
38
}
37
39
]
38
40
};
39
41
```
40
42
{% endcode %}
41
43
44
+
The UUID in the ```publisher``` field can be found on the Microsoft website that you use to create the app listing. The only trick is that Windows doesn't like dashes in any file or folder names.
45
+
42
46
Configuration options are documented in [`MakerAppXConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_maker\_appx.MakerAppXConfig.html).
@@ -29,12 +29,18 @@ Although Electron does not integrate tightly with the IDE itself, Xcode is a hel
29
29
30
30
Code signing certificates for macOS apps can only be obtained through Apple by purchasing a membership to the [Apple Developer Program](https://developer.apple.com/programs/).
31
31
32
-
To sign Electron apps, you may require two separate certificates:
32
+
If you want to submit your app to the Mac App Store, you will need to create the following certificates:
33
33
34
-
* The **Developer ID Installer** certificate is for apps distributed to the Mac App Store.
35
-
* The **Developer ID Application** certificate is for apps distributed outside the Mac App Store.
34
+
- Apple Development
35
+
- Apple Distribution
36
+
- Mac Installer Distribution
36
37
37
-
Once you have an Apple Developer Program membership, you first need to install them onto your machine. We recommend [loading them through Xcode](https://help.apple.com/xcode/mac/current/#/dev3a05256b8).
38
+
If you want to distribution your app outside of the App Store, you will need the following certificates:
39
+
40
+
- Developer ID Application
41
+
- Developer ID Installer
42
+
43
+
All of these certificates should be created through Xcode after you have signed up for an Apple Developer Account. If you have created them any other way, you will have to delete them.
Once you have created the certificates, you need to go to your Apple Developer Account and create provisioning profiles. If you are submiting your app to the app store, you will need a development profile and a distribution profile. If you are submiting it outside of the app store, you will need a profile for the ```Developer ID Application``` certificate.
58
+
59
+
You need to download these after creating them and double clicking them to install them on your computer. Not all of them can be installed locally, but just double-click on them anyway.
60
+
49
61
## Configuring Forge
50
62
51
63
In Electron Forge, macOS apps are signed and notarized at the **Package** step by the `electron-packager` library. There is a separate option within your Forge `packagerConfig` for each one of these settings.
@@ -62,44 +74,98 @@ To enable code signing on macOS, ensure that `packagerConfig.osxSign` exists in
The `osxSign` config comes with defaults that work out of the box in most cases, so we recommend you start with an empty configuration object.
99
+
```binaries```: if your electron app calls any binaries, they need to be listed here so that they can be signed.
72
100
73
-
For a full list of configuration options, see the [`OsxSignOptions`](https://js.electronforge.io/modules/\_electron\_forge\_shared\_types.InternalOptions.html#OsxSignOptions) type in the Forge API docs. For more detailed information on how to configure these options, see the [`@electron/osx-sign` documentation](https://github.com/electron/osx-sign).
101
+
```identity```: the name of the certificate.
74
102
75
-
#### Customizing entitlements
103
+
- App store development: Apple Development
104
+
- App store distribution: Apple Distribution: FirstName LastName (TEAMID)
105
+
- Outside distribution: Developer ID Application: FirstName LastName (TEAMID)
76
106
77
-
A common use case for modifying the default `osxSign` configuration is to customize its entitlements. In macOS, **entitlements** are privileges that grant apps certain capabilities (e.g. access to the camera, microphone, or USB devices). These are stored within the code signature in an app's executable file.
107
+
```platform```: for the app store it is ```mas``` and for outside the app store it is ```darwin```
78
108
79
-
By default, the `@electron/osx-sign` tool comes with a set of entitlements that should work on both MAS or direct distribution targets. See the complete set of default entitlement files [on GitHub](https://github.com/electron/osx-sign/tree/main/entitlements).
109
+
```provisioningProfile```: the appropriate provisioning profile, as mentioned earlier.
80
110
81
-
{% code title="forge.config.js" %}
82
-
```javascript
83
-
module.exports= {
84
-
// ...
85
-
packagerConfig: {
86
-
// ...
87
-
osxSign: {
88
-
optionsForFile: (filePath) => {
89
-
// Here, we keep it simple and return a single entitlements.plist file.
90
-
// You can use this callback to map different sets of entitlements
91
-
// to specific files in your packaged app.
92
-
return {
93
-
entitlements:'path/to/entitlements.plist'
94
-
};
95
-
}
96
-
}
97
-
}
98
-
// ...
99
-
};
111
+
```optionsForFile```: for distribution outside of the app store, you may be able to rely on the defaults if you app doesn't need any extra entitlements. For the app store, you will definitely need to provide this.
112
+
113
+
You need to add logic to determine which set of entitlements to use. If you specify more entitlements then your app uses, it will probably be rejected by the review process.
114
+
115
+
For submission to the app store, ```hardenedRuntime``` should be false, but for distribution outside of the app store, it should be true.
116
+
117
+
For a full list of configuration options, see the [`OsxSignOptions`](https://js.electronforge.io/modules/\_electron\_forge\_shared\_types.InternalOptions.html#OsxSignOptions) type in the Forge API docs. For more detailed information on how to configure these options, see the [`@electron/osx-sign` documentation](https://github.com/electron/osx-sign).
118
+
119
+
#### Entitlements
120
+
121
+
In macOS, **entitlements** are privileges that grant apps certain capabilities (e.g. access to the camera, microphone, or USB devices). These are stored within the code signature in an app's executable file.
122
+
123
+
Here is an example main entitlements file. Add or remove entitlements depending on the needs of your app.
124
+
125
+
{% code title="entitlements.plist" %}
126
+
```xml
127
+
<?xml version="1.0" encoding="UTF-8"?>
128
+
<!DOCTYPEplist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPEplist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
156
+
<plistversion="1.0">
157
+
<dict>
158
+
<key>com.apple.security.app-sandbox</key>
159
+
<true/>
160
+
<key>com.apple.security.inherit</key>
161
+
<true/>
162
+
</dict>
163
+
</plist>
100
164
```
101
165
{% endcode %}
102
166
167
+
Forge will add additional keys related to your provisioning profile. You should remove the ```app-sandbox``` key in both files when creating the set of entitlements you want to use outside of the app store, as that version does not run in a sandbox.
168
+
103
169
For further reading on entitlements, see the following pages in Apple developer documentation:
```appleId```: usually the email address you used to create your Apple account.
305
+
306
+
```appleIdPassword```: a one-time password you can create. This is mentioned in the documentation. You create it via the Apple Developer website or something like that.
307
+
308
+
```teamId```: that set of characters inside the brackets at the end of your identity name.
0 commit comments