File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/background/utils/integrity Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,19 @@ pub fn restart_as_appx() -> Result<!> {
7070 std:: process:: exit ( 0 ) ;
7171}
7272
73+ fn is_uac_enabled ( ) -> bool {
74+ use winreg:: { enums:: HKEY_LOCAL_MACHINE , RegKey } ;
75+ let hklm = RegKey :: predef ( HKEY_LOCAL_MACHINE ) ;
76+ let Ok ( key) = hklm. open_subkey ( r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" )
77+ else {
78+ return true ; // assume enabled if we can't read
79+ } ;
80+ let enable_lua: u32 = key. get_value ( "EnableLUA" ) . unwrap_or ( 1 ) ;
81+ enable_lua != 0
82+ }
83+
7384pub fn warn_if_elevated ( app : & tauri:: AppHandle ) {
74- if WindowsApi :: is_elevated ( ) . unwrap_or ( false ) {
85+ if is_uac_enabled ( ) && WindowsApi :: is_elevated ( ) . unwrap_or ( false ) {
7586 app. dialog ( )
7687 . message ( t ! ( "elevated.description" ) )
7788 . title ( t ! ( "elevated.title" ) )
You can’t perform that action at this time.
0 commit comments