@@ -17,6 +17,7 @@ use data_types::*;
1717use utils:: * ;
1818
1919use std:: collections:: HashMap ;
20+ use std:: io:: { BufRead , BufReader } ;
2021use std:: path:: Path ;
2122use std:: sync:: { Arc , Mutex } ;
2223use std:: { fs, str} ;
@@ -30,8 +31,8 @@ use gtk::{gdk, glib, Builder, HeaderBar, Window};
3031use i18n_embed:: DesktopLanguageRequester ;
3132use once_cell:: sync:: Lazy ;
3233use serde_json:: json;
33- use subprocess:: Exec ;
34- use tracing:: { debug, error} ;
34+ use subprocess:: { Exec , Redirection } ;
35+ use tracing:: { debug, error, info } ;
3536use unic_langid:: LanguageIdentifier ;
3637
3738const RESPREFIX : & str = "/org/cachyos/hello" ;
@@ -160,12 +161,33 @@ fn quick_message(message: String) {
160161 let checks = [ connectivity_check, edition_compat_check, outdated_version_check] ;
161162 if !checks. iter ( ) . all ( |x| x ( message. clone ( ) ) ) {
162163 // if any check failed, return
164+ info ! ( "Some ISO check failed!" ) ;
163165 install_btn. set_sensitive ( true ) ;
164166 return ;
165167 }
166168
167- let cmd = "/usr/local/bin/calamares-online.sh" . to_owned ( ) ;
168- Exec :: cmd ( cmd) . join ( ) . unwrap ( ) ;
169+ // Spawning child process
170+ info ! ( "ISO checks passed! Starting Installer.." ) ;
171+ let mut child = Exec :: cmd ( "/usr/local/bin/calamares-online.sh" )
172+ . stdout ( Redirection :: Pipe )
173+ . stderr ( Redirection :: Merge )
174+ . popen ( )
175+ . expect ( "Failed to spawn installer" ) ;
176+
177+ let child_out = child. stdout . take ( ) . unwrap ( ) ;
178+ let child_read = BufReader :: new ( child_out) ;
179+
180+ // Read the output line by line until EOF
181+ for line_result in child_read. lines ( ) {
182+ match line_result {
183+ Ok ( line) => info ! ( "{line}" ) ,
184+ Err ( e) => error ! ( "Error reading output: {e}" ) ,
185+ }
186+ }
187+
188+ let status = child. wait ( ) . expect ( "Failed to waiting for child" ) ;
189+ info ! ( "Installer finished with status: {:?}" , status) ;
190+
169191 install_btn. set_sensitive ( true ) ;
170192 } ) ;
171193}
0 commit comments