Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
99c5245
fix(desktop-gpui): ship the Visual C++ runtime in the Windows installer
richiemcilroy Nov 14, 2026
7cd5cbb
fix(desktop-gpui): stop the Windows installer replacing files while t…
richiemcilroy Nov 14, 2026
2d18189
fix(desktop-gpui): let onboarding recover from an unparseable setting…
richiemcilroy Nov 14, 2026
79927bd
fix(desktop-gpui): never exit silently when Cap cannot start or a run…
richiemcilroy Nov 14, 2026
e8995f8
fix(desktop-gpui): activate a responsive Cap instead of offering to q…
richiemcilroy Nov 14, 2026
f12f4a0
test(desktop-gpui): cover the startup dialog strings in the dialog su…
richiemcilroy Nov 14, 2026
9dc43d4
fix(desktop-gpui): flush the log before an early launch exit
richiemcilroy Nov 14, 2026
e3e7f43
perf(desktop-gpui): skip the installer's CLI check when no CLI proces…
richiemcilroy Nov 14, 2026
7bbb2e4
fix(desktop-gpui): end only the confirmed unresponsive Cap, by pidfd …
richiemcilroy Nov 14, 2026
ed3074f
fix(desktop-gpui): treat only ESRCH from pidfd_open as an exited Cap
richiemcilroy Nov 14, 2026
660736f
Merge remote-tracking branch 'origin/main' into fix/windows-startup-r…
richiemcilroy Nov 15, 2026
abde023
fix(desktop-gpui): serialize Linux recovery and keep a Cap that answe…
richiemcilroy Nov 15, 2026
e6f46cb
test(desktop-gpui): retry the fake Cap spawn while a parallel fork ho…
richiemcilroy Nov 16, 2026
60ef23e
Merge remote-tracking branch 'origin/main' into fix/windows-startup-r…
richiemcilroy Nov 16, 2026
dd8d89e
Merge remote-tracking branch 'origin/main' into fix/windows-startup-r…
richiemcilroy Nov 16, 2026
8070639
fix(desktop-gpui): let one Windows launch at a time recover a frozen Cap
richiemcilroy Nov 16, 2026
74ea82c
Merge remote-tracking branch 'origin/main' into fix/windows-startup-r…
richiemcilroy Nov 16, 2026
140d6dd
Merge remote-tracking branch 'origin/main' into HEAD
richiemcilroy Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/desktop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ jobs:
"Cap.exe", "cap-muxer.exe", "cap-cli.exe",
"avcodec-61.dll", "avdevice-61.dll", "avfilter-10.dll", "avformat-61.dll",
"avutil-59.dll", "postproc-58.dll", "swresample-5.dll", "swscale-8.dll",
"dxcompiler.dll", "dxil.dll", "onnxruntime.dll", "onnxruntime_providers_shared.dll"
"dxcompiler.dll", "dxil.dll", "onnxruntime.dll", "onnxruntime_providers_shared.dll",
"msvcp140.dll", "msvcp140_1.dll", "vcruntime140.dll", "vcruntime140_1.dll"
)
$forbiddenFiles = @("cap-gpui.exe", "cap-exporter.exe")
foreach ($installer in $installers) {
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop-gpui/locales/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,13 @@ quit_anyway = "Trotzdem beenden"
still_open = "Cap ist noch geöffnet"
unconfirmed = "Beenden abgebrochen, weil nicht bestätigt werden konnte, dass die Aufnahme beendet wurde. Cap bleibt geöffnet. Verwenden Sie „Stoppen“ und beenden Sie Cap dann erneut."

[dialog.startup]
failed = "{error}\n\nDetails wurden in {folder} gespeichert."
failed_title = "Cap konnte nicht gestartet werden"
quit_and_reopen = "Beenden und neu öffnen"
unresponsive = "Cap läuft bereits, reagiert aber nicht. Diese Instanz beenden und Cap neu öffnen?"
unresponsive_title = "Cap reagiert nicht"

[dialog.update]
already_getting = "Cap bereitet Version {version} bereits vor."
available = "Version {version} von Cap ist verfügbar. Cap lädt sie im Hintergrund herunter und informiert Sie, sobald sie installiert werden kann."
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop-gpui/locales/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,13 @@ quit_anyway = "Quit Anyway"
still_open = "Cap is still open"
unconfirmed = "Quit canceled because recording shutdown could not be confirmed. Cap will stay open. Use Stop, then try Quit again."

[dialog.startup]
failed = { text = "{error}\n\nDetails were saved in {folder}.", context = "{error} is a technical reason, usually in English. {folder} is a folder path." }
failed_title = "Cap couldn't start"
quit_and_reopen = { text = "Quit and Reopen", context = "Button: quit the copy of Cap that is not responding and start a new one." }
unresponsive = "Cap is already running but isn't responding. Quit that copy and open Cap again?"
unresponsive_title = "Cap isn't responding"

[dialog.update]
already_getting = { text = "Cap is already getting version {version} ready.", context = "{version} is a version number such as 0.6.2." }
available = { text = "Version {version} of Cap is available. Cap will download it in the background and let you know when it's ready to install.", context = "{version} is a version number such as 0.6.2." }
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop-gpui/locales/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,13 @@ quit_anyway = "Salir de todos modos"
still_open = "Cap sigue abierto"
unconfirmed = "Se canceló la salida porque no se pudo confirmar que la grabación se detuviera. Cap seguirá abierto. Usa Detener y vuelve a intentar salir."

[dialog.startup]
failed = "{error}\n\nLos detalles se guardaron en {folder}."
failed_title = "Cap no pudo iniciarse"
quit_and_reopen = "Salir y volver a abrir"
unresponsive = "Cap ya se está ejecutando, pero no responde. ¿Quieres cerrar esa copia y volver a abrir Cap?"
unresponsive_title = "Cap no responde"

[dialog.update]
already_getting = "Cap ya está preparando la versión {version}."
available = "La versión {version} de Cap está disponible. Cap la descargará en segundo plano y te avisará cuando esté lista para instalarse."
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop-gpui/locales/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,13 @@ quit_anyway = "Quitter quand même"
still_open = "Cap est toujours ouvert"
unconfirmed = "Fermeture annulée, car l'arrêt de l'enregistrement n'a pas pu être confirmé. Cap reste ouvert. Utilisez Arrêter, puis quittez à nouveau."

[dialog.startup]
failed = "{error}\n\nLes détails ont été enregistrés dans {folder}."
failed_title = "Cap n'a pas pu démarrer"
quit_and_reopen = "Quitter et rouvrir"
unresponsive = "Cap est déjà ouvert mais ne répond pas. Quitter cette instance et rouvrir Cap ?"
unresponsive_title = "Cap ne répond pas"

[dialog.update]
already_getting = "Cap prépare déjà la version {version}."
available = "La version {version} de Cap est disponible. Cap la télécharge en arrière-plan et vous prévient quand elle est prête à être installée."
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop-gpui/locales/hi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,13 @@ quit_anyway = "फिर भी बंद करें"
still_open = "Cap अभी भी खुला है"
unconfirmed = "रिकॉर्डिंग बंद होने की पुष्टि नहीं हो सकी, इसलिए बाहर निकलना रद्द किया गया। Cap खुला रहेगा। रोकें का इस्तेमाल करें, फिर दोबारा बाहर निकलने की कोशिश करें।"

[dialog.startup]
failed = "{error}\n\nविवरण {folder} में सहेजे गए हैं।"
failed_title = "Cap शुरू नहीं हो सका"
quit_and_reopen = "बंद करें और फिर से खोलें"
unresponsive = "Cap पहले से चल रहा है लेकिन जवाब नहीं दे रहा है। उसे बंद करके Cap फिर से खोलें?"
unresponsive_title = "Cap जवाब नहीं दे रहा है"

[dialog.update]
already_getting = "Cap पहले से ही वर्ज़न {version} तैयार कर रहा है।"
available = "Cap का वर्ज़न {version} उपलब्ध है। Cap इसे बैकग्राउंड में डाउनलोड करेगा और इंस्टॉल के लिए तैयार होने पर आपको बताएगा।"
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop-gpui/locales/ja.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,13 @@ quit_anyway = "それでも終了"
still_open = "Capはまだ開いています"
unconfirmed = "録画の停止を確認できなかったため、終了をキャンセルしました。Capは開いたままになります。「停止」を使ってから、もう一度終了してください。"

[dialog.startup]
failed = "{error}\n\n詳細は{folder}に保存されました。"
failed_title = "Capを起動できませんでした"
quit_and_reopen = "終了して再度開く"
unresponsive = "Capはすでに起動していますが、応答していません。そのCapを終了して、もう一度開きますか?"
unresponsive_title = "Capが応答していません"

[dialog.update]
already_getting = "Capはすでにバージョン{version}を準備しています。"
available = "Capのバージョン{version}が利用可能です。バックグラウンドでダウンロードし、インストールの準備ができたらお知らせします。"
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop-gpui/locales/zh-CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,13 @@ quit_anyway = "仍然退出"
still_open = "Cap 仍在运行"
unconfirmed = "无法确认录制已停止,已取消退出。Cap 将保持打开。请点击“停止”,然后再次尝试退出。"

[dialog.startup]
failed = "{error}\n\n详细信息已保存在 {folder}。"
failed_title = "Cap 无法启动"
quit_and_reopen = "退出并重新打开"
unresponsive = "Cap 已在运行,但没有响应。要退出它并重新打开 Cap 吗?"
unresponsive_title = "Cap 没有响应"

[dialog.update]
already_getting = "Cap 已在准备版本 {version}。"
available = "Cap {version} 版本现已推出。Cap 会在后台下载,并在可以安装时通知你。"
Expand Down
37 changes: 37 additions & 0 deletions apps/desktop-gpui/packaging/windows/installer-hooks.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,48 @@ SetCompressorDictSize 128
Pop $0
!macroend

; Any other cap-cli.exe or cap-muxer.exe running from this install holds the
; FFmpeg DLLs open. Copying over them failed with an Abort, Retry, Ignore
; prompt after Cap.exe was already replaced, so Abort or Ignore left a mix of
; versions on disk (and a silent install skipped the files). Nothing is copied
; until they have exited: the check waits up to 10 seconds, then asks the user
; to stop them, and a silent install or Cancel stops before any file changes.
; Starting PowerShell costs seconds, so it only runs when a process with either
; name exists. Exit code 2 means one from this install is still running; any
; other failure of the check keeps the previous behaviour of going ahead.
!macro WaitForCapCommandLineTools ABORT_TEXT
!define CapToolsCheck cap_tools_check_${__LINE__}
Push $0
Push $1
System::Call 'kernel32::SetEnvironmentVariable(t "CAP_INSTALL_DIR", t "$INSTDIR")i'
${CapToolsCheck}:
nsis_tauri_utils::FindProcessCurrentUser "cap-cli.exe"
Pop $0
${If} $0 != 0
nsis_tauri_utils::FindProcessCurrentUser "cap-muxer.exe"
Pop $0
${EndIf}
${If} $0 = 0
nsExec::ExecToStack `"$SYSDIR\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "try { $$dir = [IO.Path]::GetFullPath($$env:CAP_INSTALL_DIR).TrimEnd('\'); $$deadline = (Get-Date).AddSeconds(10); do { $$running = @(Get-CimInstance Win32_Process -ErrorAction Stop | Where-Object { ($$_.Name -eq 'cap-cli.exe' -or $$_.Name -eq 'cap-muxer.exe') -and $$_.ExecutablePath -and ([IO.Path]::GetDirectoryName($$_.ExecutablePath) -eq $$dir) }); if ($$running.Count -eq 0) { exit 0 }; Start-Sleep -Milliseconds 500 } while ((Get-Date) -lt $$deadline); exit 2 } catch { exit 0 }"`
Pop $0
Pop $1
${If} $0 == 2
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Cap's command line tool is still running, for example a recording started with cap record or an export. Stop it, then click Retry." /SD IDCANCEL IDRETRY ${CapToolsCheck}
Abort "${ABORT_TEXT}"
${EndIf}
${EndIf}
Pop $1
Pop $0
!undef CapToolsCheck
!macroend

; Cap 0.6.0 ran its GPUI app as cap-gpui.exe next to Cap.exe. The template
; only closes Cap.exe before copying files, so a running cap-gpui.exe would keep
; the shared FFmpeg DLLs locked and stop the update with a file-in-use error.
!macro NSIS_HOOK_PREINSTALL
!insertmacro CheckIfAppIsRunning "cap-gpui.exe" "${PRODUCTNAME}"
!insertmacro EndCapMcpServers
!insertmacro WaitForCapCommandLineTools "Cap was not updated because its command line tool is still running."
!macroend

!macro NSIS_HOOK_POSTINSTALL
Expand All @@ -34,4 +70,5 @@ SetCompressorDictSize 128

!macro NSIS_HOOK_PREUNINSTALL
!insertmacro EndCapMcpServers
!insertmacro WaitForCapCommandLineTools "Cap was not uninstalled because its command line tool is still running."
!macroend
7 changes: 7 additions & 0 deletions apps/desktop-gpui/src/crash_capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ fn record(text: &str) {
}
}

