Use icon. Return not found if Azure can't be reached.

This commit is contained in:
Jared 2021-02-12 18:22:44 -08:00 committed by Jared Goodwin
parent 2182c46fd6
commit 4a8900cc7d
2 changed files with 116 additions and 104 deletions

View File

@ -43,7 +43,26 @@ namespace Remotely.Server.API
[HttpGet("desktop/{platformID}")]
public async Task<IActionResult> GetDesktop(string platformID)
{
return await GetInstallFile(null, platformID);
switch (platformID)
{
case "WindowsDesktop-x64":
{
var filePath = Path.Combine(_hostEnv.WebRootPath, "Downloads", "Win-x64", "Remotely_Desktop.exe");
return await GetDesktopFile(filePath);
}
case "WindowsDesktop-x86":
{
var filePath = Path.Combine(_hostEnv.WebRootPath, "Downloads", "Win-x86", "Remotely_Desktop.exe");
return await GetDesktopFile(filePath);
}
case "UbuntuDesktop":
{
var filePath = Path.Combine(_hostEnv.WebRootPath, "Downloads", "Remotely_Desktop");
return await GetDesktopFile(filePath);
}
default:
return NotFound();
}
}
[HttpGet("clickonce-setup/{architecture}/{organizationId}")]
@ -87,9 +106,16 @@ namespace Remotely.Server.API
using var byteContent = new ByteArrayContent(bytes);
formContent.Add(byteContent, "setup", "setup.exe");
using var response = await client.PostAsync($"{AppConstants.ClickOnceSetupUrl}/?host={Request.Scheme}://{Request.Host}&organizationid={organizationId}&architecture={architecture}", formContent);
var responseBytes = await response.Content.ReadAsByteArrayAsync();
return File(responseBytes, "application/octet-stream", "setup.exe");
try
{
using var response = await client.PostAsync($"{AppConstants.ClickOnceSetupUrl}/?host={Request.Scheme}://{Request.Host}&organizationid={organizationId}&architecture={architecture}", formContent);
var responseBytes = await response.Content.ReadAsByteArrayAsync();
return File(responseBytes, "application/octet-stream", "setup.exe");
}
catch
{
return NotFound();
}
}
@ -163,21 +189,6 @@ namespace Remotely.Server.API
{
switch (platformID)
{
case "WindowsDesktop-x64":
{
var filePath = Path.Combine(_hostEnv.WebRootPath, "Downloads", "Win-x64", "Remotely_Desktop.exe");
return await GetDesktopFile(filePath);
}
case "WindowsDesktop-x86":
{
var filePath = Path.Combine(_hostEnv.WebRootPath, "Downloads", "Win-x86", "Remotely_Desktop.exe");
return await GetDesktopFile(filePath);
}
case "UbuntuDesktop":
{
var filePath = Path.Combine(_hostEnv.WebRootPath, "Downloads", "Remotely_Desktop");
return await GetDesktopFile(filePath);
}
case "WindowsInstaller":
{
var filePath = Path.Combine(_hostEnv.WebRootPath, "Downloads", "Remotely_Installer.exe");

View File

@ -7,7 +7,8 @@
@if (User.Identity.IsAuthenticated)
{
<div class="small mb-3">
* You are signed in. All links will be specific to your organization and, if applicable, will be branded.
<span class="fas fa-question-circle pointer"></span>
You are signed in. All links will be specific to your organization and, if applicable, will be branded.
You can share these links directly with customers for download.
</div>
}
@ -109,92 +110,92 @@
}
else
{
<div class="col-sm-6 mb-3">
<h6>Windows 10 / 8.1 / 7 (64-Bit and 32-Bit)</h6>
<p>
<small>Note: GPU-accelerated screen capture and PowerShell Core is unavailable on Windows 7.</small>
</p>
<p>
<strong>Download:</strong>
<br />
<a href="/API/ClientDownloads/WindowsInstaller">Windows Installer (x64/x86)</a>
<br />
<a href="~/Downloads/Remotely-Win10-x64.zip">Windows x64 Files Only</a>
<br />
<a href="~/Downloads/Remotely-Win10-x86.zip">Windows x86 Files Only</a>
</p>
<div class="col-sm-6 mb-3">
<h6>Windows 10 / 8.1 / 7 (64-Bit and 32-Bit)</h6>
<p>
<small>Note: GPU-accelerated screen capture and PowerShell Core is unavailable on Windows 7.</small>
</p>
<p>
<strong>Download:</strong>
<br />
<a href="/API/ClientDownloads/WindowsInstaller">Windows Installer (x64/x86)</a>
<br />
<a href="~/Downloads/Remotely-Win10-x64.zip">Windows x64 Files Only</a>
<br />
<a href="~/Downloads/Remotely-Win10-x86.zip">Windows x86 Files Only</a>
</p>
<p>
<strong>Quiet Install:</strong>
<br />
<span class="label label-default code">
Remotely_Installer.exe
-install
-quiet
-organizationid "0b3d706b-9c5d-41e6-8ae9-5720d16324e6"
-serverurl "https://remotely.mytechshop.com"
</span>
</p>
<p>
<strong>Quiet Uninstall:</strong>
<br />
<span class="label label-default code">Remotely_Installer.exe -uninstall -quiet</span>
</p>
<p>
<strong>Local Install:</strong>
<span data-toggle="modal" data-target="#localInstallInfo" class="fas fa-question-circle pointer"></span>
<br />
<span class="label label-default code">
Remotely_Installer.exe
-install
-quiet
-organizationid "0b3d706b-9c5d-41e6-8ae9-5720d16324e6"
-serverurl "https://remotely.mytechshop.com"
-path "[path]\Remotely-Win10-x64.zip"
</span>
</p>
<p>
<strong>Override Options:</strong>
<br />
<span class="label label-default code">
Remotely_Installer.exe -install -quiet -supportshortcut
-organizationid "0b3d706b-9c5d-41e6-8ae9-5720d16324e6"
-serverurl "https://remotely.mytechshop.com"
-devicegroup "Customer Group 1"
-devicealias "Front Desk"
-deviceuuid "eebb4d87-5459-4976-989e-a7876dffc69c"
</span>
</p>
</div>
<p>
<strong>Quiet Install:</strong>
<br />
<span class="label label-default code">
Remotely_Installer.exe
-install
-quiet
-organizationid "0b3d706b-9c5d-41e6-8ae9-5720d16324e6"
-serverurl "https://remotely.mytechshop.com"
</span>
</p>
<p>
<strong>Quiet Uninstall:</strong>
<br />
<span class="label label-default code">Remotely_Installer.exe -uninstall -quiet</span>
</p>
<p>
<strong>Local Install:</strong>
<span data-toggle="modal" data-target="#localInstallInfo" class="fas fa-question-circle pointer"></span>
<br />
<span class="label label-default code">
Remotely_Installer.exe
-install
-quiet
-organizationid "0b3d706b-9c5d-41e6-8ae9-5720d16324e6"
-serverurl "https://remotely.mytechshop.com"
-path "[path]\Remotely-Win10-x64.zip"
</span>
</p>
<p>
<strong>Override Options:</strong>
<br />
<span class="label label-default code">
Remotely_Installer.exe -install -quiet -supportshortcut
-organizationid "0b3d706b-9c5d-41e6-8ae9-5720d16324e6"
-serverurl "https://remotely.mytechshop.com"
-devicegroup "Customer Group 1"
-devicealias "Front Desk"
-deviceuuid "eebb4d87-5459-4976-989e-a7876dffc69c"
</span>
</p>
</div>
<div class="col-sm-6 mb-3">
<h6>Linux 64-Bit</h6>
<p>
<strong>Download:</strong>
<br />
<a href="/API/ClientDownloads/UbuntuInstaller-x64">Ubuntu x64 Bash Installer</a>
<br />
<a href="/API/ClientDownloads/ManjaroInstaller-x64">Manjaro x64 Bash Installer</a>
<br />
<a href="~/Downloads/Remotely-Linux.zip">Linux x64 Files Only</a>
</p>
<p>
<strong>Install:</strong>
<br />
<span class="label label-default code">sudo [path]/Install-Linux-x64.sh</span>
</p>
<p>
<strong>Local Install:</strong>
<span data-toggle="modal" data-target="#localInstallInfo" class="fas fa-question-circle pointer"></span>
<br />
<span class="label label-default code">sudo [path]/Install-Linux-x64.sh --path [path]/Remotely-Linux.zip</span>
</p>
<p>
<strong>Uninstall:</strong>
<br />
<span class="label label-default code">sudo [path]/Install-Linux-x64.sh --uninstall</span>
</p>
</div>
<div class="col-sm-6 mb-3">
<h6>Linux 64-Bit</h6>
<p>
<strong>Download:</strong>
<br />
<a href="/API/ClientDownloads/UbuntuInstaller-x64">Ubuntu x64 Bash Installer</a>
<br />
<a href="/API/ClientDownloads/ManjaroInstaller-x64">Manjaro x64 Bash Installer</a>
<br />
<a href="~/Downloads/Remotely-Linux.zip">Linux x64 Files Only</a>
</p>
<p>
<strong>Install:</strong>
<br />
<span class="label label-default code">sudo [path]/Install-Linux-x64.sh</span>
</p>
<p>
<strong>Local Install:</strong>
<span data-toggle="modal" data-target="#localInstallInfo" class="fas fa-question-circle pointer"></span>
<br />
<span class="label label-default code">sudo [path]/Install-Linux-x64.sh --path [path]/Remotely-Linux.zip</span>
</p>
<p>
<strong>Uninstall:</strong>
<br />
<span class="label label-default code">sudo [path]/Install-Linux-x64.sh --uninstall</span>
</p>
</div>
}
</div>