This commit is contained in:
BookerLiu
2022-09-02 15:35:40 +08:00
parent de57b8d78d
commit ad2556a216

View File

@@ -175,18 +175,10 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void StartIconApp(IconInfo icon, IconStartType type, bool useRelativePath = false) private void StartIconApp(IconInfo icon, IconStartType type, bool useRelativePath = false)
{ {
try try
{ {
Process p = new Process(); using (Process p = new Process())
//using () {
//{
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
string startArg = icon.StartArg; string startArg = icon.StartArg;
if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg)) if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg))
@@ -230,7 +222,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
switch (type) switch (type)
{ {
case IconStartType.ADMIN_STARTUP: case IconStartType.ADMIN_STARTUP:
//p.StartInfo.Arguments = "1";//启动参数
p.StartInfo.Verb = "runas"; p.StartInfo.Verb = "runas";
//p.StartInfo.CreateNoWindow = false; //设置显示窗口
p.StartInfo.UseShellExecute = true;//不使用操作系统外壳程序启动进程
//p.StartInfo.ErrorDialog = false;
if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL) if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
{ {
//如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
@@ -290,15 +286,13 @@ namespace GeekDesk.Control.UserControls.PannelCard
} }
} }
p.Start(); p.Start();
p.Close();
p.Dispose();
if (useRelativePath) if (useRelativePath)
{ {
//如果使用相对路径启动成功 那么重新设置程序绝对路径 //如果使用相对路径启动成功 那么重新设置程序绝对路径
icon.Path = path; icon.Path = path;
} }
} }
//} }
icon.Count++; icon.Count++;
//隐藏搜索框 //隐藏搜索框