mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
feat: build and publish Windows NSH packages with verified updates
This commit is contained in:
105 files changed
+6606
-798
No files matched your search
@@ -0,0 +1,32 @@
|
||||
//! Machine-wide service state shared by the daemon and desktop clients.
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn service_lock_file() -> PathBuf {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
PathBuf::from("/var/run/gpservice.lock")
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
std::env::var_os("ProgramData")
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|| PathBuf::from(r"C:\ProgramData"))
|
||||
.join("GP Connect")
|
||||
.join("gpservice.lock")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub const SERVICE_PIPE: &str = r"\\.\pipe\GPConnect.Service";
|
||||
|
||||
#[cfg(windows)]
|
||||
pub const SERVICE_NAME: &str = "GPConnect";
|
||||
|
||||
/// Installer-owned SYSTEM/Administrators-only state, including temporary keys.
|
||||
#[cfg(windows)]
|
||||
pub fn service_private_dir() -> PathBuf {
|
||||
service_lock_file()
|
||||
.parent()
|
||||
.expect("service state directory")
|
||||
.join("Private")
|
||||
}
|
||||
Reference in new issue
Block a user