Merge pull request #6475 from fufesou/feat/win10_virtual_display_not_support_msg

Feat/win10 virtual display not support msg
This commit is contained in:
RustDesk 2023-11-21 11:59:02 +08:00 committed by GitHub
commit f0c9deca4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 158 additions and 107 deletions

View File

@ -18,10 +18,10 @@ jobs:
upload-tag: ${{ env.GITHUB_REF_NAME }}
update-fdroid-version-file:
name: Publish Rustdesk version file for F-Droid updater
name: Publish RustDesk version file for F-Droid updater
runs-on: ubuntu-latest
steps:
- name: Generate Rustdesk version file
- name: Generate RustDesk version file
run: |
UPSTREAM_VERNAME="$GITHUB_REF_NAME"
UPSTREAM_VERCODE="$(echo "$UPSTREAM_VERNAME" | tr -d '.')"
@ -29,7 +29,7 @@ jobs:
echo "versionCode=$UPSTREAM_VERCODE" >> rustdesk-version.txt
shell: bash
- name: Publish Rustdesk version file
- name: Publish RustDesk version file
uses: softprops/action-gh-release@v1
with:
prerelease: true

View File

@ -161,7 +161,7 @@ target/debug/rustdesk
target/release/rustdesk
```
Βεβαιωθείτε ότι εκτελείτε αυτές τις εντολές από την αρχική διαδρομή του αποθετηρίου του Rustdesk, διαφορετικά η εφαρμογή ενδέχεται να μην είναι σε θέση να βρεί τους απαιτούμενους πόρους. Σημειώστε επίσης ότι άλλες υποεντολές, όπως το `install` ή το `run` δεν υποστηρίζονται επί του παρόντος μέσω αυτής της μεθόδου καθώς θα εγκαταστήσουν ή θα εκτελέσουν το πρόγραμμα εντός του container αντί του κεντρικού υπολογιστή.
Βεβαιωθείτε ότι εκτελείτε αυτές τις εντολές από την αρχική διαδρομή του αποθετηρίου του RustDesk, διαφορετικά η εφαρμογή ενδέχεται να μην είναι σε θέση να βρεί τους απαιτούμενους πόρους. Σημειώστε επίσης ότι άλλες υποεντολές, όπως το `install` ή το `run` δεν υποστηρίζονται επί του παρόντος μέσω αυτής της μεθόδου καθώς θα εγκαταστήσουν ή θα εκτελέσουν το πρόγραμμα εντός του container αντί του κεντρικού υπολογιστή.
## Δομή φακέλων

View File

@ -54,7 +54,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
for (const auto& argument : command_line_arguments) {
args_str += (argument + " ");
}
// std::cout << "Rustdesk [" << args_str << "], core returns false, exiting without launching Flutter app." << std::endl;
// std::cout << "RustDesk [" << args_str << "], core returns false, exiting without launching Flutter app." << std::endl;
return EXIT_SUCCESS;
}
std::vector<std::string> rust_args(c_args, c_args + args_len);

View File

@ -5,7 +5,7 @@ use std::{
time::Instant,
};
use winapi::{
shared::minwindef::{DWORD, FALSE},
shared::minwindef::{DWORD, FALSE, TRUE},
um::{
handleapi::CloseHandle,
pdh::{
@ -14,7 +14,12 @@ use winapi::{
PDH_HCOUNTER, PDH_HQUERY,
},
synchapi::{CreateEventA, WaitForSingleObject},
winbase::{INFINITE, WAIT_OBJECT_0},
sysinfoapi::VerSetConditionMask,
winbase::{VerifyVersionInfoW, INFINITE, WAIT_OBJECT_0},
winnt::{
OSVERSIONINFOEXW, VER_BUILDNUMBER, VER_GREATER_EQUAL, VER_MAJORVERSION,
VER_MINORVERSION, VER_SERVICEPACKMAJOR, VER_SERVICEPACKMINOR,
},
},
};
@ -152,3 +157,43 @@ pub fn sync_cpu_usage(cpu_usage: Option<f64>) {
*CPU_USAGE_ONE_MINUTE.lock().unwrap() = v;
log::info!("cpu usage synced: {:?}", cpu_usage);
}
// https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1
// https://github.com/nodejs/node-convergence-archive/blob/e11fe0c2777561827cdb7207d46b0917ef3c42a7/deps/uv/src/win/util.c#L780
pub fn is_windows_version_or_greater(
os_major: u32,
os_minor: u32,
build_number: u32,
service_pack_major: u32,
service_pack_minor: u32,
) -> bool {
let mut osvi: OSVERSIONINFOEXW = unsafe { std::mem::zeroed() };
osvi.dwOSVersionInfoSize = std::mem::size_of::<OSVERSIONINFOEXW>() as DWORD;
osvi.dwMajorVersion = os_major as _;
osvi.dwMinorVersion = os_minor as _;
osvi.dwBuildNumber = build_number as _;
osvi.wServicePackMajor = service_pack_major as _;
osvi.wServicePackMinor = service_pack_minor as _;
let result = unsafe {
let mut condition_mask = 0;
let op = VER_GREATER_EQUAL;
condition_mask = VerSetConditionMask(condition_mask, VER_MAJORVERSION, op);
condition_mask = VerSetConditionMask(condition_mask, VER_MINORVERSION, op);
condition_mask = VerSetConditionMask(condition_mask, VER_BUILDNUMBER, op);
condition_mask = VerSetConditionMask(condition_mask, VER_SERVICEPACKMAJOR, op);
condition_mask = VerSetConditionMask(condition_mask, VER_SERVICEPACKMINOR, op);
VerifyVersionInfoW(
&mut osvi as *mut OSVERSIONINFOEXW,
VER_MAJORVERSION
| VER_MINORVERSION
| VER_BUILDNUMBER
| VER_SERVICEPACKMAJOR
| VER_SERVICEPACKMINOR,
condition_mask,
)
};
result == TRUE
}

View File

@ -12,7 +12,7 @@ use std::sync::Mutex;
#[cfg(windows)]
lazy_static::lazy_static! {
// If device is uninstalled though "Device Manager" Window.
// Rustdesk is unable to handle device any more...
// RustDesk is unable to handle device any more...
static ref H_SW_DEVICE: Mutex<u64> = Mutex::new(0);
}

View File

@ -204,7 +204,9 @@ pub fn core_main() -> Option<Vec<String>> {
#[cfg(windows)]
hbb_common::allow_err!(crate::platform::windows::install_cert(&args[1]));
#[cfg(all(windows, feature = "virtual_display_driver"))]
hbb_common::allow_err!(crate::virtual_display_manager::install_update_driver());
if crate::virtual_display_manager::is_virtual_display_supported() {
hbb_common::allow_err!(crate::virtual_display_manager::install_update_driver());
}
return None;
} else if args[0] == "--uninstall-cert" {
#[cfg(windows)]

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -537,7 +537,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Reverse mouse wheel", "鼠标滚轮反向"),
("{} sessions", "{}个会话"),
("scam_title", "你可能被骗了!"),
("scam_text1", "如果你正在和素不相识的人通话,而对方要求你使用 Rustdesk 启动服务,请勿继续操作并立刻挂断电话。"),
("scam_text1", "如果你正在和素不相识的人通话,而对方要求你使用 RustDesk 启动服务,请勿继续操作并立刻挂断电话。"),
("scam_text2", "他们很可能是骗子,试图窃取您的钱财或其他个人信息。"),
("Don't show again", "下次不再显示"),
("I Agree", "同意"),
@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "模式 2"),
("Enter privacy mode", "进入隐私模式"),
("Exit privacy mode", "退出隐私模式"),
("idd_not_support_under_win10_2004_tip", "不支持 Indirect display driver 。需要 windows 10, version 2004 及更高的版本。"),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -150,8 +150,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Click to download", "Klik for at downloade"),
("Click to update", "Klik for at opdatere"),
("Configure", "Konfigurer"),
("config_acc", "For at kontrollere dit skrivebord på afstand skal du give Rustdesk \"Access \" Rettigheder."),
("config_screen", "For at kunne få adgang til dit skrivebord langtfra, skal du give Rustdesk \"skærmstøtte \" tilladelser."),
("config_acc", "For at kontrollere dit skrivebord på afstand skal du give RustDesk \"Access \" Rettigheder."),
("config_screen", "For at kunne få adgang til dit skrivebord langtfra, skal du give RustDesk \"skærmstøtte \" tilladelser."),
("Installing ...", "Installerer ..."),
("Install", "installere"),
("Installation", "Installation"),
@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -205,5 +205,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("id_input_tip", "You can input an ID, a direct IP, or a domain with a port (<domain>:<port>).\nIf you want to access a device on another server, please append the server address (<id>@<server_address>?key=<key_value>), for example,\n9123456234@192.168.16.1:21117?key=5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=.\nIf you want to access a device on a public server, please input \"<id>@public\", the key is not needed for public server"),
("privacy_mode_impl_mag_tip", "Mode 1"),
("privacy_mode_impl_virtual_display_tip", "Mode 2"),
("idd_not_support_under_win10_2004_tip", "Indirect display driver is not supported. Windows 10, version 2004 or newer is required."),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "Modo 2"),
("Enter privacy mode", "Entrar al modo privado"),
("Exit privacy mode", "Salir del modo privado"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "Mode 2"),
("Enter privacy mode", "Masuk mode privasi"),
("Exit privacy mode", "Keluar mode privasi"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "Modo 2"),
("Enter privacy mode", "Entra in modalità privacy"),
("Exit privacy mode", "Esci dalla modalità privacy"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "모드 2"),
("Enter privacy mode", "개인정보 보호 모드 사용"),
("Exit privacy mode", "개인정보 보호 모드 종료"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "2. režīms"),
("Enter privacy mode", "Ieiet privātuma režīmā"),
("Exit privacy mode", "Iziet no privātuma režīma"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -150,19 +150,19 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Click to download", "Klikk for å laste ned"),
("Click to update", "Klikk for å oppdatere"),
("Configure", "Konfigurer"),
("config_acc", "For å kontrollere ditt skrivebord med fjernstyring må du gi Rustdesk \"Access \" Rettigheter."),
("config_screen", "For å kunne få adgang til ditt skrivebord med fjernstyring, må du gi Rustdesk \"skjerstøtte \" tillatelser."),
("config_acc", "For å kontrollere ditt skrivebord med fjernstyring må du gi RustDesk \"Access \" Rettigheter."),
("config_screen", "For å kunne få adgang til ditt skrivebord med fjernstyring, må du gi RustDesk \"skjerstøtte \" tillatelser."),
("Installing ...", "Installerer ..."),
("Install", "installer"),
("installasjon", "Installasjon"),
("installasjon Path", "Installasjonssti"),
("Installation", "Installasjon"),
("Installation Path", "Installasjonssti"),
("Create start menu shortcuts", "Oppret start meny snarvei"),
("Create desktop icon", "Oppret skrivebords-snarvei"),
("agreement_tip", "Hvis du starter installasjonen, må du akseptere lisensavtalen"),
("Accept and Install", "Aksepter og installer"),
("End-user license agreement", "Lisensavtale for sluttbrukere"),
("Generating ...", "Genererer kode ..."),
("Your installasjon is lower version.", "Din installasjon er en eldre versjon."),
("Your installation is lower version.", "Din installasjon er en eldre versjon."),
("not_close_tcp_tip", "Ikke lukk dette vinduet, mens du bruker tunnelen."),
("Listening ...", "Lytter ..."),
("Remote Host", "Fjern-Host"),
@ -532,8 +532,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("installasjon Successful!", ""),
("installasjon failed!", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
("Reverse mouse wheel", ""),
("{} sessions", ""),
("scam_title", ""),
@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "Tryb 2"),
("Enter privacy mode", "Wejdź w tryb prywatności"),
("Exit privacy mode", "Wyjdź z trybu prywatności"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "Режим 2"),
("Enter privacy mode", "Включить режим конфиденциальности"),
("Exit privacy mode", "Отключить режим конфиденциальности"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -145,7 +145,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Failed to make direct connection to remote desktop", "Lidhja direkte me desktopin në distancë dështoi"),
("Set Password", "Vendosni fjalëkalimin"),
("OS Password", "OS fjalëkalim"),
("install_tip", "Për shkak të UAC, Rustdesk nuk mund të punoj sic duhet si nje remote në distancë në disa raste. Për të shamngur UAC, ju lutem klikoni butonin më poshtë për të instaluar RustDesk në sistem."),
("install_tip", "Për shkak të UAC, RustDesk nuk mund të punoj sic duhet si nje remote në distancë në disa raste. Për të shamngur UAC, ju lutem klikoni butonin më poshtë për të instaluar RustDesk në sistem."),
("Click to upgrade", "Klikoni për përmirësim"),
("Click to download", "Klikoni për tu shkarkuar"),
("Click to update", "Klikoni për përditësim"),
@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -411,15 +411,15 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Select local keyboard type", "เลือกประเภทคีย์บอร์ด"),
("software_render_tip", "ถ้าคุณใช้กราฟิกการ์ดกับระบบ Linux และหน้าต่างของเครื่องปลายทางปิดในทันทีหลังจากการเชื่อมต่อ การเปลี่ยนไปใช้ไดรเวอร์ Nouveau และเลือกใช้โหมดการเรนเดอร์แบบซอฟท์แวร์อาจช่วยได้ (ต้องรีสตาร์ทโปรแกรม)"),
("Always use software rendering", "ใช้การเรนเดอร์แบบซอฟท์แวร์เสมอ"),
("config_input", "เพื่อที่จะควบคุมเครื่องเดสก์ท็อปปลายทางด้วยคีย์บอร์ด คุณจำเป็นจะต้องอนุญาตสิทธิ์ \"การตรวจสอบ Input\" ให้แก่ Rustdesk"),
("config_microphone", "เพื่อที่จะส่งเสียงพูดไปยังปลายทาง คุณจำเป็นจะต้องอนุญาตสิทธิ์ \"การบันทึกเสียง\" ให้แก่ Rustdesk"),
("config_input", "เพื่อที่จะควบคุมเครื่องเดสก์ท็อปปลายทางด้วยคีย์บอร์ด คุณจำเป็นจะต้องอนุญาตสิทธิ์ \"การตรวจสอบ Input\" ให้แก่ RustDesk"),
("config_microphone", "เพื่อที่จะส่งเสียงพูดไปยังปลายทาง คุณจำเป็นจะต้องอนุญาตสิทธิ์ \"การบันทึกเสียง\" ให้แก่ RustDesk"),
("request_elevation_tip", "คุณสามารถขอยกระดับสิทธิ์การใช้งานได้ หากมีผู้ใช้งานอยู่ในฝั่งเครื่องปลายทาง"),
("Wait", "รอ"),
("Elevation Error", "การยกระดับสิทธิ์การใช้งานผิดพลาด"),
("Ask the remote user for authentication", "ขอความช่วยเหลือผู้ใช้งานปลายทางเพื่อพิสูจน์ตัวตน"),
("Choose this if the remote account is administrator", "เลือกข้อนี้ถ้าบัญชีผู้ใช้งานปลายทางเป็นผู้ดูแลระบบ"),
("Transmit the username and password of administrator", "ส่งข้อมูลผู้ใช้งานและรหัสผ่านของผู้ดูแลระบบ"),
("still_click_uac_tip", "ผู้ใช้งานปลายทางยังจำเป็นที่จะต้องกดปุ่ม ตกลง บนหน้าต่าง UAC ของ Rustdesk"),
("still_click_uac_tip", "ผู้ใช้งานปลายทางยังจำเป็นที่จะต้องกดปุ่ม ตกลง บนหน้าต่าง UAC ของ RustDesk"),
("Request Elevation", "ขอยกระดับสิทธิ์การใช้งาน"),
("wait_accept_uac_tip", "กรุณารอผู้ใช้งานปลายทางกดยินยอมหน้าต่าง UAC"),
("Elevate successfully", "การยกระดับสิทธิ์การใช้งานสำเร็จ"),
@ -451,8 +451,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Resolution", "ความละเอียด"),
("No transfers in progress", "ไม่มีการถ่ายโอนในขณะนี้"),
("Set one-time password length", "ตั้งค่าความยาวรหัสผ่านครั้งเดียว"),
("install_cert_tip", "ติดตั้งใบรับรองของ Rustdesk"),
("confirm_install_cert_tip", "นี่คือใบรับของทดสอบของ Rustdesk ซึ่งสามารถเชื่อถือได้ ใบรับรองนี้จะถูกใช้ในการติดตั้ง Driver ของ Rustdesk เมื่อจำเป็น"),
("install_cert_tip", "ติดตั้งใบรับรองของ RustDesk"),
("confirm_install_cert_tip", "นี่คือใบรับของทดสอบของ RustDesk ซึ่งสามารถเชื่อถือได้ ใบรับรองนี้จะถูกใช้ในการติดตั้ง Driver ของ RustDesk เมื่อจำเป็น"),
("RDP Settings", "การตั้งค่า RDP"),
("Sort by", "เรียงลำดับโดย"),
("New Connection", "การเชื่อมต่อใหม่"),
@ -472,7 +472,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("show_monitors_tip", "แสดงหน้าจอในแถบเครื่องมือ"),
("View Mode", "โหมดการดู"),
("login_linux_tip", "คุณจำเป็นจะต้องเข้าสู่ระบบไปยังบัญชีลินุกซ์ปลายทางเพื่อใช้งานเดสก์ท็อปเซสชัน X"),
("verify_rustdesk_password_tip", "ยืนยันความถูกต้องรหัสผ่านของ Rustdesk"),
("verify_rustdesk_password_tip", "ยืนยันความถูกต้องรหัสผ่านของ RustDesk"),
("remember_account_tip", "จดจำบัญชีนี้"),
("os_account_desk_tip", "บัญชีนี้จะถูกใช้ในการเข้าสู่ระบบเครื่องปลายทางและเริ่มใช้งานเดสก์ท็อปเซสชันแบบ headless"),
("OS Account", "บัญชีระบบปฏิบัติการ"),
@ -537,7 +537,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Reverse mouse wheel", "เลื่อมลูกกลิ้งเมาส์แบบกลับด้าน"),
("{} sessions", "{} เซสชัน"),
("scam_title", "คุณอาจกำลังถูกหลอกลวง!"),
("scam_text1", "ถ้าคุณกำลังคุยโทรศัพท์กับคนที่คุณไม่รู้จักและไม่ไว้ใจ และคนๆนั้นกำลังขอให้คุณเปิดใช้งาน Rustdesk อย่าทำตามและรีบวางสายในทันที"),
("scam_text1", "ถ้าคุณกำลังคุยโทรศัพท์กับคนที่คุณไม่รู้จักและไม่ไว้ใจ และคนๆนั้นกำลังขอให้คุณเปิดใช้งาน RustDesk อย่าทำตามและรีบวางสายในทันที"),
("scam_text2", "เขาเหล่านั้นอาจเป็นมิจฉาชีพที่กำลังพยายามจะขโมยเงินและข้อมูลส่วนตัวของคุณ"),
("Don't show again", "อย่าแสดงอีก"),
("I Agree", "ยอมรับ"),
@ -546,7 +546,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("auto_disconnect_option_tip", "ยกเลิกการเชื่อมต่ออัตโนมัติในกรณีที่ผู้ใช้งานไม่มีการเคลื่อนไหว"),
("Connection failed due to inactivity", "การเชื่อมต่อล้มเหลวเนื่องจากไม่มีการเคลื่อนไหว"),
("Check for software update on startup", "ตรวจสอบการอัปเดตโปรแกรมเมื่อเริ่มต้นใช้งาน"),
("upgrade_rustdesk_server_pro_to_{}_tip", "กรุณาอัปเดต Rustdesk Server Pro ไปยังเวอร์ชัน {} หรือใหม่กว่า!"),
("upgrade_rustdesk_server_pro_to_{}_tip", "กรุณาอัปเดต RustDesk Server Pro ไปยังเวอร์ชัน {} หรือใหม่กว่า!"),
("pull_group_failed_tip", "การเรียกใช้งานกลุ่มล้มเหลว"),
("Filter by intersection", ""),
("Remove wallpaper during incoming sessions", ""),
@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -411,7 +411,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Select local keyboard type", "Оберіть тип локальної клавіатури"),
("software_render_tip", "Якщо ви використовуєте відеокарту Nvidia на Linux, і віддалене вікно закривається відразу після підключення, то перехід на вільний драйвер Nouveau та увімкнення програмного рендерингу може допомогти. Для застосування змін необхідно перезапустити програму."),
("Always use software rendering", "Завжди використовувати програмний рендеринг"),
("config_input", "Для віддаленого керування віддаленою стільницею з клавіатури, вам необхідно надати Rustdesk дозволи на \"Відстеження введення\""),
("config_input", "Для віддаленого керування віддаленою стільницею з клавіатури, вам необхідно надати RustDesk дозволи на \"Відстеження введення\""),
("config_microphone", "Для можливості віддаленої розмови, вам необхідно надати RustDesk дозвіл на \"Запис аудіо\""),
("request_elevation_tip", "Ви також можете надіслати запит на розширення прав, в разі присутності особи з віддаленого боку."),
("Wait", "Зачекайте"),
@ -451,8 +451,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Resolution", "Роздільна здатність"),
("No transfers in progress", "Наразі нічого не пересилається"),
("Set one-time password length", "Вказати довжину одноразового пароля"),
("install_cert_tip", "Додати сертифікат Rustdesk"),
("confirm_install_cert_tip", "Це сертифікат тестування Rustdesk, якому можна довіряти. За потреби сертифікат буде використано для погодження та встановлення драйверів Rustdesk."),
("install_cert_tip", "Додати сертифікат RustDesk"),
("confirm_install_cert_tip", "Це сертифікат тестування RustDesk, якому можна довіряти. За потреби сертифікат буде використано для погодження та встановлення драйверів RustDesk."),
("RDP Settings", "Налаштування RDP"),
("Sort by", "Сортувати за"),
("New Connection", "Нове підключення"),
@ -472,7 +472,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("show_monitors_tip", "Показувати монітори на панелі інструментів"),
("View Mode", "Режим перегляду"),
("login_linux_tip", "Вам необхідно залогуватися у віддалений акаунт Linux, щоб увімкнути стільничний сеанс X"),
("verify_rustdesk_password_tip", "Перевірте пароль Rustdesk"),
("verify_rustdesk_password_tip", "Перевірте пароль RustDesk"),
("remember_account_tip", "Запамʼятати цей акаунт"),
("os_account_desk_tip", "Цей акаунт використовується для входу до віддаленої ОС та вмикання сеансу стільниці в неграфічному режимі"),
("OS Account", "Користувач ОС"),
@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", "Режим 2"),
("Enter privacy mode", "Увійти в режим конфіденційності"),
("Exit privacy mode", "Вийти з режиму конфіденційності"),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -572,5 +572,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("privacy_mode_impl_virtual_display_tip", ""),
("Enter privacy mode", ""),
("Exit privacy mode", ""),
("idd_not_support_under_win10_2004_tip", ""),
].iter().cloned().collect();
}

View File

@ -634,42 +634,3 @@ extern "C"
freopen("CONOUT$", "w", stdout);
}
} // end of extern "C"
extern "C"
{
// https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1
// https://github.com/nodejs/node-convergence-archive/blob/e11fe0c2777561827cdb7207d46b0917ef3c42a7/deps/uv/src/win/util.c#L780
BOOL IsWindowsVersionOrGreater(DWORD os_major,
DWORD os_minor,
DWORD build_number,
WORD service_pack_major,
WORD service_pack_minor)
{
OSVERSIONINFOEX osvi;
DWORDLONG condition_mask = 0;
int op = VER_GREATER_EQUAL;
/* Initialize the OSVERSIONINFOEX structure. */
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
osvi.dwMajorVersion = os_major;
osvi.dwMinorVersion = os_minor;
osvi.dwBuildNumber = build_number;
osvi.wServicePackMajor = service_pack_major;
osvi.wServicePackMinor = service_pack_minor;
/* Initialize the condition mask. */
VER_SET_CONDITION(condition_mask, VER_MAJORVERSION, op);
VER_SET_CONDITION(condition_mask, VER_MINORVERSION, op);
VER_SET_CONDITION(condition_mask, VER_BUILDNUMBER, op);
VER_SET_CONDITION(condition_mask, VER_SERVICEPACKMAJOR, op);
VER_SET_CONDITION(condition_mask, VER_SERVICEPACKMINOR, op);
/* Perform the test. */
return VerifyVersionInfo(
&osvi,
VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER |
VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
condition_mask);
}
}

View File

@ -460,13 +460,6 @@ extern "C" {
fn is_win_down() -> BOOL;
fn is_local_system() -> BOOL;
fn alloc_console_and_redirect();
fn IsWindowsVersionOrGreater(
os_major: DWORD,
os_minor: DWORD,
build_number: DWORD,
service_pack_major: WORD,
service_pack_minor: WORD,
) -> BOOL;
}
extern "system" {
@ -1255,25 +1248,6 @@ pub fn block_input(v: bool) -> (bool, String) {
}
}
#[inline]
pub fn is_windows_version_or_greater(
os_major: u32,
os_minor: u32,
build_number: u32,
service_pack_major: u32,
service_pack_minor: u32,
) -> bool {
unsafe {
IsWindowsVersionOrGreater(
os_major as _,
os_minor as _,
build_number as _,
service_pack_major as _,
service_pack_minor as _,
) == TRUE
}
}
pub fn add_recent_document(path: &str) {
extern "C" {
fn AddRecentDocument(path: *const u16);

View File

@ -1,3 +1,5 @@
use hbb_common::platform::windows::is_windows_version_or_greater;
pub use super::win_topmost_window::PrivacyModeImpl;
pub(super) const PRIVACY_MODE_IMPL: &str = "privacy_mode_impl_exclude_from_capture";
@ -5,5 +7,5 @@ pub(super) const PRIVACY_MODE_IMPL: &str = "privacy_mode_impl_exclude_from_captu
pub(super) fn is_supported() -> bool {
// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity
// https://en.wikipedia.org/wiki/Windows_10_version_history
crate::platform::windows::is_windows_version_or_greater(10, 0, 19041, 0, 0)
is_windows_version_or_greater(10, 0, 19041, 0, 0)
}

View File

@ -357,6 +357,10 @@ impl PrivacyMode for PrivacyModeImpl {
}
fn turn_on_privacy(&mut self, conn_id: i32) -> ResultType<bool> {
if !virtual_display_manager::is_virtual_display_supported() {
bail!("idd_not_support_under_win10_2004_tip");
}
if self.check_on_conn_id(conn_id)? {
log::debug!("Privacy mode of conn {} is already on", conn_id);
return Ok(true);

View File

@ -2371,14 +2371,19 @@ impl Connection {
};
if t.on {
if let Err(e) = virtual_display_manager::plug_in_index_modes(t.display as _, Vec::new())
{
log::error!("Failed to plug in virtual display: {}", e);
self.send(make_msg(format!(
"Failed to plug in virtual display: {}",
e
)))
.await;
if !virtual_display_manager::is_virtual_display_supported() {
self.send(make_msg("idd_not_support_under_win10_2004_tip".to_string())).await;
} else {
if let Err(e) =
virtual_display_manager::plug_in_index_modes(t.display as _, Vec::new())
{
log::error!("Failed to plug in virtual display: {}", e);
self.send(make_msg(format!(
"Failed to plug in virtual display: {}",
e
)))
.await;
}
}
} else {
let indices = if t.display == -1 {

View File

@ -348,7 +348,10 @@ pub fn try_get_displays() -> ResultType<Vec<Display>> {
#[cfg(all(windows, feature = "virtual_display_driver"))]
pub fn try_get_displays() -> ResultType<Vec<Display>> {
let mut displays = Display::all()?;
if crate::platform::is_installed() && no_displays(&displays) {
if crate::platform::is_installed()
&& no_displays(&displays)
&& virtual_display_manager::is_virtual_display_supported()
{
log::debug!("no displays, create virtual display");
if let Err(e) = virtual_display_manager::plug_in_headless() {
log::error!("plug in headless failed {}", e);

View File

@ -1,3 +1,5 @@
#[cfg(target_os = "windows")]
use hbb_common::platform::windows::is_windows_version_or_greater;
use hbb_common::{allow_err, bail, lazy_static, log, ResultType};
use std::{
collections::{HashMap, HashSet},
@ -53,6 +55,17 @@ impl VirtualDisplayManager {
}
}
pub fn is_virtual_display_supported() -> bool {
#[cfg(target_os = "windows")]
{
is_windows_version_or_greater(10, 0, 19041, 0, 0)
}
#[cfg(not(target_os = "windows"))]
{
false
}
}
pub fn install_update_driver() -> ResultType<()> {
VIRTUAL_DISPLAY_MANAGER
.lock()
@ -146,6 +159,10 @@ pub fn plug_in_index_modes(
}
pub fn reset_all() -> ResultType<()> {
if is_virtual_display_supported() {
return Ok(());
}
if let Err(e) = plug_out_peer_request(&get_virtual_displays()) {
log::error!("Failed to plug out virtual displays: {}", e);
}