move removing hkey_current_user out
This commit is contained in:
		
							parent
							
								
									8baa00b68d
								
							
						
					
					
						commit
						48f574619e
					
				| @ -42,6 +42,7 @@ use winapi::{ | |||||||
|         winnt::{ |         winnt::{ | ||||||
|             TokenElevation, HANDLE, PROCESS_QUERY_LIMITED_INFORMATION, TOKEN_ELEVATION, TOKEN_QUERY, |             TokenElevation, HANDLE, PROCESS_QUERY_LIMITED_INFORMATION, TOKEN_ELEVATION, TOKEN_QUERY, | ||||||
|         }, |         }, | ||||||
|  |         winreg::HKEY_CURRENT_USER, | ||||||
|         winuser::*, |         winuser::*, | ||||||
|     }, |     }, | ||||||
| }; | }; | ||||||
| @ -962,9 +963,14 @@ pub fn update_me() -> ResultType<()> { | |||||||
| fn get_after_install(exe: &str) -> String { | fn get_after_install(exe: &str) -> String { | ||||||
|     let app_name = crate::get_app_name(); |     let app_name = crate::get_app_name(); | ||||||
|     let ext = app_name.to_lowercase(); |     let ext = app_name.to_lowercase(); | ||||||
|  | 
 | ||||||
|     // reg delete HKEY_CURRENT_USER\Software\Classes for
 |     // reg delete HKEY_CURRENT_USER\Software\Classes for
 | ||||||
|     // https://github.com/rustdesk/rustdesk/commit/f4bdfb6936ae4804fc8ab1cf560db192622ad01a
 |     // 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
 |     // 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!(" |     format!(" | ||||||
|     chcp 65001 |     chcp 65001 | ||||||
|     reg add HKEY_CLASSES_ROOT\\.{ext} /f |     reg add HKEY_CLASSES_ROOT\\.{ext} /f | ||||||
| @ -974,7 +980,6 @@ fn get_after_install(exe: &str) -> String { | |||||||
|     reg add HKEY_CLASSES_ROOT\\.{ext}\\shell\\open /f |     reg add HKEY_CLASSES_ROOT\\.{ext}\\shell\\open /f | ||||||
|     reg add HKEY_CLASSES_ROOT\\.{ext}\\shell\\open\\command /f |     reg add HKEY_CLASSES_ROOT\\.{ext}\\shell\\open\\command /f | ||||||
|     reg add HKEY_CLASSES_ROOT\\.{ext}\\shell\\open\\command /f /ve /t REG_SZ /d \"\\\"{exe}\\\" --play \\\"%%1\\\"\" |     reg add HKEY_CLASSES_ROOT\\.{ext}\\shell\\open\\command /f /ve /t REG_SZ /d \"\\\"{exe}\\\" --play \\\"%%1\\\"\" | ||||||
|     reg delete HKEY_CURRENT_USER\\Software\\Classes\\{exe} /f |  | ||||||
|     reg add HKEY_CLASSES_ROOT\\{ext} /f |     reg add HKEY_CLASSES_ROOT\\{ext} /f | ||||||
|     reg add HKEY_CLASSES_ROOT\\{ext} /f /v \"URL Protocol\" /t REG_SZ /d \"\" |     reg add HKEY_CLASSES_ROOT\\{ext} /f /v \"URL Protocol\" /t REG_SZ /d \"\" | ||||||
|     reg add HKEY_CLASSES_ROOT\\{ext}\\shell /f |     reg add HKEY_CLASSES_ROOT\\{ext}\\shell /f | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user