Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

fix(install): make the macOS install paths work

velixio0351cec5f304
diff --git a/CHANGELOG.md b/CHANGELOG.md
index abbe0d4ad..e162b68ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,10 @@ metadata and the backend fallback mirror it.
- Contributor guides and the pull request template explain how to sign the CLA before opening a first pull request (#2676)
+### Fixed
+
+- macOS builds without a Developer ID are now signed ad hoc so the bundle signature is valid, and the shell installer clears quarantine, repairs an invalid signature of older releases, names an unreadable disk image, and tells Intel Mac users the backend needs Apple Silicon (#3033, #2763, #2829, #2681)
+
### CI
- Desktop request-guard self-tests stay deterministic when app requests arrive during cleanup (#2676)
diff --git a/docs/install/macos.md b/docs/install/macos.md
index 134d361aa..b2ac54673 100644
--- a/docs/install/macos.md
+++ b/docs/install/macos.md
@@ -90,6 +90,11 @@ one-time confirmation per install; afterwards it launches by double-click.
> Trash"** with no Open option, the download was corrupted or it's a pre-signing
> build — re-download the latest release, or use the Terminal fallback below.
+> Builds after this fix are signed ad hoc by the release build (`identity: '-'`),
+> so they show the friendlier dialog above instead of "damaged". The shell
+> installer also clears quarantine and repairs the signature of older releases
+> for you.
+
**Fix — Terminal:** after dragging the app into `/Applications`, run:
```bash
diff --git a/docs/install/script.md b/docs/install/script.md
index b50e59e9d..3aa5769d8 100644
--- a/docs/install/script.md
+++ b/docs/install/script.md
@@ -50,6 +50,11 @@ and checks again before replacing files. macOS refreshes the installed app's
Launch Services registration so Launchpad can find the new version.
macOS installs `VoiceStudio.app` in
`/Applications`, or `~/Applications` if `/Applications` is not writable.
+On macOS the installer also clears the `com.apple.quarantine` flag and, when
+`codesign --verify --deep --strict` fails (releases shipped before the build
+signed ad hoc, #2763), re-signs the bundle ad hoc so Gatekeeper does not report
+"damaged". A valid or notarized signature is never touched. On an Intel Mac it
+prints that the local backend needs Apple Silicon.
Linux installs `~/.local/bin/VoiceStudio`; include `~/.local/bin` in your PATH.
Current Electron source builds also read archived setup configuration for custom
data/model folders and portable storage; explicit launch environment overrides
diff --git a/electron/electron-builder.config.mjs b/electron/electron-builder.config.mjs
index b06873c68..a05d10bf8 100644
--- a/electron/electron-builder.config.mjs
+++ b/electron/electron-builder.config.mjs
@@ -115,6 +115,12 @@ const notarizeMac =
process.env.APPLE_TEAM_ID,
);
+// electron-builder never signs ad hoc on its own when no certificate exists, so
+// the bundle keeps Electron's original signature while its contents change. That
+// signature is invalid, and quarantined downloads then fail as "damaged"
+// (#2763, #2829, #2681). Sign ad hoc explicitly when no Developer ID is supplied.
+const adhocSignMac = !isMacAppStore && !process.env.CSC_LINK;
+
/** @type {import('electron-builder').Configuration} */
export default {
appId: APP_ID,
@@ -194,6 +200,7 @@ export default {
// Keep unsigned artifact rehearsals at their existing signing defaults;
// a Developer ID certificate and Apple credentials enable both together.
hardenedRuntime: isMacAppStore ? false : notarizeMac,
+ ...(adhocSignMac ? { identity: '-' } : {}),
notarize: notarizeMac,
extendInfo: {
NSMicrophoneUsageDescription: readFileSync(resolve(here, 'build/Info.plist'), 'utf8')
diff --git a/electron/tests/packaging-contract.mjs b/electron/tests/packaging-contract.mjs
index 0b65ba70e..5bca3a1de 100644
--- a/electron/tests/packaging-contract.mjs
+++ b/electron/tests/packaging-contract.mjs
@@ -123,6 +123,14 @@ for (const entitlementFile of [config.mac.entitlements, config.mac.entitlementsI
assert.match(entitlements, /<key>com\.apple\.security\.device\.audio-input<\/key>\s*<true\s*\/>/);
assert.match(entitlements, /<key>com\.apple\.security\.cs\.allow-jit<\/key>\s*<true\s*\/>/);
}
+if (DISTRIBUTION_TARGET !== 'mac-app-store') {
+ assert.equal(
+ config.mac.identity,
+ process.env.CSC_LINK ? undefined : '-',
+ 'Unsigned macOS builds are signed ad hoc so the bundle signature stays valid',
+ );
+ if (config.mac.identity === '-') assert.equal(config.mac.hardenedRuntime, false);
+}
if (DISTRIBUTION_TARGET === 'mac-app-store') {
assert.deepEqual(config.mac.target, ['mas'], 'Mac App Store builds only the MAS package');
assert.equal(config.mac.notarize, false, 'Apple handles Mac App Store notarization');
diff --git a/electron/tests/shell-installer.test.mjs b/electron/tests/shell-installer.test.mjs
index fe2b0d66a..6e8f748c0 100644
--- a/electron/tests/shell-installer.test.mjs
+++ b/electron/tests/shell-installer.test.mjs
@@ -58,18 +58,22 @@ function fixture(t, options = {}) {
writeFileSync(join(bin, name), '#!/bin/sh\nset -eu\n' + body, { mode: 0o755 });
shim(
'uname',
- `case "$1" in -s) echo ${options.mac ? 'Darwin' : 'Linux'};; -m) echo ${options.mac ? 'arm64' : 'x86_64'};; esac\n`,
+ `case "$1" in -s) echo ${options.mac ? 'Darwin' : 'Linux'};; -m) echo ${options.machine ?? (options.mac ? 'arm64' : 'x86_64')};; esac\n`,
);
shim(
'hdiutil',
`
if [ "$1" = attach ]; then
+ [ "$TEST_ATTACH_FAIL" = 0 ] || exit 1
while [ "$1" != -mountpoint ]; do shift; done
shift; mkdir -p "$1/VoiceStudio.app/Contents"
printf fixture > "$1/VoiceStudio.app/Contents/Info.plist"
fi
`,
);
+ shim('sysctl', `[ "$TEST_ROSETTA" = 1 ] && echo 1 || echo 0\n`);
+ shim('xattr', 'printf "%s\\n" "$*" >> "$TEST_ROOT/xattr"\n');
+ shim('codesign', `printf "%s\\n" "$*" >> "$TEST_ROOT/codesign"\ncase "$*" in *--verify*) [ "$TEST_SIG_INVALID" = 0 ];; esac\n`);
shim('ditto', 'cp -R "$1" "$2"\n');
shim(
'curl',
@@ -84,7 +88,7 @@ case "$url" in
*/latest) printf 'https://github.com/debpalash/VoiceStudio/releases/tag/v1.2.3';;
*/SHA256SUMS.txt)
version=$(printf '%s' "$url" | sed 's|.*/download/v||; s|/.*||')
- printf '%s VoiceStudio-Electron-%s-${options.mac ? 'mac-arm64.dmg' : 'linux-x64.AppImage'}\\n' "$TEST_DIGEST" "$version" > "$out";;
+ printf '%s VoiceStudio-Electron-%s-${options.mac ? 'mac-arm64.dmg' : 'linux-x64.AppImage'}\\n%s VoiceStudio-Electron-%s-mac-x64.dmg\\n' "$TEST_DIGEST" "$version" "$TEST_DIGEST" "$version" > "$out";;
*/VoiceStudio-Electron-*.AppImage|*/VoiceStudio-Electron-*.dmg)
[ "$TEST_MISSING" = 0 ] || exit 22
printf '${payload}' > "$out";;
@@ -140,6 +144,9 @@ if [ "$1 $2" = 'run electron-builder' ]; then printf '${payload}' > release/Voic
VOICESTUDIO_INSTALL_DIR: options.installDir ?? (options.mac
? join(home, 'Applications')
: join(home, '.local/bin')),
+ TEST_ROSETTA: options.rosetta ? '1' : '0',
+ TEST_SIG_INVALID: options.sigInvalid ? '1' : '0',
+ TEST_ATTACH_FAIL: options.attachFails ? '1' : '0',
TEST_MISSING: options.missing ? '1' : '0',
TEST_BUILD_FAIL: options.buildFails ? '1' : '0',
},
@@ -213,6 +220,43 @@ test('macOS installs the verified Electron bundle and replaces only the app', (t
assert.match(readFileSync(join(f.root, 'registration'), 'utf8'), /-f .*VoiceStudio\.app/);
});
+for (const [name, options, asset, intel] of [
+ ['Apple Silicon', { mac: true, machine: 'arm64' }, 'mac-arm64.dmg', false],
+ ['Intel', { mac: true, machine: 'x86_64' }, 'mac-x64.dmg', true],
+ ['Apple Silicon terminal under Rosetta', { mac: true, machine: 'x86_64', rosetta: true }, 'mac-arm64.dmg', false],
+]) {
+ test(`macOS ${name} downloads ${asset}`, (t) => {
+ const f = fixture(t, options);
+ const r = f.run();
+ assert.equal(r.status, 0, r.stderr);
+ assert.match(readFileSync(join(f.root, 'requests'), 'utf8'), new RegExp(`/VoiceStudio-Electron-1\\.2\\.3-${asset.replace('.', '\\.')}`));
+ assert.equal(r.stdout.includes('Intel Mac'), intel);
+ });
+}
+
+test('macOS clears quarantine and repairs an invalid signature after install', (t) => {
+ const f = fixture(t, { mac: true, sigInvalid: true });
+ const r = f.run();
+ assert.equal(r.status, 0, r.stderr);
+ assert.match(readFileSync(join(f.root, 'xattr'), 'utf8'), /-dr com\.apple\.quarantine .*VoiceStudio\.app/);
+ assert.match(readFileSync(join(f.root, 'codesign'), 'utf8'), /--force --deep --sign - .*VoiceStudio\.app/);
+ assert.match(r.stdout, /Repaired the app signature/);
+});
+
+test('macOS leaves a valid signature untouched', (t) => {
+ const f = fixture(t, { mac: true });
+ assert.equal(f.run().status, 0);
+ assert.doesNotMatch(readFileSync(join(f.root, 'codesign'), 'utf8'), /--force/);
+});
+
+test('macOS reports an unreadable disk image clearly and installs nothing', (t) => {
+ const f = fixture(t, { mac: true, attachFails: true });
+ const r = f.run();
+ assert.notEqual(r.status, 0);
+ assert.match(r.stderr, /Could not open the disk image VoiceStudio-Electron-1\.2\.3-mac-arm64\.dmg/);
+ assert.equal(existsSync(join(f.home, 'Applications/VoiceStudio.app')), false);
+});
+
test('refuses replacement and uninstall while VoiceStudio is running', (t) => {
const f = fixture(t, { mac: true, running: true });
for (const args of [[], ['--uninstall']]) {
diff --git a/scripts/install.sh b/scripts/install.sh
index 8e0559df7..f8d05394b 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -151,6 +151,17 @@ install_app() {
mv "$DEST" "$BACKUP"
fi
mv "$STAGED/VoiceStudio.app" "$DEST"
+ # Releases without a Developer ID are only ad-hoc signed, and some were
+ # shipped with a bundle signature that no longer matches (#2763, #2829,
+ # #2681), which macOS reports as "damaged". Clear any quarantine flag and
+ # repair an invalid signature in place; a valid or notarized app is left
+ # untouched. Both steps are best effort and never abort the install.
+ xattr -dr com.apple.quarantine "$DEST" >/dev/null 2>&1 || true
+ if have codesign && ! codesign --verify --deep --strict "$DEST" >/dev/null 2>&1; then
+ codesign --force --deep --sign - "$DEST" >/dev/null 2>&1 \
+ && printf 'Repaired the app signature locally (ad-hoc) so macOS opens it.\n' \
+ || printf 'Warning: could not repair the app signature; see docs/install/macos.md#gatekeeper-quarantine.\n' >&2
+ fi
lsregister -f "$DEST" || printf 'Warning: macOS registration failed; open the installed app directly.\n' >&2
else
DEST_DIR=${VOICESTUDIO_INSTALL_DIR:-"$HOME/.local/bin"}
@@ -164,6 +175,9 @@ install_app() {
printf 'Installed Electron: %s\n' "$DEST"
printf 'Open VoiceStudio to configure its local backend and choose models. Existing data is preserved.\n'
if [ "$OS" = mac ]; then printf 'Launch the installed app: open "%s"\n' "$DEST"; fi
+ if [ "$OS" = mac ] && [ "$ARCH" = x64 ]; then
+ printf 'Note: this is an Intel Mac. The app UI runs, but the local backend needs Apple Silicon; connect to a backend on another machine (docs/install/macos.md).\n'
+ fi
}
if [ "$MODE" = main ]; then
@@ -227,7 +241,7 @@ fi
if [ "$OS" = mac ]; then
MOUNT="$WORK/mount"
mkdir "$MOUNT"
- hdiutil attach -readonly -nobrowse -mountpoint "$MOUNT" "$PACKAGE"
+ hdiutil attach -readonly -nobrowse -mountpoint "$MOUNT" "$PACKAGE" >/dev/null || die "Could not open the disk image $ASSET (checksum was verified). Free some disk space and retry."
[ -d "$MOUNT/VoiceStudio.app" ] || die 'VoiceStudio.app is missing from the disk image.'
install_app "$MOUNT/VoiceStudio.app"
else