This commit is contained in:
Jared Goodwin 2019-06-19 20:02:40 -07:00
parent 91a1af3be0
commit b90b08f77d
12 changed files with 439 additions and 382 deletions

File diff suppressed because it is too large Load Diff

View File

@ -143,6 +143,10 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Drawing.Common.4.5.1\lib\net461\System.Drawing.Common.dll</HintPath>
</Reference>
<Reference Include="System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath>
</Reference>

View File

@ -47,6 +47,7 @@ namespace Remotely.Desktop.Win
private async void Window_Loaded(object sender, RoutedEventArgs e)
{
await MainWindowViewModel.Current.Init();
MainWindowViewModel.Current.CheckForAdminRights();
}
private async void HostHyperlink_Click(object sender, RoutedEventArgs e)

View File

@ -1,4 +1,5 @@
using System;
using PropertyChanged;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
@ -7,7 +8,8 @@ using System.Threading.Tasks;
namespace Remotely.Desktop.Win.ViewModels
{
public class HostNamePromptViewModel : INotifyPropertyChanged
[AddINotifyPropertyChangedInterface]
public class HostNamePromptViewModel
{
public static HostNamePromptViewModel Current { get; private set; }
public HostNamePromptViewModel()
@ -15,7 +17,5 @@ namespace Remotely.Desktop.Win.ViewModels
Current = this;
}
public string Host { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
}
}

View File

