-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: app name contains spaces #194
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear how this fixes your issue, can you add an explanation in the PR for why the absolute path with a space in it works but the relative path with a space does not?
App Name: 900 TG • Notarizing app: /path/to/dist/mac-arm64/900 TG.app 900 TG.app: No such process This PR fixed this issue |
@MarshallOfSound The previous version would simply try to codesign the packaged app in the current working directory (which is wrong of course) because of wrong arguments passing. |
When notarizing, using a relative path for the codesign parameter and an application name with spaces causes the notarization to fail. This issue does not occur with absolute paths. |
For usage with https://www.npmjs.com/package/patch-package Create file diff --git a/node_modules/@electron/notarize/lib/check-signature.js b/node_modules/@electron/notarize/lib/check-signature.js
index 324568a..c3d65f8 100644
--- a/node_modules/@electron/notarize/lib/check-signature.js
+++ b/node_modules/@electron/notarize/lib/check-signature.js
@@ -41,16 +41,14 @@ const spawn_1 = require("./spawn");
const debug_1 = __importDefault(require("debug"));
const d = (0, debug_1.default)('electron-notarize');
const codesignDisplay = (opts) => __awaiter(void 0, void 0, void 0, function* () {
- const result = yield (0, spawn_1.spawn)('codesign', ['-dv', '-vvvv', '--deep', path.basename(opts.appPath)], {
+ const result = yield (0, spawn_1.spawn)('codesign', ['-dv', '-vvvv', '--deep', opts.appPath], {
cwd: path.dirname(opts.appPath),
});
return result;
});
const codesign = (opts) => __awaiter(void 0, void 0, void 0, function* () {
d('attempting to check codesign of app:', opts.appPath);
- const result = yield (0, spawn_1.spawn)('codesign', ['-vvv', '--deep', '--strict', path.basename(opts.appPath)], {
- cwd: path.dirname(opts.appPath),
- });
+ const result = yield (0, spawn_1.spawn)('codesign', ['-vvv', '--deep', '--strict', opts.appPath]);
return result;
});
function checkSignatures(opts) { |
I'm seeing this same error even without spaces. # All of these run in the same folder with App-Name.app
# Does not work
codesign -vvv --deep --strict "App-Name.app"
codesign -vvv --deep --strict "App Name.app"
# Works
codesign -vvv --deep --strict "./App-Name.app"
codesign -vvv --deep --strict "./App Name.app"
codesign -vvv --deep --strict "/Users/<username>/src/app-name/out/mac-arm64/App-Name.app"
codesign -vvv --deep --strict "/Users/<username>/src/app-name/out/mac-arm64/App Name.app" |
Since this was blocking me I ended up replacing "build": {
"mac": {
"notarize": false
},
"afterSign": "electron/notarize.js"
} as normal. This is the same as if you are writing your own custom import { execSync } from "node:child_process";
async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== "darwin") {
return;
}
if (!process.env.APPLEIDPASS) {
return;
}
const appName = context.packager.appInfo.productFilename;
const appPath = `${appOutDir}/${appName}.app`;
const zipPath = `${appOutDir}/${appName}.zip`;
const appleId = process.env.APPLE_ID;
const appleIdPassword = process.env.APPLEIDPASS;
const teamId = process.env.APPLE_TEAM_ID;
console.log(
execSync(`ditto -c -k --keepParent "${appPath}" "${zipPath}"`, {
encoding: "utf8",
}),
);
console.log(
execSync(
`xcrun notarytool submit "${zipPath}" --team-id "${teamId}" --apple-id "${appleId}" --password "${appleIdPassword}" --wait`,
{ encoding: "utf8" },
),
);
console.log(
execSync(`xcrun stapler staple "${appPath}"`, { encoding: "utf8" }),
);
}
export default notarizing; Use as your own risk and make sure to check what environment variables you are using for CI/etc. This is working in my github actions and now my app is being packaged and notarizing again. Clearly the current logic used to run |
fix #193