From 0dd1c505880ebfb8fab91074046136738bcc461b Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Sun, 22 Dec 2019 13:25:52 -0800 Subject: [PATCH] Return to single-file EXE for desktop client. --- Desktop.Win/Desktop.Win.csproj | 15 +++++ Desktop.Win/FodyWeavers.xml | 4 ++ Desktop.Win/FodyWeavers.xsd | 111 +++++++++++++++++++++++++++++++++ Desktop.Win/packages.config | 2 + Server/Pages/Agents.cshtml | 2 +- Utilities/Publish.ps1 | 19 ++---- 6 files changed, 138 insertions(+), 15 deletions(-) create mode 100644 Desktop.Win/FodyWeavers.xml create mode 100644 Desktop.Win/FodyWeavers.xsd diff --git a/Desktop.Win/Desktop.Win.csproj b/Desktop.Win/Desktop.Win.csproj index 0c2821ee..456555c8 100644 --- a/Desktop.Win/Desktop.Win.csproj +++ b/Desktop.Win/Desktop.Win.csproj @@ -1,5 +1,6 @@  + Debug @@ -106,6 +107,9 @@ 0A723650D9A0A3D7D0E4A15299984A95177F9DBD + + ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll + ..\packages\MessagePack.1.8.80\lib\net47\MessagePack.dll @@ -313,9 +317,20 @@ false + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/Desktop.Win/FodyWeavers.xml b/Desktop.Win/FodyWeavers.xml new file mode 100644 index 00000000..a5dcf04f --- /dev/null +++ b/Desktop.Win/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Desktop.Win/FodyWeavers.xsd b/Desktop.Win/FodyWeavers.xsd new file mode 100644 index 00000000..44a53744 --- /dev/null +++ b/Desktop.Win/FodyWeavers.xsd @@ -0,0 +1,111 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Desktop.Win/packages.config b/Desktop.Win/packages.config index 1dc205a6..1e251049 100644 --- a/Desktop.Win/packages.config +++ b/Desktop.Win/packages.config @@ -1,5 +1,7 @@  + + diff --git a/Server/Pages/Agents.cshtml b/Server/Pages/Agents.cshtml index 187d36e3..45a7ebb9 100644 --- a/Server/Pages/Agents.cshtml +++ b/Server/Pages/Agents.cshtml @@ -14,7 +14,7 @@

Download:
- Windows Installer + Windows EXE

@*
diff --git a/Utilities/Publish.ps1 b/Utilities/Publish.ps1 index 04d83689..e0ce0c84 100644 --- a/Utilities/Publish.ps1 +++ b/Utilities/Publish.ps1 @@ -150,21 +150,12 @@ Get-ChildItem -Path "$Root\ScreenCast.Win\bin\x86\Release\" -Exclude "*.xml" | C Get-ChildItem -Path "$Root\ScreenCast.Win\bin\x64\Release\" -Exclude "*.xml" | Copy-Item -Destination ".\Agent\bin\Release\netcoreapp3.1\win10-x64\publish\ScreenCast\" -Force -# Publish Windows GUI App -$PublishDir = "$Root\Server\wwwroot\Downloads\WinDesktop\" -if (!(Test-Path -Path $PublishDir)) { - New-Item -Path $PublishDir -ItemType Directory -} -Get-ChildItem -Path $PublishDir | ForEach-Object { - Remove-Item -Path $_.FullName -Force -Recurse -} -&"$MSBuildPath" "$Root\Desktop.Win" /t:Publish /p:Configuration=Release /p:Platform=AnyCPU /p:PublishDir="$PublishDir" -Rename-Item -Path "$PublishDir\setup.exe" -NewName "Remotely_Setup.exe" -Force +# Build Windows GUI App + +&"$MSBuildPath" "$Root\Desktop.Win" /t:Build /p:Configuration=Release /p:Platform=AnyCPU +Move-Item -Path "$Root\Desktop.Win\bin\Release\Remotely_Desktop.exe" -Destination "$Root\Server\wwwroot\Downloads\Remotely_Desktop.exe" if ($SignAssemblies) { - &"$Root\Utilities\signtool.exe" sign /f "$CertificatePath" /p $CertificatePassword /t http://timestamp.digicert.com "$PublishDir\Remotely_Setup.exe" - Get-ChildItem -Path $PublishDir -Filter "Remotely_Desktop.exe" -Recurse | ForEach-Object { - &"$Root\Utilities\signtool.exe" sign /n "Translucency Software" /t http://timestamp.digicert.com "$($_.FullName)" - } + &"$Root\Utilities\signtool.exe" sign /f "$CertificatePath" /p $CertificatePassword /t http://timestamp.digicert.com "$Root\Server\wwwroot\Downloads\Remotely_Desktop.exe" }