cli: use win32 app mutex to detect running tunnels and tunnel sevices (#179622)

* cli: fix distro mixin

* cli: use win32 app mutex to detect running tunnels and tunnel sevices

Fixes #179265

* cli: fix distro mixin more

* fix

* fix build
This commit is contained in:
Connor Peet
2023-04-10 12:25:14 -07:00
committed by GitHub
parent 116293e65e
commit b547b58db6
11 changed files with 104 additions and 8 deletions

View File

@@ -34,6 +34,26 @@ pub const VSCODE_CLI_COMMIT: Option<&'static str> = option_env!("VSCODE_CLI_COMM
pub const VSCODE_CLI_UPDATE_ENDPOINT: Option<&'static str> =
option_env!("VSCODE_CLI_UPDATE_ENDPOINT");
/// Windows lock name for the running tunnel service. Used by the setup script
/// to detect a tunnel process. See #179265.
pub const TUNNEL_SERVICE_LOCK_NAME: &str = concatcp!(
"code_tunnel_service_",
match VSCODE_CLI_QUALITY {
Some(n) => n,
None => "oss",
}
);
/// Windows lock name for the running tunnel without a service. Used by the setup
/// script to detect a tunnel process. See #179265.
pub const TUNNEL_NO_SERVICE_LOCK_NAME: &str = concatcp!(
"code_tunnel_",
match VSCODE_CLI_QUALITY {
Some(n) => n,
None => "oss",
}
);
pub const TUNNEL_SERVICE_USER_AGENT_ENV_VAR: &str = "TUNNEL_SERVICE_USER_AGENT";
/// Application name as it appears on the CLI.