@@ -54,37 +54,36 @@ pub fn get_apps_from_registry(apps: &mut Vec<App>) {
5454 // let publisher = key.get_value("Publisher").unwrap_or(OsString::new());
5555 // let version = key.get_value("DisplayVersion").unwrap_or(OsString::new());
5656
57- // Trick, I saw on internet to point to the exe location..
58- let exe_path: OsString = key. get_value ( "DisplayIcon" ) . unwrap_or_default ( ) ;
59- if exe_path. is_empty ( ) {
60- return ;
61- }
62- // if there is something, it will be in the form of
63- // "C:\Program Files\Microsoft Office\Office16\WINWORD.EXE",0
64- let exe_path = exe_path. to_string_lossy ( ) . to_string ( ) ;
65- let exe = PathBuf :: from ( exe_path. split ( "," ) . next ( ) . unwrap ( ) ) ;
66-
67- // make sure it ends with .exe
68- if exe. extension ( ) != Some ( & OsString :: from ( "exe" ) ) {
69- return ;
70- }
57+ // Trick, I saw on internet to point to the exe location..
58+ let exe_path: OsString = key. get_value ( "DisplayIcon" ) . unwrap_or_default ( ) ;
59+ if exe_path. is_empty ( ) {
60+ return ;
61+ }
62+ // if there is something, it will be in the form of
63+ // "C:\Program Files\Microsoft Office\Office16\WINWORD.EXE",0
64+ let exe_path = exe_path. to_string_lossy ( ) . to_string ( ) ;
65+ let exe = PathBuf :: from ( exe_path. split ( "," ) . next ( ) . unwrap ( ) ) ;
66+
67+ // make sure it ends with .exe
68+ if exe. extension ( ) != Some ( & OsString :: from ( "exe" ) ) {
69+ return ;
70+ }
7171
72- if !display_name. is_empty ( ) {
73- let icon = get_first_icon ( & exe)
74- . inspect_err ( |e| tracing:: error!( "Error getting icons: {e}" ) )
75- . ok ( )
76- . flatten ( ) ;
77-
78- apps. push ( App :: new_executable (
79- & display_name. clone ( ) . to_string_lossy ( ) ,
80- & display_name. clone ( ) . to_string_lossy ( ) . to_lowercase ( ) ,
81- "Application" ,
82- exe,
83- icon,
84- ) )
85- }
86- } ) ;
87- } ) ;
72+ if !display_name. is_empty ( ) {
73+ let icon = get_first_icon ( & exe)
74+ . inspect_err ( |e| tracing:: error!( "Error getting icons: {e}" ) )
75+ . ok ( )
76+ . flatten ( ) ;
77+
78+ apps. push ( App :: new_executable (
79+ & display_name. clone ( ) . to_string_lossy ( ) ,
80+ & display_name. clone ( ) . to_string_lossy ( ) . to_lowercase ( ) ,
81+ "Application" ,
82+ exe,
83+ icon,
84+ ) )
85+ }
86+ }
8887}
8988
9089/// Returns the set of known paths
0 commit comments