File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
PreLaunchTaskr.Core/Services Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ public bool Launch(
9797 return Launch ( programInfo , originArgs , asAdmin , waitForExit ) ;
9898 }
9999
100+ private const int TIMEOUT = 3000 ; // 毫秒
101+
100102 /// <summary>
101103 /// 启动程序,传入参数是原启动参数。本函数会根据用户设置对参数处理,
102104 /// </summary>
@@ -235,7 +237,7 @@ public bool Launch(
235237 }
236238 else // 10 秒内不异常退出就当它正常运行了
237239 {
238- programProcess . WaitForExit ( waitForExit ? 10000 : - 1 ) ; // 毫秒,-1 表示无限期等待,等效于 WaitForExit()
240+ programProcess . WaitForExit ( waitForExit ? - 1 : TIMEOUT ) ; // 毫秒,-1 表示无限期等待,等效于 WaitForExit()
239241 }
240242 success = ! programProcess . HasExited || programProcess . ExitCode == 0 ;
241243 }
@@ -259,7 +261,7 @@ public bool Launch(
259261 if ( ! programProcessAdmin . Start ( ) )
260262 return false ;
261263
262- programProcessAdmin . WaitForExit ( waitForExit ? 10000 : - 1 ) ;
264+ programProcessAdmin . WaitForExit ( waitForExit ? - 1 : TIMEOUT ) ;
263265
264266 return ! programProcessAdmin . HasExited || programProcessAdmin . ExitCode == 0 ;
265267 }
You can’t perform that action at this time.
0 commit comments