Browse Source

switch yggdrasil package to new installer (dev)

Signed-off-by: R4SAS <r4sas@i2pmail.org>
master
R4SAS 5 years ago
parent
commit
7cce575241
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. BIN
      yggdrasil/logo/yggdrasil-512.png
  2. 119
      yggdrasil/logo/yggdrasil.svg
  3. 71
      yggdrasil/tools/chocolateyinstall.ps1
  4. 43
      yggdrasil/tools/chocolateyuninstall.ps1
  5. 10
      yggdrasil/tools/service-start.bat
  6. 1
      yggdrasil/tools/service-stop.bat

BIN
yggdrasil/logo/yggdrasil-512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

119
yggdrasil/logo/yggdrasil.svg

@ -0,0 +1,119 @@ @@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="ygg.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
version="1.1"
id="svg4240"
viewBox="0 0 480 479.99998"
height="512"
width="512"
inkscape:export-filename="C:\devel\project\yggdrasil\ygg-512.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs4242">
<linearGradient
inkscape:collect="always"
id="linearGradient2394">
<stop
style="stop-color:#00b08d;stop-opacity:1"
offset="0"
id="stop2390" />
<stop
style="stop-color:#9cffd0;stop-opacity:1"
offset="1"
id="stop2392" />
</linearGradient>
<linearGradient
id="linearGradient890"
osb:paint="solid">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop888" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2394"
id="linearGradient2396"
x1="209.0625"
y1="636.5625"
x2="328.125"
y2="-54.375"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
fit-margin-bottom="0"
fit-margin-right="0"
fit-margin-left="0"
fit-margin-top="0"
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:window-height="1027"
inkscape:window-width="1920"
showgrid="false"
inkscape:current-layer="layer4"
inkscape:document-units="px"
inkscape:cy="215.40493"
inkscape:cx="127.54087"
inkscape:zoom="1"
inkscape:pageshadow="2"
inkscape:pageopacity="1"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:pagecheckerboard="true"
inkscape:showpageshadow="false"
units="px" />
<metadata
id="metadata4245">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Background">
<rect
style="opacity:1;fill-opacity:1;stroke-width:14.06249971;stroke:none;stroke-opacity:1;fill:url(#linearGradient2396);fill-rule:nonzero;stroke-miterlimit:4;stroke-dasharray:none"
id="rect858"
width="480"
height="480"
x="0"
y="-3.4333966e-006" />
</g>
<g
inkscape:label="Logo"
inkscape:groupmode="layer"
id="layer1"
transform="translate(383.92494,-2.0934461)">
<path
style="fill:#ffffff;fill-opacity:1;stroke-width:1.31718552"
d="m -316.54372,478.5395 c 1.21316,-4.9645 15.63671,-40.16088 28.33041,-69.13201 12.99199,-29.65184 12.74674,-28.48782 9.12735,-43.32513 -4.51791,-18.52061 -4.24349,-48.6732 0.58863,-64.68225 17.4451,-57.79632 62.7423,-96.96723 161.10122,-139.31287 32.0406,-13.79416 49.628621,-22.63987 62.974225,-31.67221 C -30.895873,114.49252 -6.4233937,86.86328 1.4011734,67.39117 3.0514106,63.284437 4.9061512,59.961561 5.5228048,60.007042 7.4460804,60.148863 6.4935839,118.36057 4.2361774,138.63934 -9.7470219,264.25331 -52.346001,345.95569 -122.48492,381.6831 c -40.47861,20.61904 -104.28894,28.25834 -134.01201,16.04381 -4.20289,-1.72715 -8.6265,-3.14028 -9.83032,-3.14028 -4.52629,0 -20.75651,43.33442 -25.41537,67.85879 -1.4463,7.61336 -3.63855,18.05581 -3.96338,19.64802 -7.24537,-0.0557 -0.46591,-0.0156 -10.77493,-0.0156 h -10.92743 z"
id="path4918"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ssssssscssssscscs"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

71
yggdrasil/tools/chocolateyinstall.ps1

