@@ -8,6 +8,9 @@ use std::path::PathBuf;
88use tauri:: AppHandle ;
99use tauri_plugin_autostart:: ManagerExt ;
1010
11+ #[ cfg( target_os = "windows" ) ]
12+ use std:: os:: windows:: process:: CommandExt ;
13+
1114#[ derive( Debug , Clone , Serialize , Deserialize ) ]
1215pub struct ConfigStatus {
1316 pub exists : bool ,
@@ -85,6 +88,7 @@ pub async fn open_config_folder(_handle: AppHandle, app_type: String) -> Result<
8588 {
8689 std:: process:: Command :: new ( "explorer" )
8790 . arg ( & config_dir)
91+ . creation_flags ( 0x08000000 ) // CREATE_NO_WINDOW
8892 . spawn ( )
8993 . map_err ( |e| e. to_string ( ) ) ?;
9094 }
@@ -112,6 +116,22 @@ pub async fn get_tool_versions() -> Result<Vec<ToolVersion>, String> {
112116 let mut versions = Vec :: new ( ) ;
113117
114118 // Check Claude Code version
119+ #[ cfg( target_os = "windows" ) ]
120+ let claude_version = std:: process:: Command :: new ( "claude" )
121+ . arg ( "--version" )
122+ . creation_flags ( 0x08000000 ) // CREATE_NO_WINDOW
123+ . output ( )
124+ . ok ( )
125+ . and_then ( |o| {
126+ if o. status . success ( ) {
127+ String :: from_utf8 ( o. stdout ) . ok ( )
128+ } else {
129+ None
130+ }
131+ } )
132+ . map ( |s| s. trim ( ) . to_string ( ) ) ;
133+
134+ #[ cfg( not( target_os = "windows" ) ) ]
115135 let claude_version = std:: process:: Command :: new ( "claude" )
116136 . arg ( "--version" )
117137 . output ( )
@@ -132,6 +152,22 @@ pub async fn get_tool_versions() -> Result<Vec<ToolVersion>, String> {
132152 } ) ;
133153
134154 // Check Codex version
155+ #[ cfg( target_os = "windows" ) ]
156+ let codex_version = std:: process:: Command :: new ( "codex" )
157+ . arg ( "--version" )
158+ . creation_flags ( 0x08000000 ) // CREATE_NO_WINDOW
159+ . output ( )
160+ . ok ( )
161+ . and_then ( |o| {
162+ if o. status . success ( ) {
163+ String :: from_utf8 ( o. stdout ) . ok ( )
164+ } else {
165+ None
166+ }
167+ } )
168+ . map ( |s| s. trim ( ) . to_string ( ) ) ;
169+
170+ #[ cfg( not( target_os = "windows" ) ) ]
135171 let codex_version = std:: process:: Command :: new ( "codex" )
136172 . arg ( "--version" )
137173 . output ( )
@@ -152,6 +188,22 @@ pub async fn get_tool_versions() -> Result<Vec<ToolVersion>, String> {
152188 } ) ;
153189
154190 // Check Gemini CLI version
191+ #[ cfg( target_os = "windows" ) ]
192+ let gemini_version = std:: process:: Command :: new ( "gemini" )
193+ . arg ( "--version" )
194+ . creation_flags ( 0x08000000 ) // CREATE_NO_WINDOW
195+ . output ( )
196+ . ok ( )
197+ . and_then ( |o| {
198+ if o. status . success ( ) {
199+ String :: from_utf8 ( o. stdout ) . ok ( )
200+ } else {
201+ None
202+ }
203+ } )
204+ . map ( |s| s. trim ( ) . to_string ( ) ) ;
205+
206+ #[ cfg( not( target_os = "windows" ) ) ]
155207 let gemini_version = std:: process:: Command :: new ( "gemini" )
156208 . arg ( "--version" )
157209 . output ( )
@@ -559,6 +611,7 @@ pub async fn open_auth_dir(path: String) -> Result<bool, String> {
559611 {
560612 std:: process:: Command :: new ( "explorer" )
561613 . arg ( & expanded)
614+ . creation_flags ( 0x08000000 ) // CREATE_NO_WINDOW
562615 . spawn ( )
563616 . map_err ( |e| e. to_string ( ) ) ?;
564617 }
0 commit comments