@ -44,8 +44,6 @@ namespace Remotely.Desktop.Win.ViewModels
public static MainWindowViewModel Current { get; private set; }
public AudioCapturer AudioCapturer { get; private set; }
public bool AllowHostChange
{
get
@ -54,6 +52,7 @@ namespace Remotely.Desktop.Win.ViewModels
}
}
public AudioCapturer AudioCapturer { get; private set; }
public Conductor Conductor { get; }
public Config Config { get; private set; }
@ -74,6 +73,21 @@ namespace Remotely.Desktop.Win.ViewModels
public ObservableCollection<Viewer> Viewers { get; } = new ObservableCollection<Viewer>();
public void CheckForAdminRights()
{
if (!new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator))
{
var result = MessageBox.Show(Application.Current.MainWindow, "Remotely isn't running with administrator rights. Would you like to re-launch as an admin?", "Run as Admin", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
var psi = new ProcessStartInfo(Assembly.GetExecutingAssembly().Location);
psi.Verb = "RunAs";
Process.Start(psi);
Environment.Exit(0);
}
}
}
public void FirePropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
@ -104,32 +118,14 @@ namespace Remotely.Desktop.Win.ViewModels
catch (Exception ex)
{
Logger.Write(ex);
MessageBox.Show("Failed to connect to server.", "Connection Failed", MessageBoxButton.OK, MessageBoxImage.Warning);
MessageBox.Show(Application.Current.MainWindow, "Failed to connect to server.", "Connection Failed", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
Conductor.SetMessageHandlers(new WinInput());
await Conductor.CasterSocket.SendDeviceInfo(Conductor.ServiceID, Environment.MachineName);
await Conductor.CasterSocket.GetSessionID();
CheckForAdminRights();
}
private void CheckForAdminRights()
{
if (!new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator))
{
var result = MessageBox.Show("Remotely isn't running with administrator rights. Would you like to re-launch as an admin?", "Run as Admin", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
var psi = new ProcessStartInfo(Assembly.GetExecutingAssembly().Location);
psi.Verb = "RunAs";
Process.Start(psi);
Environment.Exit(0);
}
}
}
public void PromptForHostName()
{
var prompt = new HostNamePrompt();
@ -177,10 +173,10 @@ namespace Remotely.Desktop.Win.ViewModels
{
App.Current.Dispatcher.Invoke(() =>
{
var result = MessageBox.Show($"You've received a connection request from {screenCastRequest.RequesterName}. Accept?", "Connection Request", MessageBoxButton.YesNo, MessageBoxImage.Question);
var result = MessageBox.Show(Application.Current.MainWindow, $"You've received a connection request from {screenCastRequest.RequesterName}. Accept?", "Connection Request", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
Task.Run(async() =>
Task.Run(async () =>
{
ICapturer capturer;
try

View File

@ -24,6 +24,7 @@
<package id="PropertyChanged.Fody" version="3.0.1" targetFramework="net472" />
<package id="System.Buffers" version="4.5.0" targetFramework="net472" />
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net472" />
<package id="System.Drawing.Common" version="4.5.1" targetFramework="net472" />
<package id="System.IO.Pipelines" version="4.5.3" targetFramework="net472" />
<package id="System.Memory" version="4.5.3" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />

View File

@ -155,6 +155,7 @@ Global
{943613A9-3B59-4929-B5D3-4B1D95D7E4C1}.Release|x64.ActiveCfg = Release
{943613A9-3B59-4929-B5D3-4B1D95D7E4C1}.Release|x64.Build.0 = Release
{943613A9-3B59-4929-B5D3-4B1D95D7E4C1}.Release|x86.ActiveCfg = Release
{943613A9-3B59-4929-B5D3-4B1D95D7E4C1}.Release|x86.Build.0 = Release
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1 +1 @@
2019.06.15.1805
2019.06.19.1959

View File

@ -31,16 +31,16 @@
<div class="row mb-3">
<h4>Portable Remote Control</h4>
<h4>Screen-Sharing Client</h4>
<div class="text-info col-sm-12 pl-0 mb-2">
Instant desktop sharing with no installation or hassles.
Instant desktop sharing. No account required.
</div>
<div class="col-sm-6">
<h6 class="font-weight-bold">Windows (32/64-Bit)</h6>
<p>
<strong>Download:</strong>
<br />
<a href="~/Downloads/Remotely_Desktop.exe">Windows Portable EXE</a>
<a href="~/Downloads/Remotely_Desktop_Installer.msi">Windows Installer</a>
</p>
</div>
<div class="col-sm-6">

View File

@ -102,7 +102,7 @@
<partial name="_OSK.cshtml" />
<footer>
<div class="footer-wrapper">
<p>&copy; 2018 - Translucency Software</p>
<p>&copy; @DateTime.Now.Year - Translucency Software</p>
<p hidden="hidden">
<span>File Transfer:</span>
<progress id="fileTransferProgress"></progress>

View File

@ -86,7 +86,6 @@ Move-Item -Path "$PublishDir\Remotely_Desktop.Unix.zip" -Destination "$Root\Serv
# Build .NET Framework Projects
&"$MSBuildPath" "$Root\ScreenCast.Win" /t:Build /p:Configuration=Release
&"$MSBuildPath" "$Root\Desktop.Win" /t:Build /p:Configuration=Release
&"$MSBuildPath" "$Root\Desktop.Win" /t:Build /p:Configuration=Release
# Copy .NET Framework ScreenCaster to Agent output folder.
@ -118,8 +117,8 @@ while ((Test-Path -Path "$PublishDir\Remotely-Linux.zip") -eq $false){
Move-Item -Path "$PublishDir\Remotely-Linux.zip" -Destination "$Root\Server\wwwroot\Downloads\Remotely-Linux.zip" -Force
# Copy desktop app to Downloads folder.
&"$DevEnv" "$Root\Desktop.Win.Installer\Desktop.Win.Installer.vdproj" /build "Release"
Copy-Item -Path ".\Desktop.Win.Installer\bin\Release\Remotely_Desktop_Installer.msi" -Destination ".\Server\wwwroot\Downloads\Remotely_Desktop_Installer.msi" -Force
&"$DevEnv" "$Root\Desktop.Win.Installer\Desktop.Win.Installer.vdproj" /build "Release|x86"
Copy-Item -Path ".\Desktop.Win.Installer\Release\Remotely_Desktop_Installer.msi" -Destination ".\Server\wwwroot\Downloads\Remotely_Desktop_Installer.msi" -Force
if ($RID.Length -gt 0 -and $OutDir.Length -gt 0) {