diff --git a/Desktop.Win.Wrapper/Desktop.Win.Wrapper.csproj b/Desktop.Win.Wrapper/Desktop.Win.Wrapper.csproj index 724033bc8..1cd01cd20 100644 --- a/Desktop.Win.Wrapper/Desktop.Win.Wrapper.csproj +++ b/Desktop.Win.Wrapper/Desktop.Win.Wrapper.csproj @@ -84,6 +84,8 @@ + + diff --git a/Desktop.Win.Wrapper/Install.ps1 b/Desktop.Win.Wrapper/Install.ps1 index faff4c9db..aa8142256 100644 --- a/Desktop.Win.Wrapper/Install.ps1 +++ b/Desktop.Win.Wrapper/Install.ps1 @@ -1,4 +1,5 @@ [System.IO.Directory]::CreateDirectory("$env:AppData\Remotely") Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$env:AppData\Remotely\dotnet-install.ps1" &"$env:AppData\Remotely\dotnet-install.ps1" -Runtime dotnet -&"$env:AppData\Remotely\dotnet-install.ps1" -Runtime windowsdesktop \ No newline at end of file +&"$env:AppData\Remotely\dotnet-install.ps1" -Runtime windowsdesktop +Start-Process -FilePath "dotnet.exe" -ArgumentList "$PSScriptRoot\Remotely_Desktop.dll" -WindowStyle Hidden \ No newline at end of file diff --git a/Desktop.Win.Wrapper/MainWindow.xaml.cs b/Desktop.Win.Wrapper/MainWindow.xaml.cs index 739fdf23a..b9c148a6b 100644 --- a/Desktop.Win.Wrapper/MainWindow.xaml.cs +++ b/Desktop.Win.Wrapper/MainWindow.xaml.cs @@ -1,6 +1,10 @@ using System; using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.IO.Compression; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows; @@ -12,6 +16,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using PathIO = System.IO.Path; namespace Remotely.Desktop.Win.Wrapper { @@ -20,6 +25,7 @@ namespace Remotely.Desktop.Win.Wrapper /// public partial class MainWindow : Window { + private readonly string tempDir = Directory.CreateDirectory(PathIO.Combine(PathIO.GetTempPath(), "Remotely_Desktop")).FullName; public MainWindow() { InitializeComponent(); @@ -45,27 +51,59 @@ private void Window_Loaded(object sender, RoutedEventArgs e) ExtractRemotely(); ExtractInstallScript(); RunInstallScript(); - RunRemotely(); - } - - private void RunRemotely() - { - StatusText.Text = "Starting up..."; + Close(); } private void ExtractRemotely() { - StatusText.Text = "Extracting files..."; + try + { + StatusText.Text = "Extracting files..."; + var zipPath = PathIO.Combine(tempDir, "Remotely_Desktop.zip"); + using (var mrs = Assembly.GetExecutingAssembly() + .GetManifestResourceStream("Remotely.Desktop.Win.Wrapper.Remotely_Desktop.zip")) + { + using (var fs = new FileStream(zipPath, FileMode.Create)) + { + mrs.CopyTo(fs); + } + } + ZipFile.ExtractToDirectory(zipPath, tempDir); + } + catch { } } private void RunInstallScript() { - StatusText.Text = "Updating .NET Core runtime..."; + try + { + StatusText.Text = "Updating .NET Core runtime..."; + var installPath = PathIO.Combine(tempDir, "Install.ps1"); + Process.Start(new ProcessStartInfo() + { + FileName = "powershell.exe", + Arguments = $"-executionpolicy bypass -f \"{installPath}\"", + WindowStyle = ProcessWindowStyle.Hidden + }); + } + catch { } } private void ExtractInstallScript() { - + try + { + var installPath = PathIO.Combine(tempDir, "Install.ps1"); + using (var mrs = Assembly.GetExecutingAssembly() + .GetManifestResourceStream("Remotely.Desktop.Win.Wrapper.Install.ps1")) + { + using (var fs = new FileStream(installPath, FileMode.Create)) + { + mrs.CopyTo(fs); + } + } + } + catch { } } } } diff --git a/Server/Pages/Agents.cshtml b/Server/Pages/Agents.cshtml index 924bf163a..bbbc37633 100644 --- a/Server/Pages/Agents.cshtml +++ b/Server/Pages/Agents.cshtml @@ -9,20 +9,20 @@
Instant desktop sharing. No account required.
-
+ @*
Windows (64-Bit)

Download:
Windows EXE

-
+
*@
-
Windows (32-Bit)
+
Windows (64/32-Bit)

Download:
- Windows EXE + Windows EXE