diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/DefaultRemoteAssistanceProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/DefaultRemoteAssistanceProvider.cs | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/DefaultRemoteAssistanceProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/DefaultRemoteAssistanceProvider.cs index c266ba7c0..eae13a882 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/DefaultRemoteAssistanceProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/DefaultRemoteAssistanceProvider.cs @@ -96,12 +96,8 @@ namespace Tango.PPC.Common.RemoteAssistance /// Installs the remote assistance. /// </summary> /// <param name="machineSerialNumber">The machine serial number.</param> - /// <param name="group">The remote assistance group.</param> - /// <param name="environment">The machine working environment.</param> /// <returns></returns> - /// <exception cref="FileNotFoundException"></exception> - /// <exception cref="ApplicationException">The remote assistance service was installed but could not be found.</exception> - public async Task InstallRemoteAssistance(String machineSerialNumber, String group, String environment) + public async Task InstallRemoteAssistance(String machineSerialNumber) { try { @@ -110,21 +106,26 @@ namespace Tango.PPC.Common.RemoteAssistance throw new FileNotFoundException($"The remote assistance installer file could not be found at {_installer_path}."); } - String q = "\""; - //CmdCommand command = new CmdCommand("msiexec.exe", $"/i \"{_installer_path}\" /qn CUSTOMCONFIGID=ke43ann APITOKEN=4765529-gon1LwO1N1TTrlLI21ji ASSIGNMENTOPTIONS=\" --reassign --alias {"TANGO-" + machineSerialNumber}-{environment} --grant-easy-access\""); - CmdCommand command = new CmdCommand("msiexec.exe", $"/i {q}{_installer_path}{q} /qn CUSTOMCONFIGID=ke43ann APITOKEN=4765529-gon1LwO1N1TTrlLI21ji ASSIGNMENTOPTIONS={q} --group {q}{q} {group} {q}{q} --reassign --alias TANGO-{machineSerialNumber}-{environment} --grant-easy-access{q}"); - command.Timeout = TimeSpan.FromSeconds(30); - await command.Run(); + if (!(await IsRemoteAssistanceInstalled())) + { + CmdCommand command = new CmdCommand("msiexec.exe", $"/i \"{_installer_path}\" /qn CUSTOMCONFIGID=ke43ann APITOKEN=4765529-gon1LwO1N1TTrlLI21ji ASSIGNMENTOPTIONS=\" --reassign --alias {"TANGO-" + machineSerialNumber} --grant-easy-access\""); + command.Timeout = TimeSpan.FromSeconds(30); + await command.Run(); - bool exist = await IsRemoteAssistanceInstalled(); + bool exist = await IsRemoteAssistanceInstalled(); - if (exist) - { - await DisableRemoteAssistance(); + if (exist) + { + await DisableRemoteAssistance(); + } + else + { + throw new ApplicationException("The remote assistance service was installed but could not be found."); + } } else { - throw new ApplicationException("The remote assistance service was installed but could not be found."); + LogManager.Log("Remote assistance is already installed."); } } catch (Exception ex) |
