From a5400e016234150c858ae04624bdab5725045c1b Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 14 Jul 2016 17:09:40 -0700 Subject: [PATCH] Windows installer now installs a batch file and Path variable settings to make zerotier-cli work in the Windows CLI (1.1.12 MSI updated on web for this too) and a Chocolatey packaging job for ZeroTier One. --- .gitignore | 1 + ext/installfiles/windows/ZeroTier One.aip | 40 ++++++++-- .../chocolatey/zerotier-one/tools/LICENSE.txt | 11 +++ .../zerotier-one/tools/VERIFICATION.txt | 5 ++ .../zerotier-one/tools/chocolateyinstall.ps1 | 8 ++ .../tools/chocolateyuninstall.ps1 | 30 ++++++++ .../zerotier-one/zerotier-one.nuspec | 76 +++++++++++++++++++ 7 files changed, 164 insertions(+), 7 deletions(-) create mode 100644 ext/installfiles/windows/chocolatey/zerotier-one/tools/LICENSE.txt create mode 100644 ext/installfiles/windows/chocolatey/zerotier-one/tools/VERIFICATION.txt create mode 100644 ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyinstall.ps1 create mode 100644 ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyuninstall.ps1 create mode 100644 ext/installfiles/windows/chocolatey/zerotier-one/zerotier-one.nuspec diff --git a/.gitignore b/.gitignore index 66f57dfa9..8bf3c55bb 100755 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,4 @@ java/build_win32/ windows/WinUI/obj/ windows/WinUI/bin/ windows/ZeroTierOne/Debug/ +/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg diff --git a/ext/installfiles/windows/ZeroTier One.aip b/ext/installfiles/windows/ZeroTier One.aip index 3f02f8905..fdbbeea9a 100644 --- a/ext/installfiles/windows/ZeroTier One.aip +++ b/ext/installfiles/windows/ZeroTier One.aip @@ -1,7 +1,7 @@ - + @@ -26,10 +26,10 @@ - + - + @@ -58,7 +58,7 @@ - + @@ -130,6 +130,10 @@ + + + + @@ -142,6 +146,7 @@ + @@ -204,6 +209,8 @@ + + @@ -213,6 +220,12 @@ + + + + + + @@ -228,6 +241,9 @@ + + + @@ -238,8 +254,8 @@ - - + + @@ -253,6 +269,9 @@ + + + @@ -323,6 +342,13 @@ + + + + + + + @@ -330,7 +356,7 @@ - + diff --git a/ext/installfiles/windows/chocolatey/zerotier-one/tools/LICENSE.txt b/ext/installfiles/windows/chocolatey/zerotier-one/tools/LICENSE.txt new file mode 100644 index 000000000..ce0564ac8 --- /dev/null +++ b/ext/installfiles/windows/chocolatey/zerotier-one/tools/LICENSE.txt @@ -0,0 +1,11 @@ +From: https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/COPYING + +LICENSE + +ZeroTier One is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or (at +your option) any later version. + +See the file ‘LICENSE.GPL-3’ for the text of the GNU GPL version 3. +If that file is not present, see . diff --git a/ext/installfiles/windows/chocolatey/zerotier-one/tools/VERIFICATION.txt b/ext/installfiles/windows/chocolatey/zerotier-one/tools/VERIFICATION.txt new file mode 100644 index 000000000..0a5bc7604 --- /dev/null +++ b/ext/installfiles/windows/chocolatey/zerotier-one/tools/VERIFICATION.txt @@ -0,0 +1,5 @@ +VERIFICATION +Verification is intended to assist the Chocolatey moderators and community +in verifying that this package's contents are trustworthy. + +Our MSI installer should be signed by ZeroTier, Inc. using a certificate from DigiCert. diff --git a/ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyinstall.ps1 b/ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyinstall.ps1 new file mode 100644 index 000000000..b29fd99da --- /dev/null +++ b/ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyinstall.ps1 @@ -0,0 +1,8 @@ +$packageName = 'zerotier-one' +$installerType = 'msi' +$url = 'https://download.zerotier.com/RELEASES/1.1.12/dist/ZeroTier%20One.msi' +$url64 = 'https://download.zerotier.com/RELEASES/1.1.12/dist/ZeroTier%20One.msi' +$silentArgs = '/quiet' +$validExitCodes = @(0,3010) + +Install-ChocolateyPackage $packageName $installerType $silentArgs $url $url64 -validExitCodes $validExitCodes diff --git a/ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyuninstall.ps1 b/ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyuninstall.ps1 new file mode 100644 index 000000000..81f7a5ac9 --- /dev/null +++ b/ext/installfiles/windows/chocolatey/zerotier-one/tools/chocolateyuninstall.ps1 @@ -0,0 +1,30 @@ +$ErrorActionPreference = 'Stop'; + +$packageName = 'zerotier-one' +$softwareName = 'ZeroTier One*' +$installerType = 'MSI' + +$silentArgs = '/qn /norestart' +$validExitCodes = @(0, 3010, 1605, 1614, 1641) +$uninstalled = $false + +[array]$key = Get-UninstallRegistryKey -SoftwareName $softwareName + +if ($key.Count -eq 1) { + $key | % { + $silentArgs = "$($_.PSChildName) $silentArgs" + $file = '' + Uninstall-ChocolateyPackage -PackageName $packageName ` + -FileType $installerType ` + -SilentArgs "$silentArgs" ` + -ValidExitCodes $validExitCodes ` + -File "$file" + } +} elseif ($key.Count -eq 0) { + Write-Warning "$packageName has already been uninstalled by other means." +} elseif ($key.Count -gt 1) { + Write-Warning "$key.Count matches found!" + Write-Warning "To prevent accidental data loss, no programs will be uninstalled." + Write-Warning "Please alert package maintainer the following keys were matched:" + $key | % {Write-Warning "- $_.DisplayName"} +} diff --git a/ext/installfiles/windows/chocolatey/zerotier-one/zerotier-one.nuspec b/ext/installfiles/windows/chocolatey/zerotier-one/zerotier-one.nuspec new file mode 100644 index 000000000..473007c86 --- /dev/null +++ b/ext/installfiles/windows/chocolatey/zerotier-one/zerotier-one.nuspec @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + zerotier-one + + + + 1.1.12 + + + + + + + + zerotier-one (Install) + ZeroTier, Inc. + + https://www.zerotier.com/ + + + + + + + + + zerotier-one admin + ZeroTier One Virtual Network Endpoint for Windows + ZeroTier is a smart switch for Earth with VLAN capability. See https://www.zerotier.com/ for more information. + + + + + + + + + + + + + + + + +