diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 14:27:05 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 14:27:05 +0200 |
| commit | 1344a54c37f7cbba7a294674b4b733d72ee257ea (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| parent | 281610ac56799f6870c587a942495d91cd55b227 (diff) | |
| download | Tango-1344a54c.tar.gz Tango-1344a54c.zip | |
Hope it is fine
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance')
2 files changed, 17 insertions, 18 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) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/IRemoteAssistanceProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/IRemoteAssistanceProvider.cs index 3b7d489e6..cafb8dab9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/IRemoteAssistanceProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/RemoteAssistance/IRemoteAssistanceProvider.cs @@ -32,9 +32,7 @@ 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> - Task InstallRemoteAssistance(String machineSerialNumber, String group, String environment); + Task InstallRemoteAssistance(String machineSerialNumber); } } |
