mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Fix/win query arch (#7786)
* fix: win, query arch with GetNativeSystemInfo Signed-off-by: fufesou <shuanglongchen@yeah.net> * refact: idd, ci Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -42,6 +42,7 @@ use winapi::{
|
||||
},
|
||||
securitybaseapi::GetTokenInformation,
|
||||
shellapi::ShellExecuteW,
|
||||
sysinfoapi::{GetNativeSystemInfo, SYSTEM_INFO},
|
||||
winbase::*,
|
||||
wingdi::*,
|
||||
winnt::{
|
||||
@@ -2370,9 +2371,16 @@ impl Drop for WallPaperRemover {
|
||||
}
|
||||
|
||||
pub fn get_amyuni_exe_name() -> Option<String> {
|
||||
let exe = match std::env::consts::ARCH {
|
||||
"x86" => "deviceinstaller.exe",
|
||||
"x86_64" => "deviceinstaller64.exe",
|
||||
let mut sys_info = SYSTEM_INFO::default();
|
||||
unsafe {
|
||||
GetNativeSystemInfo(&mut sys_info as _);
|
||||
}
|
||||
const PROCESSOR_ARCHITECTURE_INTEL: u16 = 0;
|
||||
const PROCESSOR_ARCHITECTURE_AMD64: u16 = 9;
|
||||
|
||||
let exe = match unsafe { sys_info.u.s().wProcessorArchitecture } {
|
||||
PROCESSOR_ARCHITECTURE_INTEL => "deviceinstaller.exe",
|
||||
PROCESSOR_ARCHITECTURE_AMD64 => "deviceinstaller64.exe",
|
||||
_ => {
|
||||
log::error!("Unsupported machine architecture");
|
||||
return None;
|
||||
|
||||
Reference in New Issue
Block a user