From 3f28faba3913d242de16d5c8aa8eef921e869613 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Fri, 18 Aug 2023 15:04:03 -0700 Subject: [PATCH] Add namespaces to Program.cs. Make publish locations runtime-agnostic. --- Desktop.Linux/Program.cs | 4 ++- .../PublishProfiles/packaged-linux-x64.pubxml | 2 +- Desktop.Win/Program.cs | 4 ++- .../packaged-win-x64-debug.pubxml | 2 +- .../PublishProfiles/packaged-win-x64.pubxml | 2 +- .../PublishProfiles/packaged-win-x86.pubxml | 2 +- .../PublishProfiles/wrapper-x64.pubxml | 18 ----------- .../PublishProfiles/wrapper-x86.pubxml | 18 ----------- Utilities/Publish.ps1 | 30 +++++++++---------- submodules/Immense.RemoteControl | 2 +- 10 files changed, 26 insertions(+), 58 deletions(-) delete mode 100644 Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml delete mode 100644 Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml diff --git a/Desktop.Linux/Program.cs b/Desktop.Linux/Program.cs index 76b4e1d0e..10972d166 100644 --- a/Desktop.Linux/Program.cs +++ b/Desktop.Linux/Program.cs @@ -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. @@ -105,4 +107,4 @@ public static async Task Main(string[] args) } catch (TaskCanceledException) { } } -} +} \ No newline at end of file diff --git a/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml b/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml index 19c75459c..3528e3f69 100644 --- a/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml +++ b/Desktop.Linux/Properties/PublishProfiles/packaged-linux-x64.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release x64 net7.0 - ..\Agent\bin\Release\net7.0\linux-x64\publish\Desktop + ..\Agent\bin\publish\linux-x64\Desktop linux-x64 true False diff --git a/Desktop.Win/Program.cs b/Desktop.Win/Program.cs index ea8d1bd5b..64a932a8a 100644 --- a/Desktop.Win/Program.cs +++ b/Desktop.Win/Program.cs @@ -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. @@ -95,4 +97,4 @@ public static async Task Main(string[] args) } catch (TaskCanceledException) { } } -} +} \ No newline at end of file diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml index 846519dc3..4389db11e 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64-debug.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Debug x64 net7.0 - ..\Agent\bin\Release\net7.0\win-x64\publish\Desktop + ..\Agent\bin\publish\win-x64\Desktop true win-x64 True diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml index 525132a4b..524005f6a 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x64.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release x64 net7.0 - ..\Agent\bin\Release\net7.0\win-x64\publish\Desktop + ..\Agent\bin\publish\win-x64\Desktop true win-x64 false diff --git a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml index 0f1e16fe6..0d321d1ad 100644 --- a/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml +++ b/Desktop.Win/Properties/PublishProfiles/packaged-win-x86.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release x86 net7.0 - ..\Agent\bin\Release\net7.0\win-x86\publish\Desktop + ..\Agent\bin\publish\win-x86\Desktop win-x86 true False diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml deleted file mode 100644 index 56eb1c866..000000000 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x64.pubxml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - FileSystem - Release - x64 - net7.0-windows - bin\Release\win-x64\publish\ - true - win-x64 - False - False - True - - \ No newline at end of file diff --git a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml b/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml deleted file mode 100644 index 2144ba589..000000000 --- a/Desktop.Win/Properties/PublishProfiles/wrapper-x86.pubxml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - FileSystem - Release - x86 - net7.0 - bin\Release\win-x86\publish\ - true - win-x86 - False - False - True - - \ No newline at end of file diff --git a/Utilities/Publish.ps1 b/Utilities/Publish.ps1 index ddb607fd1..e4eb184af 100644 --- a/Utilities/Publish.ps1 +++ b/Utilities/Publish.ps1 @@ -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 @@ -155,7 +155,7 @@ 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" @@ -163,7 +163,7 @@ while ((Test-Path -Path "$PublishDir\Remotely-Win-x64.zip") -eq $false){ } 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" @@ -171,7 +171,7 @@ while ((Test-Path -Path "$PublishDir\Remotely-Win-x86.zip") -eq $false){ } 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" diff --git a/submodules/Immense.RemoteControl b/submodules/Immense.RemoteControl index 7b16798dd..9395713ca 160000 --- a/submodules/Immense.RemoteControl +++ b/submodules/Immense.RemoteControl @@ -1 +1 @@ -Subproject commit 7b16798dd39d3fd8e2877a380cc50d7c4e55eb4d +Subproject commit 9395713ca70430b8b473cccb6fd63f888aeb6aa9