This updates VSS to default use Vanara in favor of AlphaVSS which is no longer maintained. The build for Vanara requires targeting `net8.0-windows7.0`, which will cause significant build overhead and complexity for cross platform builds. To counter this, the setup is to have a single project, `Duplicati.Library.WindowsModules`, that is targeting `net8.0-windows7.0`. The output from this project is then hoisted into the TrayIcon project for Windows builds so the files are available when debugging on Windows. A top-level dummy executable project is added to ensure the project always builds. The built modules are then loaded with reflection when requested. With the use of Vanara there is now also support for using BackupRead to read files without making a VSS snapshot. With BackupRead, it is possible to read locked files, but it still requires the SeBackupPrivilege as VSS does as well. Unfortunately, the `vssapi.dll` file is not shipped for Arm64 on Windows, so even with Vanara this will not work, and only WMIC is supported on Arm64. A workaround is to run Duplicati with x64 emulation if more advanced VSS features are needed (HyperV and MSSQL support). This PR also updates options and filters out unsupported options for each operating system, so options that are not supported by the current OS are not reported and will give warnings if they are used, as opposed to just being ignored. The release builder project has been updated to exclude the unused project, and purge unwanted outputs.
Release Builder tool
This folder contains the ReleaseBuilder tool which builds installers and packages for all supported operating systems.
The tool is tested and used only on MacOS, but can be configured for other operating systems, including WSL and to some extent Windows.
The setup is a mix of environment variables, settings files and commandline arguments.
Required environment
The environment variables used by the tool are:
UPDATER_KEYFILE: The file containing the key used to sign the manifest. Create one with thecreate-keycommand.GPG_KEYFILE: A file encrypted with AESCrypt and the general password. The file has two lines:GPGIDandGPGPassphrasewhich are given to theGPGcommand.AUTHENTICODE_PFXFILE: A PFX file containing a signing key for Authenticode signing of Windows executables (needs to be purchased at a certificate vendor).AUTHENTICODE_PASSWORD: A file encrypted with AESCrypt and the general password. The file contains a single line, which is the password used forosslsigncodeGITHUB_TOKEN_FILE: A personal access token for Github API used to create releases and upload packages to Github.DISCOURSE_TOKEN_FILE: A personal access token for Discourse, used to create release posts.CODESIGN_IDENTITY: The identity used for MacOScodesignwhen signing the binary packages.NOTARIZE_PROFILE: The name of the profile used for notarizing MacOS packages.AWS_UPLOAD_PROFILE: The name of the AWS profile (fromaws-cli) used to upload packages.AWS_UPLOAD_BUCKET: The name of the bucket where the package are uploaded to.RELOAD_UPDATES_API_KEY: A key used to refresh the manifest files being cached by the update servers.
Tools used
These tools are used by the build process, each tool can be changed by using the environment variable name:
DOTNET=dotnet: Mandatory. Used to build the binary contents that will be packaged.GPG=gpg: Optional. Used to created signed release files.SIGNTOOL=osslsigncode: Optional. Used to make Authenticode signing of Windows executables (usingSIGNTOOL=signtool.exeon Windows)CODESIGN=codesign: Optional. Used to sign MacOS binaries and packages.PRODUCTSIGN=productsign: Optional. Used to sign MacOS packages.WIX=wixl: Optional. Required to build the Windows MSI packages.DOCKER=docker: Optional. Required to build some Linux packages.
Invoking the tool
The tool has commandline documentation, which can be invoked with dotnet run help.
The two commands that are currently implemented are:
dotnet run create-keydotnet run build <channel>
The create-key command creates a RSA 1024 bit signing, and encrypts it with the given password.
The build command creates the packages. An example command that builds all packages would be:
dotnet run build debug --version 1.0.0.1
To build only a single platform relase, disable all the features and choose the architectures:
dotnet run build debug --version 1.0.0.1 \
--disable-docker-push true \
--keep-builds true \
--disable-authenticode true \
--disable-signcode true \
--disable-notarize-signing true \
--disable-gpg-signing true \
--disable-s3-upload true \
--disable-github-upload true \
--disable-update-server-reload true \
--disable-discourse-announce true \
--targets win-x86-gui.zip \
--targets win-x64-gui.zip \