some code are removed by mistake

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-06-05 15:21:42 +08:00
parent e541c4db69
commit d409e1147e

View File

@ -42,6 +42,7 @@ use winapi::{
winnt::{
TokenElevation, HANDLE, PROCESS_QUERY_LIMITED_INFORMATION, TOKEN_ELEVATION, TOKEN_QUERY,
},
winreg::HKEY_CURRENT_USER,
winuser::*,
},
};
@ -962,9 +963,14 @@ pub fn update_me() -> ResultType<()> {
fn get_after_install(exe: &str) -> String {
let app_name = crate::get_app_name();
let ext = app_name.to_lowercase();
// reg delete HKEY_CURRENT_USER\Software\Classes for
// https://github.com/rustdesk/rustdesk/commit/f4bdfb6936ae4804fc8ab1cf560db192622ad01a
// and https://github.com/leanflutter/uni_links_desktop/blob/1b72b0226cec9943ca8a84e244c149773f384e46/lib/src/protocol_registrar_impl_windows.dart#L30
let hcu = winreg::RegKey::predef(HKEY_CURRENT_USER);
hcu.delete_subkey_all(format!("Software\\Classes\\{}", exe))
.ok();
format!("
chcp 65001
reg add HKEY_CLASSES_ROOT\\.{ext} /f