Skip to content

Commit

Permalink
Add namespaces to Program.cs. Make publish locations runtime-agnostic.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Aug 18, 2023
1 parent 6fc0d98 commit 3f28fab
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 58 deletions.
4 changes: 3 additions & 1 deletion Desktop.Linux/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using Immense.RemoteControl.Desktop.UI;
using Desktop.Shared.Services;

namespace Remotely.Desktop.XPlat;

public class Program
{
// This is needed for the visual designer to work.
Expand Down Expand Up @@ -105,4 +107,4 @@ public static async Task Main(string[] args)
}
catch (TaskCanceledException) { }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<PublishDir>..\Agent\bin\Release\net7.0\linux-x64\publish\Desktop</PublishDir>
<PublishDir>..\Agent\bin\publish\linux-x64\Desktop</PublishDir>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
Expand Down
4 changes: 3 additions & 1 deletion Desktop.Win/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
using Immense.RemoteControl.Desktop.UI;
using Desktop.Shared.Services;

namespace Remotely.Desktop.Win;

public class Program
{
// This is needed for the visual designer to work.
Expand Down Expand Up @@ -95,4 +97,4 @@ public static async Task Main(string[] args)
}
catch (TaskCanceledException) { }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<PublishDir>..\Agent\bin\Release\net7.0\win-x64\publish\Desktop</PublishDir>
<PublishDir>..\Agent\bin\publish\win-x64\Desktop</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishSingleFile>True</PublishSingleFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<TargetFramework>net7.0</TargetFramework>
<PublishDir>..\Agent\bin\Release\net7.0\win-x64\publish\Desktop</PublishDir>
<PublishDir>..\Agent\bin\publish\win-x64\Desktop</PublishDir>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishSingleFile>false</PublishSingleFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Configuration>Release</Configuration>
<Platform>x86</Platform>
<TargetFramework>net7.0</TargetFramework>
<PublishDir>..\Agent\bin\Release\net7.0\win-x86\publish\Desktop</PublishDir>
<PublishDir>..\Agent\bin\publish\win-x86\Desktop</PublishDir>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
Expand Down
18 changes: 0 additions & 18 deletions Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml

This file was deleted.

18 changes: 0 additions & 18 deletions Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml

This file was deleted.

30 changes: 15 additions & 15 deletions Utilities/Publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,25 @@ if ([string]::IsNullOrWhiteSpace($MSBuildPath) -or !(Test-Path -Path $MSBuildPat


# Clear publish folders.
if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish" | Remove-Item -Force -Recurse
if ((Test-Path -Path "$Root\Agent\bin\publish\win-x64") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\publish\win-x64" | Remove-Item -Force -Recurse
}
if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish" ) -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish" | Remove-Item -Force -Recurse
if ((Test-Path -Path "$Root\Agent\bin\publish\win-x86" ) -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\publish\win-x86" | Remove-Item -Force -Recurse
}
if ((Test-Path -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish" | Remove-Item -Force -Recurse
if ((Test-Path -Path "$Root\Agent\bin\publish\linux-x64") -eq $true) {
Get-ChildItem -Path "$Root\Agent\bin\publish\linux-x64" | Remove-Item -Force -Recurse
}


# Publish Core clients.
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win-x64\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime linux-x64 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\linux-x64\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x86 --self-contained --configuration Release --output "$Root\Agent\bin\Release\net7.0\win-x86\publish" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x64 --self-contained --configuration Release --output "$Root\Agent\bin\publish\win-x64" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime linux-x64 --self-contained --configuration Release --output "$Root\Agent\bin\publish\linux-x64" "$Root\Agent"
dotnet publish /p:Version=$CurrentVersion /p:FileVersion=$CurrentVersion --runtime win-x86 --self-contained --configuration Release --output "$Root\Agent\bin\publish\win-x86" "$Root\Agent"

New-Item -Path "$Root\Agent\bin\Release\net7.0\win-x64\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\Release\net7.0\win-x86\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\Release\net7.0\linux-x64\publish\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\publish\win-x64\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\publish\win-x86\Desktop\" -ItemType Directory -Force
New-Item -Path "$Root\Agent\bin\publish\linux-x64\Desktop\" -ItemType Directory -Force


# Publish Linux ScreenCaster
Expand Down Expand Up @@ -155,23 +155,23 @@ if ($SignAssemblies) {
}

# Compress Core clients.
$PublishDir = "$Root\Agent\bin\Release\net7.0\win-x64\publish"
$PublishDir = "$Root\Agent\bin\publish\win-x64"
Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win-x64.zip" -Force
while ((Test-Path -Path "$PublishDir\Remotely-Win-x64.zip") -eq $false){
Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x64.zip"
Start-Sleep -Seconds 3
}
Move-Item -Path "$PublishDir\Remotely-Win-x64.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win-x64.zip" -Force

$PublishDir = "$Root\Agent\bin\Release\net7.0\win-x86\publish"
$PublishDir = "$Root\Agent\bin\publish\win-x86"
Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Win-x86.zip" -Force
while ((Test-Path -Path "$PublishDir\Remotely-Win-x86.zip") -eq $false){
Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x86.zip"
Start-Sleep -Seconds 3
}
Move-Item -Path "$PublishDir\Remotely-Win-x86.zip" -Destination "$Root\Server\wwwroot\Content\Remotely-Win-x86.zip" -Force

$PublishDir = "$Root\Agent\bin\Release\net7.0\linux-x64\publish"
$PublishDir = "$Root\Agent\bin\publish\linux-x64"
Compress-Archive -Path "$PublishDir\*" -DestinationPath "$PublishDir\Remotely-Linux.zip" -Force
while ((Test-Path -Path "$PublishDir\Remotely-Linux.zip") -eq $false){
Write-Host "Waiting for archive to finish: $PublishDir\Remotely-Win-x86.zip"
Expand Down

0 comments on commit 3f28fab

Please sign in to comment.