@ -2,76 +2,51 @@ @@ -2,76 +2,51 @@
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$appDir = "$([Environment]::GetFolderPath('ProgramFiles'))\Yggdrasil"
$confDir = "$([Environment]::GetFolderPath('CommonApplicationData'))\Yggdrasil"
$startMenuDir = "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\Yggdrasil"
$url = 'https://2203-115685026-gh.circle-artifacts.com/0/yggdrasil-0.3.11-windows-i386.exe'
$url64 = 'https://2203-115685026-gh.circle-artifacts.com/0/yggdrasil-0.3.11-windows-amd64.exe'
$ctlUrl = 'https://2203-115685026-gh.circle-artifacts.com/0/yggdrasil-0.3.11-yggdrasilctl-windows-i386.exe'
$ctlUrl64 = 'https://2203-115685026-gh.circle-artifacts.com/0/yggdrasil-0.3.11-yggdrasilctl-windows-amd64.exe'
$url = 'https://ci.appveyor.com/api/buildjobs/bmhigwngjgybqh50/artifacts/yggdrasil-develop-0.3.12-0060-x86.msi'
$url64 = 'https://ci.appveyor.com/api/buildjobs/bmhigwngjgybqh50/artifacts/yggdrasil-develop-0.3.12-0060-x64.msi'
$checksum = '7c7faeac9bb60efe4ce996ceade9c94fda3a5e1dcd37fa8836794420e43b8e62'
$checksum64 = 'bfd5dccc5faa4789616014c29f1add3eaa9a5a112eef6543f0dae9dae9a8c2a2'
$packageArgs = @{
packageName = 'yggdrasil'
packageName = $env:ChocolateyPackageName
fileType = 'msi'
url = $url
url64bit = $url64
fileFullPath = "$appDir\yggdrasil.exe"
checksum = '496239325ED34ADAEDE10A71D678BE6B4FA13273BAEE6A924D20EE5EC58B8C28'
checksum = $checksum
checksumType = 'sha256'
checksum64 = 'BC89CDBA3E5FF4D455805990BEEC3C0D29A88751B1F1E01687A10F71F320E522'
checksum64 = $checksum64
checksumType64 = 'sha256'
}
$ctlPackageArgs = @{
packageName = 'yggdrasilctl'
url = $ctlurl
url64bit = $ctlurl64
fileFullPath = "$appDir\yggdrasilctl.exe"
checksum = 'F21B510D95ED7463BAF493F3530A3C7B5A1B72DB0110A160433A8ECB4C7584B3'
checksumType = 'sha256'
checksum64 = 'FCD3859F8C8546D1A46EBB6EB1227173C1A4D3AB168A3821BEA6E91356A662B3'
checksumType64 = 'sha256'
softwareName = 'Yggdrasil Network*'
silentArgs = '/quiet'
validExitCodes = @(0)
}
# Installing executables
if (-not (Test-Path -Path $appDir)) {
New-Item -Path $appDir -ItemType Directory
# Backup old configuration
if (Test-Path "$confDir\yggdrasil.conf" -PathType Leaf) {
$date = Get-Date -format "yyyyMMdd"
Write-Host "Backing up configuration file to yggdrasil.conf.$date"
Copy-Item $confDir\yggdrasil.conf -Destination $confDir\yggdrasil.conf.$date
}
Get-ChocolateyWebFile @packageArgs
Get-ChocolateyWebFile @ctlPackageArgs
Install-ChocolateyPackage @packageArgs
Install-BinFile "yggdrasil" "$appDir\yggdrasil.exe"
Install-BinFile "yggdrasilctl" "$appDir\yggdrasilctl.exe"
# Generating new configuration, or updating existent
if (Test-Path "$appDir\yggdrasil.conf" -PathType Leaf) {
$date = Get-Date -format "yyyyMMdd"
Write-Host "Backing up configuration file to yggdrasil.conf.$date"
Copy-Item $appDir\yggdrasil.conf -Destination $appDir\yggdrasil.conf.$date
Write-Host "Normalizing and updating yggdrasil.conf"
$args = @(
"-useconffile","$appDir\yggdrasil.conf.$date",
"-normaliseconf"
)
& "$appDir\yggdrasil.exe" $args > "$appDir\yggdrasil.conf"
} else {
Write-Host "Generating initial configuration file yggdrasil.conf"
Write-Host "Please familiarise yourself with this file before starting Yggdrasil"
$args = @(
"-genconf"
)
& "$appDir\yggdrasil.exe" $args > "$appDir\yggdrasil.conf"
}
# Creating shortcuts in Start Menu
if (-not (Test-Path -Path $startMenuDir)) {
New-Item -Path $startMenuDir -ItemType Directory
}
Install-ChocolateyShortcut -shortcutFilePath "$startMenuDir\Install service.lnk" `
-targetPath "$toolsDir\service-install.bat" -workDirectory "$appDir" -description "Install yggdrasil service" -RunAsAdmin
Install-ChocolateyShortcut -shortcutFilePath "$startMenuDir\Start service.lnk" `
-targetPath "$toolsDir\service-start.bat" -workDirectory "$appDir" -description "Start yggdrasil service" -RunAsAdmin
Install-ChocolateyShortcut -shortcutFilePath "$startMenuDir\Restart service.lnk" `
-targetPath "$toolsDir\service-restart.bat" -workDirectory "$appDir" -description "Restart yggdrasil service" -RunAsAdmin
Install-ChocolateyShortcut -shortcutFilePath "$startMenuDir\Uninstall service.lnk" `
-targetPath "$toolsDir\service-uninstall.bat" -workDirectory "$appDir" -description "Uninstall yggdrasil service" -RunAsAdmin
Install-ChocolateyShortcut -shortcutFilePath "$startMenuDir\Stop service.lnk" `
-targetPath "$toolsDir\service-stop.bat" -workDirectory "$appDir" -description "Stop yggdrasil service" -RunAsAdmin

43
yggdrasil/tools/chocolateyuninstall.ps1

@ -1,23 +1,42 @@ @@ -1,23 +1,42 @@
$ErrorActionPreference = 'Stop'; # stop on all errors
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$appDir = "$([Environment]::GetFolderPath('ProgramFiles'))\Yggdrasil"
$confDir = "$([Environment]::GetFolderPath('CommonApplicationData'))\Yggdrasil"
$startMenuDir = "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\Yggdrasil"
$softwareName = 'Yggdrasil Network*'
# Remove package, it don't touch configs
Write-Host "We removing package, but doesn't touch your configs. You can still find them in '$confDir' directory"
[array]$key = Get-UninstallRegistryKey -SoftwareName $softwareName
if ($key.Count -eq 1) {
$file = "$($key.UninstallString)"
$silentArgs = "$($key.PSChildName) /quiet"
$file = ''
$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'msi'
silentArgs = $silentArgs
validExitCodes = @(0)
file = $file
}
Uninstall-ChocolateyPackage @packageArgs
} 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 the package maintainer that the following keys were matched:"
$key | ForEach-Object { Write-Warning "- $($_.DisplayName)" }
}
# Remove shims
Uninstall-BinFile "yggdrasil"
Uninstall-BinFile "yggdrasilctl"
# Remove shortcuts from Start Menu
Remove-Item $startMenuDir -Recurse
# Stop and remove service if it was installed
if (Get-WmiObject -Class Win32_Service -Filter "Name='Yggdrasil'") {
& sc stop "Yggdrasil"
& sc delete "Yggdrasil"
}
# Remove binaries, but don't touch configs
Write-Host "We removing binaries, but doesn't touch your configs. You can still find them in '$appDir' directory"
Remove-Item "$appDir\yggdrasil.exe"
Remove-Item "$appDir\yggdrasilctl.exe"

10
yggdrasil/tools/service-install.bat → yggdrasil/tools/service-start.bat

@ -18,17 +18,7 @@ echo. @@ -18,17 +18,7 @@ echo.
goto :end
:admin
pushd "%ProgramFiles%\Yggdrasil"
sc stop "Yggdrasil" >NUL 2>&1
sc delete "Yggdrasil" >NUL 2>&1
REM add delay before re-creation
timeout 1 /nobreak >NUL
sc create "Yggdrasil" binPath= "\"%CD%\yggdrasil.exe\" -useconffile \"%CD%\yggdrasil.conf\"" start= "auto"
sc description "Yggdrasil" "An experiment in scalable routing as an encrypted IPv6 overlay network"
sc start "Yggdrasil"
popd
:end
set /p =Press [Enter] to exit . . .

1
yggdrasil/tools/service-uninstall.bat → yggdrasil/tools/service-stop.bat

@ -19,7 +19,6 @@ goto :end @@ -19,7 +19,6 @@ goto :end
:admin
sc stop "Yggdrasil"
sc delete "Yggdrasil"
:end
set /p =Press [Enter] to exit . . .
Loading…
Cancel
Save