/// Written straight to the crash record: a failed launch exits before the
/// tracing queue drains.
pub fn record_startup_failure(error: &str) {
record(&format!("{} startup failed: {error}\n", now()));
}

const PREVIOUS_SESSION_ENDED: &str = "previous session ended without a clean quit";

/// The previous session's marker and, when there is one, the crash record
Expand Down Expand Up @@ -358,6 +364,7 @@ fn install_panic_hook() {
now()
));
tracing::error!(%thread, %location, %message, "panic");
crate::startup::report_panic(&message, &location);
previous(info);
}));
}
Expand Down
15 changes: 15 additions & 0 deletions apps/desktop-gpui/src/i18n/dialogs_surface_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const FORMATTED: &[&str] = &[
"transcription.download.file_progress",
"transcription.download.progress",
"dialog.quit.canceled",
"dialog.startup.failed",
"dialog.update.already_getting",
"dialog.update.available",
"dialog.update.check_failed",
Expand Down Expand Up @@ -836,6 +837,16 @@ fn dialog_surfaces_match_the_literals_they_replaced() {
"The Recommended and High Accuracy models only transcribe English and 24 other European languages. Download the Small or Medium model to caption this language",
),
(tr::dialog::quit::still_open(), "Cap is still open"),
(tr::dialog::startup::failed_title(), "Cap couldn't start"),
(tr::dialog::startup::quit_and_reopen(), "Quit and Reopen"),
(
tr::dialog::startup::unresponsive(),
"Cap is already running but isn't responding. Quit that copy and open Cap again?",
),
(
tr::dialog::startup::unresponsive_title(),
"Cap isn't responding",
),
(
tr::dialog::quit::files_kept(),
"Everything recorded so far stays in the recording's folder.",
Expand Down Expand Up @@ -1177,6 +1188,10 @@ fn update_and_quit_messages_format_like_the_code_they_replaced() {
tr::dialog::update::failed(error),
format!("{error}\n\nYou can always download the latest version from Cap.so/download."),
),
(
tr::dialog::startup::failed(error, "C:\\logs"),
format!("{error}\n\nDetails were saved in C:\\logs."),
),
];
for (translated, literal) in pairs {
assert_eq!(translated, literal);
Expand Down
13 changes: 7 additions & 6 deletions apps/desktop-gpui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ mod sign_in;
mod single_instance;
#[cfg(debug_assertions)]
mod snapshot;
mod startup;
mod store;
mod target_overlay;
mod target_thumbnails;
Expand Down Expand Up @@ -338,7 +339,7 @@ fn main() {
std::process::exit(status);
}

let _log_guard = init_logging();
startup::begin(init_logging());
crash_capture::install(&diagnostics::logs_dir());
#[cfg(target_os = "linux")]
if let Some(wayland_display) = stale_wayland_display {
Expand Down Expand Up @@ -479,11 +480,10 @@ fn main() {
move |window, cx| cx.new(|cx| MainWindow::new(session, window, cx))
},
)
.inspect_err(|error| tracing::error!("failed to open the main window: {error:#}"));
let Ok(window_handle) = window_handle else {
cx.quit();
return;
};
.unwrap_or_else(|error| {
startup::fail(format!("The main window could not be opened: {error:#}"))
});
startup::finished();

cx.on_app_quit(|_| async {
crash_capture::mark_clean_exit();
Expand Down Expand Up @@ -846,6 +846,7 @@ fn main() {
}
});
runtime.shutdown_background();
startup::flush_log();
}

#[cfg(all(
Expand Down
Loading
Loading