- 1 year ago
Sign windows electron build on macOS (Catalina)
To sign a Windows Electron build on macOS (Catalina), you can use the codesign
command-line tool provided by Apple. Here's a general outline of the steps involved:
Install Xcode Command Line Tools: Ensure that you have Xcode Command Line Tools installed on your macOS system. Open a Terminal and run the following command to install the tools:
shellxcode-select --install
Obtain a Code Signing Certificate: To sign Windows executables, you need a code signing certificate issued by a trusted certificate authority (CA). Obtain a code signing certificate from a CA that supports code signing for Windows.
Export the Code Signing Certificate: Export the code signing certificate from the Keychain Access utility on your macOS system. Export it as a Personal Information Exchange (.p12) file format, and provide a password for the exported certificate.
Install the Certificate on Windows: Transfer the exported .p12 file to your Windows machine and import it into the Windows Certificate Store using the Certificate Manager tool.
Sign the Electron Build on macOS:
- Open a Terminal on your macOS system.
- Change to the directory where your Electron build artifacts are located.
- Run the following
codesign
command to sign the executable (replace<path-to-certificate>
and<password>
with the actual values):
Note: You might need to adjust theshellcodesign --sign "<path-to-certificate>" --keychain "/Library/Keychains/System.keychain" --force --verbose=4 YourApp.exe
--keychain
option to point to the appropriate keychain on your macOS system.
Verify the Signature: Transfer the signed Electron build back to your Windows machine and verify the signature using the
signtool
command-line utility provided by Microsoft.
These steps provide a general approach to signing a Windows Electron build on macOS. The exact commands and options may vary depending on your specific setup and requirements. Make sure to refer to the documentation and resources provided by Apple and Microsoft for more detailed instructions on code signing and the tools involved.