From 400fa2a7d11497cff6f8e368eb5d5cbb14a4235f Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Wed, 24 Mar 2021 07:14:52 -0700 Subject: [PATCH 01/10] MSI environment test --- .github/workflows/artifacts.yml | 35 ++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 64b00cdb86..747f13314a 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -7,7 +7,7 @@ on: branches: [ net5 ] jobs: - Zip: + zip: runs-on: ${{ matrix.cfg.os }} strategy: fail-fast: false @@ -33,7 +33,7 @@ jobs: with: name: duplicati-${{ matrix.cfg.runtime }} path: publish - Deb: + deb: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -44,4 +44,33 @@ jobs: with: name: deb package path: duplicati*.deb - \ No newline at end of file + msi: + runs-on: windows-latest + needs: zip + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Download zip + uses: actions/download-artifact@v2 + with: + name: duplicati-win-x64 + - name: Install go-msi + run: choco install -y "go-msi" + - name: Prepare PATH + shell: bash + run: | + echo "$WIX\\bin" >> $GITHUB_PATH + echo "C:\\Program Files\\go-msi" >> $GITHUB_PATH + - name: Build MSI + id: buildmsi + shell: bash + run: | + mkdir -p build + msi="duplicati-win-x64.msi" + printf "::set-output name=msi::%s\n" "$msi" + go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version "${GITHUB_REF#refs/tags/}" + - name: Save Artifacts + uses: actions/upload-artifact@v2 + with: + name: duplicati-win-x64-msi + path: msi #${{ steps.buildmsi.outputs.msi }} From a7eed0a5184a86bc6562c433d73b476e75b27849 Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Thu, 1 Apr 2021 08:08:40 -0700 Subject: [PATCH 02/10] MSI work --- .github/workflows/artifacts.yml | 13 +- Installer/Windows/MSI/build.sh | 12 ++ .../MSI/templates/LicenseAgreementDlg_HK.wxs | 36 +++++ Installer/Windows/MSI/templates/WixUI_HK.wxs | 65 ++++++++ .../Windows/MSI/templates/choco/LICENSE.txt | 9 ++ .../MSI/templates/choco/VERIFICATION.txt | 10 ++ .../MSI/templates/choco/chocolateyInstall.ps1 | 7 + .../templates/choco/chocolateyUninstall.ps1 | 6 + .../Windows/MSI/templates/choco/pkg.nuspec | 38 +++++ Installer/Windows/MSI/templates/product.wxs | 142 ++++++++++++++++++ Installer/Windows/MSI/wix.json | 34 +++++ 11 files changed, 367 insertions(+), 5 deletions(-) create mode 100644 Installer/Windows/MSI/build.sh create mode 100644 Installer/Windows/MSI/templates/LicenseAgreementDlg_HK.wxs create mode 100644 Installer/Windows/MSI/templates/WixUI_HK.wxs create mode 100644 Installer/Windows/MSI/templates/choco/LICENSE.txt create mode 100644 Installer/Windows/MSI/templates/choco/VERIFICATION.txt create mode 100644 Installer/Windows/MSI/templates/choco/chocolateyInstall.ps1 create mode 100644 Installer/Windows/MSI/templates/choco/chocolateyUninstall.ps1 create mode 100644 Installer/Windows/MSI/templates/choco/pkg.nuspec create mode 100644 Installer/Windows/MSI/templates/product.wxs create mode 100644 Installer/Windows/MSI/wix.json diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 747f13314a..eac7a05a53 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -54,6 +54,12 @@ jobs: uses: actions/download-artifact@v2 with: name: duplicati-win-x64 + - name: Unpack zip + shell: bash + run: | + mkdir -p bin + cd bin + unzip -o ../duplicati-win-x64.zip - name: Install go-msi run: choco install -y "go-msi" - name: Prepare PATH @@ -65,12 +71,9 @@ jobs: id: buildmsi shell: bash run: | - mkdir -p build - msi="duplicati-win-x64.msi" - printf "::set-output name=msi::%s\n" "$msi" - go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version "${GITHUB_REF#refs/tags/}" + Installer/Windows/MSI/build.sh - name: Save Artifacts uses: actions/upload-artifact@v2 with: name: duplicati-win-x64-msi - path: msi #${{ steps.buildmsi.outputs.msi }} + path: duplicati-win-x64.msi diff --git a/Installer/Windows/MSI/build.sh b/Installer/Windows/MSI/build.sh new file mode 100644 index 0000000000..5265bf030d --- /dev/null +++ b/Installer/Windows/MSI/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash +#This is a helper to make the msi. It assumes a bin folder exists a the root of the project with an unzipped install + +SCRIPTDIR=$( cd "$(dirname "$0")" ; pwd -P ) + +VERSION=`grep '' < $SCRIPTDIR/../../../Duplicati/Server/Duplicati.Server.csproj | sed 's/.*\([^\.]*\.[^\.]*\.[^\.]*\).*<\/Version>.*/\1/'` +VERSION=${VERSION//$'\r\n'} +echo "Building version: ($VERSION)" + +cd $SCRIPTDIR/../../../ + +go-msi make --msi `pwd`/duplicati-win-x64.msi --out `pwd`/build --version $VERSION --path Installer/Windows/MSI/wix.json --src Installer/Windows/MSI/templates \ No newline at end of file diff --git a/Installer/Windows/MSI/templates/LicenseAgreementDlg_HK.wxs b/Installer/Windows/MSI/templates/LicenseAgreementDlg_HK.wxs new file mode 100644 index 0000000000..6fa2469ca8 --- /dev/null +++ b/Installer/Windows/MSI/templates/LicenseAgreementDlg_HK.wxs @@ -0,0 +1,36 @@ + + + + + + + + + + CostingComplete = 1 + "1"]]> + LicenseAccepted = "1" + + + 1 + + + + + {{if gt (.License | len) 0}} + + {{end}} + + + + 1 + + + + + + + + + diff --git a/Installer/Windows/MSI/templates/WixUI_HK.wxs b/Installer/Windows/MSI/templates/WixUI_HK.wxs new file mode 100644 index 0000000000..cda1b3df9c --- /dev/null +++ b/Installer/Windows/MSI/templates/WixUI_HK.wxs @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + "1"]]> + + 1 + + NOT Installed + Installed AND PATCH + + 1 + LicenseAccepted = "1" + + 1 + 1 + NOT WIXUI_DONTVALIDATEPATH + "1"]]> + WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1" + + 1 + 1 + + Installed + + 1 + + 1 + 1 + 1 + + + + + diff --git a/Installer/Windows/MSI/templates/choco/LICENSE.txt b/Installer/Windows/MSI/templates/choco/LICENSE.txt new file mode 100644 index 0000000000..c10af6d11b --- /dev/null +++ b/Installer/Windows/MSI/templates/choco/LICENSE.txt @@ -0,0 +1,9 @@ +From: {{.Choco.LicenseURL}} + +LICENSE + +{{if gt (.License | len) 0}} +{{.License | cat}} +{{else if gt (.Choco.LicenseURL | len) 0}} +{{.Choco.LicenseURL | download}} +{{end}} diff --git a/Installer/Windows/MSI/templates/choco/VERIFICATION.txt b/Installer/Windows/MSI/templates/choco/VERIFICATION.txt new file mode 100644 index 0000000000..7c399c93fa --- /dev/null +++ b/Installer/Windows/MSI/templates/choco/VERIFICATION.txt @@ -0,0 +1,10 @@ +VERIFICATION + +To check the checksum of this package, extract the msi file contained into it, +then run + + checksum.exe {{.Choco.MsiFile}} -t=sha256 + +The result must match + + {{.Choco.MsiSum | upper}} diff --git a/Installer/Windows/MSI/templates/choco/chocolateyInstall.ps1 b/Installer/Windows/MSI/templates/choco/chocolateyInstall.ps1 new file mode 100644 index 0000000000..de61669cc2 --- /dev/null +++ b/Installer/Windows/MSI/templates/choco/chocolateyInstall.ps1 @@ -0,0 +1,7 @@ +$packageName = '{{.Choco.ID}}' +$fileType = 'msi' +$silentArgs = '/quiet'; +$scriptPath = $(Split-Path $MyInvocation.MyCommand.Path); +$fileFullPath = Join-Path $scriptPath '{{.Choco.MsiFile}}'; + +Install-ChocolateyInstallPackage $packageName $fileType $silentArgs $fileFullPath -checksum '{{.Choco.MsiSum}}' -checksumType = 'sha256' diff --git a/Installer/Windows/MSI/templates/choco/chocolateyUninstall.ps1 b/Installer/Windows/MSI/templates/choco/chocolateyUninstall.ps1 new file mode 100644 index 0000000000..d4b26d054c --- /dev/null +++ b/Installer/Windows/MSI/templates/choco/chocolateyUninstall.ps1 @@ -0,0 +1,6 @@ +$packageName = "{{.Choco.ID}}"; +$fileType = 'msi'; +$scriptPath = $(Split-Path $MyInvocation.MyCommand.Path); +$fileFullPath = Join-Path $scriptPath '{{.Choco.MsiFile}}'; + +Uninstall-ChocolateyPackage $packageName $fileType "$fileFullPath /q" diff --git a/Installer/Windows/MSI/templates/choco/pkg.nuspec b/Installer/Windows/MSI/templates/choco/pkg.nuspec new file mode 100644 index 0000000000..f1ed73102f --- /dev/null +++ b/Installer/Windows/MSI/templates/choco/pkg.nuspec @@ -0,0 +1,38 @@ + + + + {{.Choco.ID}} + {{.Choco.Title}} + {{.VersionOk}} + {{.Choco.Authors}} + {{.Choco.Owners}} + {{.Choco.Description}} + {{if gt (.Choco.ProjectURL | len) 0}} + {{.Choco.ProjectURL}} + {{end}} + {{if gt (.Choco.Tags | len) 0}} + {{.Choco.Tags}} + {{end}} + {{if gt (.Choco.LicenseURL | len) 0}} + {{.Choco.LicenseURL}} + {{end}} + {{if gt (.Choco.IconURL | len) 0}} + {{.Choco.IconURL}} + {{end}} + {{if gt (.Choco.ChangeLog | len) 0}} + {{.Choco.ChangeLog}} + {{end}} + {{if .Choco.RequireLicense}} + true + {{else}} + false + {{end}} + + + + + + + + + diff --git a/Installer/Windows/MSI/templates/product.wxs b/Installer/Windows/MSI/templates/product.wxs new file mode 100644 index 0000000000..d035d42d06 --- /dev/null +++ b/Installer/Windows/MSI/templates/product.wxs @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + NOT NEWERVERSIONDETECTED + + + + + + {{if gt (.Files.Items | len) 0}} + + {{range $i, $e := .Files.Items}} + + {{end}} + + {{end}} + {{if gt (.Directories | len) 0}} + {{range $i, $e := .Directories}} + + {{end}} + {{end}} + + + + {{if gt (.Env.Vars | len) 0}} + + {{range $i, $e := .Env.Vars}} + + {{end}} + + {{end}} + + {{if gt (.Shortcuts.Items | len) 0}} + + + + {{range $i, $e := .Shortcuts.Items}} + + {{if gt ($e.Icon | len) 0}} + + {{end}} + + + {{end}} + + + + + {{end}} + + + + {{range $i, $e := .InstallHooks}} + + + {{end}} + {{range $i, $e := .UninstallHooks}} + + + {{end}} + + + {{range $i, $e := .InstallHooks}} + NOT Installed AND NOT REMOVE + {{end}} + {{range $i, $e := .UninstallHooks}} + REMOVE ~= "ALL" + {{end}} + + + + {{if gt (.Env.Vars | len) 0}} + + {{end}} + {{if gt (.Files.Items | len) 0}} + + {{end}} + {{if gt (.Shortcuts.Items | len) 0}} + + {{end}} + {{range $i, $e := .Directories}} + + {{end}} + + + + + + + + + + + + + + + + + + diff --git a/Installer/Windows/MSI/wix.json b/Installer/Windows/MSI/wix.json new file mode 100644 index 0000000000..68b720ccb8 --- /dev/null +++ b/Installer/Windows/MSI/wix.json @@ -0,0 +1,34 @@ +{ + "product": "Duplicati", + "company": "duplicati", + "license": "LICENSE.txt", + "upgrade-code": "69163125-be0b-407e-b65d-80f7023524db", + "files": { + "guid": "95dd9d6c-89e7-4fc7-bfdc-708ffa99c68d", + "items": [ + "bin/Duplicati.GUI.TrayIcon.exe" + ] + }, + "directories": [ + "bin" + ], + "shortcuts": { + "guid": "19455e18-67ec-4ace-9c70-0aa48be5b815", + "items": [ + { + "name": "Duplicati", + "description": "Launch Duplicati", + "target": "[INSTALLDIR]\\Duplicati.GUI.TrayIcon.exe", + "wdir": "INSTALLDIR", + "arguments": "", + "icon": "Assets/application icon/application_icon.ico" + } + ] + }, + "choco": { + "description": "Free backup software to store encrypted backups online", + "project-url": "https://www.duplicati.com/", + "tags": "backup", + "license-url": "https://github.com/duplicati/duplicati/blob/master/LICENSE.txt" + } +} \ No newline at end of file From 4c6439c5073bc9e9784ab5380f02ee16885c0500 Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Thu, 1 Apr 2021 19:25:55 -0700 Subject: [PATCH 03/10] debugging --- .github/workflows/artifacts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index eac7a05a53..81e822d2ea 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -58,6 +58,8 @@ jobs: shell: bash run: | mkdir -p bin + pwd + ls cd bin unzip -o ../duplicati-win-x64.zip - name: Install go-msi From 6810f410d38b51a723f896a2a804c5ccd480c5b6 Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Thu, 1 Apr 2021 20:25:37 -0700 Subject: [PATCH 04/10] Fix shortcut --- Installer/Windows/MSI/wix.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Installer/Windows/MSI/wix.json b/Installer/Windows/MSI/wix.json index 68b720ccb8..786fa3701a 100644 --- a/Installer/Windows/MSI/wix.json +++ b/Installer/Windows/MSI/wix.json @@ -6,7 +6,6 @@ "files": { "guid": "95dd9d6c-89e7-4fc7-bfdc-708ffa99c68d", "items": [ - "bin/Duplicati.GUI.TrayIcon.exe" ] }, "directories": [ @@ -18,7 +17,7 @@ { "name": "Duplicati", "description": "Launch Duplicati", - "target": "[INSTALLDIR]\\Duplicati.GUI.TrayIcon.exe", + "target": "[INSTALLDIR]\\bin\\Duplicati.GUI.TrayIcon.exe", "wdir": "INSTALLDIR", "arguments": "", "icon": "Assets/application icon/application_icon.ico" From 753f61ee1fd0e3aff8186371b2e9fbd5ae2929ea Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Thu, 1 Apr 2021 21:03:11 -0700 Subject: [PATCH 05/10] Don't stop at the debugger in release builds * Also don't show a terminal window for the trayicon --- .gitignore | 1 + .../GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj | 4 +--- Duplicati/Server/Program.cs | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f2c3e652ef..359f8d818a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ changelog-news.txt binfiles.wxs .idea/ .vs/ +/publish/ Installer/debian/*.buildinfo /*.deb diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj b/Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj index f190735654..093cd3726b 100644 --- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj +++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/Duplicati.GUI.TrayIcon.csproj @@ -1,7 +1,7 @@  - Exe + WinExe net5.0 2.0.0.7 LGPL, Copyright ? Duplicati Team 2019 @@ -14,8 +14,6 @@ Duplicati.GUI.TrayIcon Duplicati.ico Duplicati.GUI.TrayIcon.Program - - diff --git a/Duplicati/Server/Program.cs b/Duplicati/Server/Program.cs index 1c3ed0b7e1..c2c731da20 100644 --- a/Duplicati/Server/Program.cs +++ b/Duplicati/Server/Program.cs @@ -177,7 +177,9 @@ public static int Main(string[] args) public static int RealMain(string[] _args) { +#if DEBUG System.Diagnostics.Debugger.Launch(); +#endif //If we are on Windows, append the bundled "win-tools" programs to the search path //We add it last, to allow the user to override with other versions From 90ac3c1cef64728ebc4ce658bdac990afc5cc792 Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Fri, 2 Apr 2021 06:36:33 -0700 Subject: [PATCH 06/10] it already is unzipped --- .github/workflows/artifacts.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 81e822d2ea..374770747a 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -54,14 +54,7 @@ jobs: uses: actions/download-artifact@v2 with: name: duplicati-win-x64 - - name: Unpack zip - shell: bash - run: | - mkdir -p bin - pwd - ls - cd bin - unzip -o ../duplicati-win-x64.zip + path: bin - name: Install go-msi run: choco install -y "go-msi" - name: Prepare PATH From f73d736f54b8aed27b4e367d63d69a104a32edf6 Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Fri, 2 Apr 2021 06:52:55 -0700 Subject: [PATCH 07/10] Add rpm build --- .github/workflows/artifacts.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 374770747a..35ef0a3cf8 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -44,6 +44,17 @@ jobs: with: name: deb package path: duplicati*.deb + rpm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Package + run: Installer/fedora/build.sh + - name: Save Artifacts + uses: actions/upload-artifact@v2 + with: + name: rpm package + path: duplicati*.rpm msi: runs-on: windows-latest needs: zip From 11e4d35efb89afbf8bae00f7ae2aca6c7668ff38 Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Fri, 2 Apr 2021 06:54:15 -0700 Subject: [PATCH 08/10] Fix execute bit --- Installer/fedora/build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 Installer/fedora/build.sh diff --git a/Installer/fedora/build.sh b/Installer/fedora/build.sh old mode 100644 new mode 100755 From 842fc6dbaef455ae26b1e6c4fa74e371adeb700c Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Fri, 2 Apr 2021 07:15:56 -0700 Subject: [PATCH 09/10] More execute bit --- Installer/fedora/docker/runner.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 Installer/fedora/docker/runner.sh diff --git a/Installer/fedora/docker/runner.sh b/Installer/fedora/docker/runner.sh old mode 100644 new mode 100755 From 425a9d23dcdca7d87404387b7e3e57b3c76a29f3 Mon Sep 17 00:00:00 2001 From: Thomas Suckow Date: Fri, 2 Apr 2021 18:13:06 -0700 Subject: [PATCH 10/10] Fix change in sdk location --- Installer/fedora/docker/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Installer/fedora/docker/Dockerfile b/Installer/fedora/docker/Dockerfile index 01bfb6c19e..e94c922085 100644 --- a/Installer/fedora/docker/Dockerfile +++ b/Installer/fedora/docker/Dockerfile @@ -4,8 +4,9 @@ FROM fedora:33 RUN dnf -y install deltarpm RUN dnf -y upgrade -RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc -RUN curl --output /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/33/prod.repo +#No Longer needed +#RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc +#RUN curl --output /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/33/prod.repo RUN dnf check-update RUN dnf -y --allowerasing install @"Minimal Install" @buildsys-build yum-utils rpm-sign gnupg rpmdevtools desktop-file-utils dos2unix dotnet-sdk-5.0