-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use binaries
option to sign additional binaries
#1723
Comments
👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
Up. The type explicitly omits the In the other place the docs say something different: I can't find it in the code but is
@voldemortensen Did you have any luck with this? |
For posterity. Anyway, I was able to sign the native binaries during the const forgeConfig = {
packagerConfig: {
afterCopy: [
(buildPath, electronVersion, platform, arch, callback) => {
try {
console.log('Build path:', buildPath);
// Only run signing on macOS
if (platform === 'darwin') {
const binaries = [];
if (arch === 'x64' || arch === 'universal') {
binaries.push(
path.join(
buildPath,
'node_modules/node-hid/bin/darwin-x64-123/node-hid.node',
),
path.join(
buildPath,
'node_modules/node-hid/prebuilds/HID-darwin-x64/node-napi-v3.node',
),
);
}
if (arch === 'arm64' || arch === 'universal') {
binaries.push(
path.join(
buildPath,
'node_modules/node-hid/bin/darwin-arm64-123/node-hid.node',
),
path.join(
buildPath,
'node_modules/node-hid/prebuilds/HID-darwin-arm64/node-napi-v3.node',
),
);
}
binaries.push(
path.join(
buildPath,
'node_modules/node-hid/build/Release/HID.node',
),
);
binaries.forEach((binaryPath) => {
if (fs.existsSync(binaryPath)) {
console.log(`Signing binary: ${binaryPath}`);
execSync(
`codesign --deep --force --verbose --sign "${process.env.SIGNING_IDENTITY}" "${binaryPath}"`,
{
stdio: 'inherit',
},
);
} else {
console.error(`Binary not found: ${binaryPath}`);
}
});
}
callback();
} catch (error) {
callback(error);
}
},
],
},
}; It still feels to me that I'm doing something wrong here 🙈 but at least that works. Otherwise, I was getting an error like this:
while interacting with |
@tniezurawski Thanks for sharing! This solution was super helpful. I agree though that it feels like there's something wrong... feels like the tool should support this feature and I'm missing some configuration. Did you had any troubles with this approach? Did you find a better alternative? btw, this is the place where |
Preflight Checklist
Issue Details
Expected Behavior
I should be able to use
binaries
inosxSign
to sign additional binaries.Actual Behavior
The TypeScript definition explicitly removes the
binaries
key usingOmit
which results in this error:To Reproduce
Additional Information
binaries
has been omitted since theOsxSignOptions
type was introduced in a2a3ae5The text was updated successfully, but these errors were encountered: