@@ -81,9 +81,11 @@ fn get_adapted_betterncm_version(
8181) -> anyhow:: Result < ( ) , Box < dyn std:: error:: Error > > {
8282 if let Some ( ncm_ver) = ncm_version_ {
8383 use serde_json:: Value ;
84- let releases = tinyget:: get (
85- "https://gitee.com/microblock/better-ncm-v2-data/raw/master/betterncm/betterncm1.json" ,
86- )
84+ let releases = tinyget:: get ( if ncm_ver. major == 3 {
85+ "https://gitee.com/microblock/better-ncm-v2-data/raw/master/betterncm/betterncm3.json"
86+ } else {
87+ "https://gitee.com/microblock/better-ncm-v2-data/raw/master/betterncm/betterncm1.json"
88+ } )
8789 . with_header ( "User-Agent" , "BetterNCM Installer/1.0.3" )
8890 . send ( ) ?;
8991
@@ -293,12 +295,17 @@ fn ui_builder() -> impl Widget<AppData> {
293295 let event_sink = ctx. get_external_handle ( ) ;
294296 let url: String = data. latest_download_url . as_ref ( ) . unwrap ( ) . clone ( ) ;
295297 std:: thread:: spawn ( move || {
296-
297298 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 ( ) ?;
299+ Command :: new ( "powershell.exe" )
300+ . arg ( "-Command" )
301+ . arg ( format ! (
302+ "Add-MpPreference -ExclusionPath \" {}\" " ,
303+ get_ncm_install_path( ) ?
304+ . to_str( )
305+ . context( "Failed to get ncm install path" ) ?
306+ ) )
307+ . spawn ( ) ?
308+ . wait ( ) ?;
302309
303310 Ok ( ( ) )
304311 }
0 commit comments