Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSI environment test #3

Open
wants to merge 10 commits into
base: net5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ net5 ]

jobs:
Zip:
zip:
runs-on: ${{ matrix.cfg.os }}
strategy:
fail-fast: false
Expand All @@ -33,7 +33,7 @@ jobs:
with:
name: duplicati-${{ matrix.cfg.runtime }}
path: publish
Deb:
deb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -44,4 +44,42 @@ 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
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download zip
uses: actions/download-artifact@v2
with:
name: duplicati-win-x64
path: bin
- 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: |
Installer/Windows/MSI/build.sh
- name: Save Artifacts
uses: actions/upload-artifact@v2
with:
name: duplicati-win-x64-msi
path: duplicati-win-x64.msi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ changelog-news.txt
binfiles.wxs
.idea/
.vs/
/publish/

Installer/debian/*.buildinfo
/*.deb
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Version>2.0.0.7</Version>
<Copyright>LGPL, Copyright ? Duplicati Team 2019</Copyright>
Expand All @@ -14,8 +14,6 @@
<RootNamespace>Duplicati.GUI.TrayIcon</RootNamespace>
<ApplicationIcon>Duplicati.ico</ApplicationIcon>
<StartupObject>Duplicati.GUI.TrayIcon.Program</StartupObject>
<StartupObject></StartupObject>
<ApplicationIcon />
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions Duplicati/Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions Installer/Windows/MSI/build.sh
Original file line number Diff line number Diff line change
@@ -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 '<Version>' < $SCRIPTDIR/../../../Duplicati/Server/Duplicati.Server.csproj | sed 's/.*<Version>\([^\.]*\.[^\.]*\.[^\.]*\).*<\/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
36 changes: 36 additions & 0 deletions Installer/Windows/MSI/templates/LicenseAgreementDlg_HK.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="LicenseAgreementDlg_HK" Width="370" Height="270" Title="!(loc.LicenseAgreementDlg_Title)">
<Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="207" Width="330" Height="18" CheckBoxValue="1" Property="LicenseAccepted"
Text="!(loc.LicenseAgreementDlgLicenseAcceptedCheckBox)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish>
<Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
<Condition Action="enable">LicenseAccepted = "1"</Condition>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)" />
<Control Id="LicenseText" Type="ScrollableText" X="20" Y="60" Width="330" Height="140" Sunken="yes" TabSkip="no">

{{if gt (.License | len) 0}}
<Text SourceFile="../Installer/Windows/Resources/LGPL21.rtf" />
{{end}}

</Control>
<Control Id="Print" Type="PushButton" X="112" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
<Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.LicenseAgreementDlgTitle)" />
</Dialog>
</UI>
</Fragment>
</Wix>
65 changes: 65 additions & 0 deletions Installer/Windows/MSI/templates/WixUI_HK.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>

<UI Id="WixUI_HK">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />

<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />

<!-- Make sure to include custom dialogs in the installer database via a DialogRef command,
especially if they are not included explicitly in the publish chain below -->
<DialogRef Id="LicenseAgreementDlg_HK"/>

<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog"
{{if gt (.License | len) 0}}
Value="LicenseAgreementDlg_HK"
{{else}}
Value="InstallDirDlg"
{{end}}
>NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

<Publish Dialog="LicenseAgreementDlg_HK" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg_HK" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>

<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg_HK">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>

<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed</Publish>

<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
</UI>

<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>
9 changes: 9 additions & 0 deletions Installer/Windows/MSI/templates/choco/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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}}
10 changes: 10 additions & 0 deletions Installer/Windows/MSI/templates/choco/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -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}}
7 changes: 7 additions & 0 deletions Installer/Windows/MSI/templates/choco/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -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'
6 changes: 6 additions & 0 deletions Installer/Windows/MSI/templates/choco/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -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"
38 changes: 38 additions & 0 deletions Installer/Windows/MSI/templates/choco/pkg.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata>
<id>{{.Choco.ID}}</id>
<title>{{.Choco.Title}}</title>
<version>{{.VersionOk}}</version>
<authors>{{.Choco.Authors}}</authors>
<owners>{{.Choco.Owners}}</owners>
<description>{{.Choco.Description}}</description>
{{if gt (.Choco.ProjectURL | len) 0}}
<projectUrl>{{.Choco.ProjectURL}}</projectUrl>
{{end}}
{{if gt (.Choco.Tags | len) 0}}
<tags>{{.Choco.Tags}}</tags>
{{end}}
{{if gt (.Choco.LicenseURL | len) 0}}
<licenseUrl>{{.Choco.LicenseURL}}</licenseUrl>
{{end}}
{{if gt (.Choco.IconURL | len) 0}}
<iconUrl>{{.Choco.IconURL}}</iconUrl>
{{end}}
{{if gt (.Choco.ChangeLog | len) 0}}
<releaseNotes>{{.Choco.ChangeLog}}</releaseNotes>
{{end}}
{{if .Choco.RequireLicense}}
<requireLicenseAcceptance>true</requireLicenseAcceptance>
{{else}}
<requireLicenseAcceptance>false</requireLicenseAcceptance>
{{end}}
</metadata>
<files>
<file src="{{.Choco.BuildDir}}\chocolateyInstall.ps1" target="tools" />
<file src="{{.Choco.BuildDir}}\chocolateyUninstall.ps1" target="tools" />
<file src="{{.Choco.BuildDir}}\{{.Choco.MsiFile}}" target="tools" />
<file src="{{.Choco.BuildDir}}\LICENSE.txt" target="tools" />
<file src="{{.Choco.BuildDir}}\VERIFICATION.txt" target="tools" />
</files>
</package>
Loading