Some software install can spawn a child process that never exits. We want to be able to ignore child processes that don't exit after installation is finished
This commit is contained in:
@@ -1,23 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
@@ -249,7 +239,7 @@ namespace All_Purpose_Auto_Setup
|
||||
}
|
||||
else if (additionalFileMissing.Length > 0)
|
||||
{
|
||||
((frmSetupStatusDisplay)m_parentForm).displayMessageBox(MessageBoxCustom.PopUpMsgType.INFO, null, "File \"" + additionalFileMissing + "\" is missing. \n\nProceeding with running pre-build script to create necessary files." , "Info", -1);
|
||||
((frmSetupStatusDisplay)m_parentForm).displayMessageBox(MessageBoxCustom.PopUpMsgType.INFO, null, "File \"" + additionalFileMissing + "\" is missing. \n\nProceeding with running pre-build script to create necessary files.", "Info", -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -283,7 +273,7 @@ namespace All_Purpose_Auto_Setup
|
||||
setupSuccessful = false;
|
||||
}
|
||||
|
||||
if ( msg.Length > 0 )
|
||||
if (msg.Length > 0)
|
||||
UpdateStatusDisplayAndLogEvent(msg, msg, textPropList);
|
||||
}
|
||||
|
||||
@@ -536,7 +526,7 @@ namespace All_Purpose_Auto_Setup
|
||||
textProp.textFont = new Font(textProp.textFont, FontStyle.Bold);
|
||||
textPropList.Add(textProp);
|
||||
|
||||
if (errMsg.Length > 0 )
|
||||
if (errMsg.Length > 0)
|
||||
msg = " - FAILED. " + errMsg;
|
||||
else
|
||||
msg = " - FAILED. " + additionalFileMissing + " not found.";
|
||||
|
||||
@@ -146,12 +146,22 @@ step = INSTALL_SOFTWARE_PACKAGES,Install_Software
|
||||
;
|
||||
; ******************************************************************************************************************************
|
||||
[Install_Software]
|
||||
app5_name = Visual Studio 2022
|
||||
app5_setup_argument = -p --norestart --noweb --add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.CLI.Support Microsoft.VisualStudio.Workload.VisualStudioExtension;includeRecommended
|
||||
app5_reg_path = VisualStudio.DTE.17.0
|
||||
app5_reg_type = classes_root
|
||||
app5_setup_file = D:\Windows_Stuff\Visual_Studio_2022.17.9.5\vs_setup.exe
|
||||
app5_install_process_name = setup
|
||||
;app5_name = Visual Studio 2022
|
||||
;app5_setup_argument = -p --norestart --noweb --add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended Microsoft.VisualStudio.Component.VC.ATLMFC Microsoft.VisualStudio.Component.VC.CLI.Support Microsoft.VisualStudio.Workload.VisualStudioExtension;includeRecommended
|
||||
;app5_reg_path = VisualStudio.DTE.17.0
|
||||
;app5_reg_type = classes_root
|
||||
;app5_setup_file = D:\Windows_Stuff\Visual_Studio_2022.17.9.5\vs_setup.exe
|
||||
;app5_install_process_name = setup
|
||||
|
||||
app6_name = TestStand 2019
|
||||
app6_reg_display_name = NI TestStand (32-bit)
|
||||
app6_reg_type = local_machine
|
||||
app62_reg_value = 19
|
||||
app62_reg_name = DisplayVersion
|
||||
app62_reg_compare = gte
|
||||
app6_setup_file = C:\Users\Duc\Desktop\TestStand_2019\Install.exe
|
||||
app6_spawned_processes_to_ignore = nierserver
|
||||
app6_reboot_computer_at_completion = true
|
||||
|
||||
; ******************************************************************************************************************************
|
||||
; THIS SECTION IS OPTIONAL
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using CommonLib.Windows.Misc;
|
||||
using CommonLib.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Misc;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
@@ -298,7 +286,7 @@ namespace All_Purpose_Auto_Setup
|
||||
UpdateStatusDisplayAndLogEvent(msg2, msg2, textPropList2);
|
||||
}
|
||||
|
||||
if (setupSuccessful && networkAdapterDefaultGateway.Length > 0 )
|
||||
if (setupSuccessful && networkAdapterDefaultGateway.Length > 0)
|
||||
{
|
||||
setupSuccessful = NetworkManagement.SetNetworkAdapterDefaultGateway(networkAdapterConfiguration, networkAdapterDefaultGateway, ref errMsg);
|
||||
|
||||
@@ -540,7 +528,7 @@ namespace All_Purpose_Auto_Setup
|
||||
string[] ips = iniKey.iniValue.Split(',');
|
||||
ips[0] = ips[0].Trim();
|
||||
|
||||
if ( ips.Length > 1)
|
||||
if (ips.Length > 1)
|
||||
ips[1] = ips[1].Trim();
|
||||
List<string> ipList = new List<string>(ips);
|
||||
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
@@ -401,7 +393,7 @@ namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
// since we are receiving everything that's being output to the standard output
|
||||
// we're only interested in the response of the command, and not the command itself
|
||||
if ( !Regex.IsMatch(e.Data, @"^[a-zA-Z]:[^>]+>.+", RegexOptions.IgnoreCase))
|
||||
if (!Regex.IsMatch(e.Data, @"^[a-zA-Z]:[^>]+>.+", RegexOptions.IgnoreCase))
|
||||
m_consoleAppStatusMessage = e.Data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
@@ -407,14 +394,14 @@ namespace All_Purpose_Auto_Setup
|
||||
|
||||
displayMsg = Regex.Replace(userPrompt["prompt_message"], @"\{newline\}", "\n");
|
||||
|
||||
if ( String.Equals(userPrompt["prompt_message_type"], MessageBoxCustom.PopUpMsgType.YESNO.ToString(), StringComparison.CurrentCultureIgnoreCase))
|
||||
if (String.Equals(userPrompt["prompt_message_type"], MessageBoxCustom.PopUpMsgType.YESNO.ToString(), StringComparison.CurrentCultureIgnoreCase))
|
||||
result = ((frmSetupStatusDisplay)m_parentForm).displayMessageBox(MessageBoxCustom.PopUpMsgType.YESNO, null, displayMsg, "Info", -1);
|
||||
else if (String.Equals(userPrompt["prompt_message_type"], MessageBoxCustom.PopUpMsgType.OKCANCEL.ToString(), StringComparison.CurrentCultureIgnoreCase))
|
||||
result = ((frmSetupStatusDisplay)m_parentForm).displayMessageBox(MessageBoxCustom.PopUpMsgType.OKCANCEL, null, displayMsg, "Info", -1);
|
||||
else
|
||||
result = ((frmSetupStatusDisplay)m_parentForm).displayMessageBox(MessageBoxCustom.PopUpMsgType.INFO, null, displayMsg, "Info", -1);
|
||||
|
||||
if ( Regex.IsMatch(result, @"(yes|ok)", RegexOptions.IgnoreCase))
|
||||
if (Regex.IsMatch(result, @"(yes|ok)", RegexOptions.IgnoreCase))
|
||||
{
|
||||
msg += " - SUCCESS.";
|
||||
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
using CommonLib.Windows.Misc;
|
||||
using CommonLib.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
@@ -60,7 +53,7 @@ namespace All_Purpose_Auto_Setup
|
||||
bool setupSuccessful = true;
|
||||
string msg, indentation = String.Empty;
|
||||
string setupFile, exeFile, registryPath, registryDisplayName, registryType, registryName, registryValue, registryCompareOperator, installArgs,
|
||||
exitCodesToIgnore, installProcessName;
|
||||
exitCodesToIgnore, spawnedProcessesToIgnore;
|
||||
bool promptBeforeInstallation = false, rebootComputerAtCompletionRequested = false, rebootComputerImmediatelyRequested = false;
|
||||
|
||||
CommonLib.Windows.Forms.TextFormat.TextFontAndColor defaultTextProp = new CommonLib.Windows.Forms.TextFormat.TextFontAndColor("");
|
||||
@@ -132,7 +125,7 @@ namespace All_Purpose_Auto_Setup
|
||||
registryCompareOperator = "";
|
||||
installArgs = "";
|
||||
exitCodesToIgnore = "";
|
||||
installProcessName = "";
|
||||
spawnedProcessesToIgnore = "";
|
||||
rebootComputerAtCompletionRequested = false;
|
||||
rebootComputerImmediatelyRequested = false;
|
||||
|
||||
@@ -143,7 +136,7 @@ namespace All_Purpose_Auto_Setup
|
||||
break;
|
||||
|
||||
getInfoUsingExeVerification(processedConfigInfo.Value, ref setupFile, ref exeFile, ref promptBeforeInstallation, ref rebootComputerAtCompletionRequested, ref rebootComputerImmediatelyRequested);
|
||||
getInfoUsingRegistryVerification(processedConfigInfo.Value, ref registryPath, ref registryDisplayName, ref registryType, ref registryName, ref registryValue, ref registryCompareOperator, ref installArgs, ref exitCodesToIgnore, ref installProcessName);
|
||||
getInfoUsingRegistryVerification(processedConfigInfo.Value, ref registryPath, ref registryDisplayName, ref registryType, ref registryName, ref registryValue, ref registryCompareOperator, ref installArgs, ref exitCodesToIgnore, ref spawnedProcessesToIgnore);
|
||||
|
||||
if (exeFile.Length > 0)
|
||||
{
|
||||
@@ -153,7 +146,7 @@ namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
setupSuccessful = checkSoftwareRegistry(processedConfigInfo.Key.iniValue, setupFile, promptBeforeInstallation, installArgs, registryPath,
|
||||
registryDisplayName, registryType, registryName, registryValue, registryCompareOperator,
|
||||
exitCodesToIgnore, installProcessName, rebootComputerAtCompletionRequested, rebootComputerImmediatelyRequested);
|
||||
exitCodesToIgnore, spawnedProcessesToIgnore, rebootComputerAtCompletionRequested, rebootComputerImmediatelyRequested);
|
||||
}
|
||||
|
||||
if (!setupSuccessful || ((frmSetupStatusDisplay)m_parentForm).applicationNeedsToBeRestarted())
|
||||
@@ -256,7 +249,7 @@ namespace All_Purpose_Auto_Setup
|
||||
return setupSuccessful;
|
||||
}
|
||||
|
||||
public bool installSoftware(string softwareName, string setupFile, string setupArgs, string exitCodesToIgnore, string installProcessName, bool promptBeforeInstall)
|
||||
public bool installSoftware(string softwareName, string setupFile, string setupArgs, string exitCodesToIgnore, string spawnedProcessesToIgnore, bool promptBeforeInstall)
|
||||
{
|
||||
string msg1 = String.Empty, msg2 = String.Empty, msg3, indentation = String.Empty;
|
||||
bool setupSuccessful = true;
|
||||
@@ -381,7 +374,7 @@ namespace All_Purpose_Auto_Setup
|
||||
process = Process.Start(setupFile);
|
||||
}
|
||||
|
||||
int exitCode = WaitForAllToExit(process);
|
||||
int exitCode = WaitForAllToExit(process, spawnedProcessesToIgnore);
|
||||
|
||||
process.Close();
|
||||
|
||||
@@ -493,7 +486,7 @@ namespace All_Purpose_Auto_Setup
|
||||
_resetEvent.Set(); // signal that execution of this thread is done
|
||||
}
|
||||
|
||||
private int WaitForAllToExit(Process process)
|
||||
private int WaitForAllToExit(Process process, string spawnedProcessesToIgnore)
|
||||
{
|
||||
int exitCode = -1;
|
||||
|
||||
@@ -527,7 +520,17 @@ namespace All_Purpose_Auto_Setup
|
||||
continue;
|
||||
}
|
||||
|
||||
exitCode = WaitForAllToExit(childProcess);
|
||||
string indentation = Common.getIndentation(1);
|
||||
((frmSetupStatusDisplay)m_parentForm).writeToLog($"{indentation}Child process spawned: {childProcess.ProcessName}\r\n");
|
||||
|
||||
string[] processArray = Array.ConvertAll(spawnedProcessesToIgnore.Split(','), p => p.Trim());
|
||||
|
||||
if (!processArray.Contains(childProcess.ProcessName, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
exitCode = WaitForAllToExit(childProcess, spawnedProcessesToIgnore);
|
||||
}
|
||||
else
|
||||
((frmSetupStatusDisplay)m_parentForm).writeToLog($"{indentation}Ignoring spawned process: {childProcess.ProcessName}\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -621,7 +624,7 @@ namespace All_Purpose_Auto_Setup
|
||||
|
||||
public bool checkSoftwareRegistry(string softwareName, string setupFile, bool promptBeforeInstall, string setupArgs, string registryPath, string registryDisplayName, string registryType,
|
||||
string registryName, string registryValue, string registryCompareOperator,
|
||||
string exitCodesToIgnore, string installProcessName, bool rebootComputerAtCompletionRequested, bool rebootComputerImmediatelyRequested)
|
||||
string exitCodesToIgnore, string spawnedProcessesToIgnore, bool rebootComputerAtCompletionRequested, bool rebootComputerImmediatelyRequested)
|
||||
{
|
||||
bool setupSuccessful = true;
|
||||
bool installSuccessful = true;
|
||||
@@ -654,7 +657,7 @@ namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
if (retriesCount == 1 && setupFile.Length > 0)
|
||||
{
|
||||
installSuccessful = installSoftware(softwareName, setupFile, setupArgs, exitCodesToIgnore, installProcessName, promptBeforeInstall);
|
||||
installSuccessful = installSoftware(softwareName, setupFile, setupArgs, exitCodesToIgnore, spawnedProcessesToIgnore, promptBeforeInstall);
|
||||
|
||||
installExecuted = true;
|
||||
|
||||
@@ -1087,14 +1090,14 @@ namespace All_Purpose_Auto_Setup
|
||||
}
|
||||
else if (Regex.IsMatch(iniKey.iniKeyName, @"app\d+_reboot_computer_at_completion", RegexOptions.IgnoreCase))
|
||||
{
|
||||
if (String.Equals(iniKey.iniValue, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
if (String.Equals(iniKey.iniValue, "yes", StringComparison.OrdinalIgnoreCase) || String.Equals(iniKey.iniValue, "true", StringComparison.OrdinalIgnoreCase))
|
||||
rebootComputerAtCompletionRequested = true;
|
||||
else
|
||||
rebootComputerAtCompletionRequested = false;
|
||||
}
|
||||
else if (Regex.IsMatch(iniKey.iniKeyName, @"app\d+_reboot_computer_immediately", RegexOptions.IgnoreCase))
|
||||
{
|
||||
if (String.Equals(iniKey.iniValue, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
if (String.Equals(iniKey.iniValue, "yes", StringComparison.OrdinalIgnoreCase) || String.Equals(iniKey.iniValue, "true", StringComparison.OrdinalIgnoreCase))
|
||||
rebootComputerImmediatelyRequested = true;
|
||||
else
|
||||
rebootComputerImmediatelyRequested = false;
|
||||
@@ -1104,7 +1107,7 @@ namespace All_Purpose_Auto_Setup
|
||||
|
||||
// get all the necessary info if user choose to verify software by looking at the registry
|
||||
public void getInfoUsingRegistryVerification(List<ConfigFileManager.Ini_KeyValue<string>> iniKeys, ref string registryPath, ref string registryDisplayName,
|
||||
ref string registryType, ref string registryName, ref string registryValue, ref string registryCompareOperator, ref string installArgs, ref string exitCodesToIgnore, ref string installProcessName)
|
||||
ref string registryType, ref string registryName, ref string registryValue, ref string registryCompareOperator, ref string installArgs, ref string exitCodesToIgnore, ref string spawnedProcessesToIgnore)
|
||||
{
|
||||
registryPath = "";
|
||||
registryDisplayName = "";
|
||||
@@ -1150,9 +1153,9 @@ namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
exitCodesToIgnore = iniKey.iniValue;
|
||||
}
|
||||
else if (Regex.IsMatch(iniKey.iniKeyName, @"app\d+_install_process_name", RegexOptions.IgnoreCase))
|
||||
else if (Regex.IsMatch(iniKey.iniKeyName, @"app\d+_spawned_processes_to_ignore", RegexOptions.IgnoreCase))
|
||||
{
|
||||
installProcessName = iniKey.iniValue;
|
||||
spawnedProcessesToIgnore = iniKey.iniValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.Misc;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Misc;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
{
|
||||
@@ -207,7 +194,7 @@ namespace All_Purpose_Auto_Setup
|
||||
}
|
||||
}
|
||||
|
||||
if ( msg1.Length > 0 )
|
||||
if (msg1.Length > 0)
|
||||
{
|
||||
|
||||
// set font to default text and color
|
||||
@@ -370,7 +357,7 @@ namespace All_Purpose_Auto_Setup
|
||||
}
|
||||
|
||||
public void getRegistryInfo(List<ConfigFileManager.Ini_KeyValue<string>> iniKeys, ref string action,
|
||||
ref string registryType, Dictionary<string,string> nameValuePairs)
|
||||
ref string registryType, Dictionary<string, string> nameValuePairs)
|
||||
{
|
||||
Match regExMatch;
|
||||
registryType = "";
|
||||
@@ -535,7 +522,7 @@ namespace All_Purpose_Auto_Setup
|
||||
regExMatch = Regex.Match(iniKey.iniValue, @"\[\s*name\s*:\s*(.*[^\s])\s*,\s*value\s*:\s*(.*[^\s])\s*,\s*type\s*:\s*(.*[a-zA-Z])\s*\]", RegexOptions.IgnoreCase);
|
||||
|
||||
// match multi value
|
||||
if ( !regExMatch.Success )
|
||||
if (!regExMatch.Success)
|
||||
regExMatch = Regex.Match(iniKey.iniValue, @"\[\s*name\s*:\s*(.*[^\s])\s*,\s*:\s*value\s*:\s*(.*[^\s])\s*,\s*type\s*:\s*(.*[a-zA-Z])\s*\]", RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
using CommonLib.Windows.Misc;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
using System.Reflection;
|
||||
using CommonLib.Windows.Forms;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
using CommonLib.Windows.Misc;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
|
||||
@@ -1,25 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Management;
|
||||
using System.Security.Principal;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using CommonLib.IO;
|
||||
using CommonLib.Misc;
|
||||
using CommonLib.Windows.Forms;
|
||||
using CommonLib.Windows.Misc;
|
||||
|
||||
namespace All_Purpose_Auto_Setup
|
||||
@@ -90,7 +79,7 @@ namespace All_Purpose_Auto_Setup
|
||||
// process the configuration file
|
||||
configFileMgr = new ConfigFileManager(this, pathAndNameOfConfigFile);
|
||||
|
||||
pathAndNameOfSetupLog = Path.Combine(Application.StartupPath,pathAndNameOfSetupLog);
|
||||
pathAndNameOfSetupLog = Path.Combine(Application.StartupPath, pathAndNameOfSetupLog);
|
||||
|
||||
pathAndNameOfSetupLog = FileManip.GenerateUniqueFileName(Path.GetDirectoryName(pathAndNameOfSetupLog),
|
||||
Path.GetFileNameWithoutExtension(pathAndNameOfSetupLog), Path.GetExtension(pathAndNameOfSetupLog));
|
||||
@@ -148,6 +137,7 @@ namespace All_Purpose_Auto_Setup
|
||||
str = Regex.Replace(str, @"\n", "\r\n", RegexOptions.IgnoreCase);
|
||||
|
||||
swSetupLog.Write(str);
|
||||
swSetupLog.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +154,7 @@ namespace All_Purpose_Auto_Setup
|
||||
str = Regex.Replace(str, @"\n", "\r\n", RegexOptions.IgnoreCase);
|
||||
|
||||
swSetupLog.Write(str);
|
||||
swSetupLog.Flush();
|
||||
}
|
||||
|
||||
return FormControlsManipThreadSafe.getRichTextBoxLastLineIndex(statusRtxtbox);
|
||||
@@ -177,6 +168,7 @@ namespace All_Purpose_Auto_Setup
|
||||
str = Regex.Replace(str, @"\n", "\r\n", RegexOptions.IgnoreCase);
|
||||
|
||||
swSetupLog.Write(str);
|
||||
swSetupLog.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,7 +319,7 @@ namespace All_Purpose_Auto_Setup
|
||||
currentSetupStep < (int)Properties.Settings.Default["CurrentSetupStep"])
|
||||
continue;
|
||||
|
||||
if ( getActualSetupStep(entry[0], ref actualSetupstep) )
|
||||
if (getActualSetupStep(entry[0], ref actualSetupstep))
|
||||
{
|
||||
setupSuccessful = setupStepCalls[actualSetupstep].Invoke(entry[1]);
|
||||
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
|
||||
using CommonLib.Windows.Forms;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user