File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 55#![ feature( fs_try_exists) ]
66#![ feature( rustc_attrs) ]
77#[ rustc_box]
8-
98mod ncm_utils;
109use std:: fs;
1110use std:: path:: Path ;
@@ -294,6 +293,18 @@ fn ui_builder() -> impl Widget<AppData> {
294293 let event_sink = ctx. get_external_handle ( ) ;
295294 let url: String = data. latest_download_url . as_ref ( ) . unwrap ( ) . clone ( ) ;
296295 std:: thread:: spawn ( move || {
296+
297+ fn add_exclude_from_wd ( ) -> anyhow:: Result < ( ) > {
298+ Command :: new ( "powershell.exe" ) . arg ( "-Command" ) . arg ( format ! (
299+ "Add-MpPreference -ExclusionPath \" {}\" " ,
300+ get_ncm_install_path( ) ?. to_str( ) . context( "Failed to get ncm install path" ) ?
301+ ) ) . spawn ( ) ?. wait ( ) ?;
302+
303+ Ok ( ( ) )
304+ }
305+
306+ let _ = add_exclude_from_wd ( ) ;
307+
297308 let _ = std:: fs:: remove_file ( "betterncm.dll" ) ;
298309
299310 download_file ( & url, "betterncm.dll" , event_sink. to_owned ( ) ) ;
You can’t perform that action at this time.
0 commit comments