@@ -185,11 +185,11 @@ fn run_command(
185185 lines
186186 } ) ;
187187
188- let mut line_count = 50f32 ;
188+ let mut line_count = 0f32 ;
189189 for line in reader. lines ( ) {
190190 let line = line?;
191- line_count += 0.5 ;
192- progress_callback ( line, line_count) ;
191+ line_count = ( line_count + 0.5 ) . min ( 99.0 ) ;
192+ progress_callback ( format ! ( "[3/3] Run MiniInstaller: { line}" ) , line_count) ;
193193 }
194194
195195 let status = child. wait ( ) ?;
@@ -202,6 +202,8 @@ fn run_command(
202202 bail ! ( "Command failed with error: {}" , stderr) ;
203203 }
204204
205+ progress_callback ( "[3/3] Run MiniInstaller" . to_string ( ) , 100.0 ) ;
206+
205207 Ok ( ( ) )
206208}
207209
@@ -240,13 +242,13 @@ pub fn download_and_install_everest(
240242 url,
241243 temp_path,
242244 & mut |callback| {
243- progress_callback ( "Downloading Everest" . to_string ( ) , callback. progress ) ;
245+ progress_callback ( "[1/3] Download Everest" . to_string ( ) , callback. progress ) ;
244246 } ,
245247 false ,
246248 & cancel_flag,
247249 ) ?;
248250
249- progress_callback ( "Installing Everest" . to_string ( ) , 50 .0) ;
251+ progress_callback ( "[2/3] Extract Everest files " . to_string ( ) , 0 .0) ;
250252
251253 // unzip everest/main/* to game_path and overwrite all
252254 let mut archive = zip:: ZipArchive :: new ( std:: fs:: File :: open ( temp_path) ?) ?;
@@ -260,8 +262,8 @@ pub fn download_and_install_everest(
260262 // strip /main/ from the name
261263 let dist_name = dist_name. strip_prefix ( "main/" ) ?;
262264 let outpath = game_path. join ( dist_name) ;
263- let status_str = format ! ( "Extracting {}" , outpath. display( ) ) ;
264- progress_callback ( status_str, 50.0 + ( i as f32 ) / ( archive_len as f32 ) * 40 .0) ;
265+ let status_str = format ! ( "[2/3] Extract Everest files: {}" , outpath. display( ) ) ;
266+ progress_callback ( status_str, ( i as f32 ) / ( archive_len as f32 ) * 100 .0) ;
265267 if file. name ( ) . ends_with ( '/' ) {
266268 std:: fs:: create_dir_all ( & outpath) ?;
267269 } else {
@@ -285,7 +287,7 @@ pub fn download_and_install_everest(
285287 }
286288 }
287289
288- progress_callback ( "Running Everest installer " . to_string ( ) , 90 .0) ;
290+ progress_callback ( "[3/3] Run MiniInstaller " . to_string ( ) , 0 .0) ;
289291 let installer_path = game_path. join ( installer_name ( ) ?) ;
290292
291293 run_command ( installer_path, progress_callback)
0 commit comments