Reolink Client initial

This commit is contained in:
Peter V. Beck 2019-04-28 21:53:00 +02:00
parent 3201c513e9
commit 00edf6bcdb
3 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>reolink-client</id>
<version>7.2.2.31</version>
<title>Reolink Client</title>
<authors>Reolink Innovation Limited</authors>
<owners>foo.li systeme + software</owners>
<licenseUrl>https://reolink.com/terms-conditions/</licenseUrl>
<projectUrl>https://reolink.com/de/software-and-manual/</projectUrl>
<iconUrl>https://git.foo.li/peter/chocolatey/raw/branch/master/icons/reolink.jpg</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Get Your Home and Business within Your Sight.
Reolink App and Client help you to keep an eye on your home and business whenever and wherever you are.</description>
<summary>Reolink Client</summary>
<releaseNotes>https://github.com/aluxnimm/outlookcaldavsynchronizer/releases/tag/v3.6.1</releaseNotes>
<tags>videomonitoring monitoring video webcam admin</tags>
</metadata>
<files>
<file src="tools/*" target="Content/tools"/>
</files>
</package>

View File

@ -0,0 +1,39 @@
# Reolink Client
# 2011-2019 foo.li systeme + software
$release = '7.2.2.31'
$packageName = 'reolink-client'
$fileType = 'exe'
$silentArgs = '/SILENT'
$url = 'https://s3.amazonaws.com/reolink-storage/website/client/Reolink+Client+Windows+v' + $version + '+x32bit.zip'
$url64 = 'https://s3.amazonaws.com/reolink-storage/website/client/Reolink+Client+Windows+v' + $version + '+x64bit.zip'
$unpackDir = New-Item "${ENV:TEMP}\reolink" -ItemType Directory -Force
$unpackFile = "${ENV:TEMP}\reolink.zip"
$setup32 = 'Reolink Client Windows v' + $version + ' x32bit.exe'
$setup64 = 'Reolink Client Windows v' + $version + ' x64bit.exe'
$setupFile = Join-Path "$unpackDir" "$setup32"
$setupFile64 = Join-Path "$unpackDir" "$setup64"
$ErrorActionPreference = 'Continue'
#if ($env:PROCESSOR_ARCHITECURE -eq 'AMD64') {
$arch = (Get-WmiObject -Class Win32_ComputerSystem).SystemType -match '(x64)'
if ($arch = "True") {
$setup = $setupFile64
} else {
$setup = $setupFile
}
try {
Write-Host "Downloading Release" $release
Get-ChocolateyWebFile $packageName $unpackFile $url $url64
Get-ChocolateyUnzip $unpackFile $unpackDir
Install-ChocolateyInstallPackage $packageName $fileType $silentArgs $setup
#delete downloaded file
Remove-Item -Path $unpackDir -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path $unpackFile -Force -ErrorAction SilentlyContinue
} catch {
throw $_.Exception
Remove-Item -Path $unpackDir -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path $unpackFile -Force -ErrorAction SilentlyContinue
}

View File

@ -0,0 +1,34 @@
#uninstall Reolink Client
#2011-2019 foo.li systeme + software
$packageName = 'reolink-client'
$packageSearch = 'Reolink Client*'
$r = Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' ) `
-ErrorAction:SilentlyContinue `
| Where-Object { $_.DisplayName -like $packageSearch }
$r | ForEach-Object {
$exe = $_.UninstallString | Select-String -Pattern ".*exe`"?$"
$msi = $_.UninstallString | Select-String -Pattern "^MsiExec.*$"
if ($exe) {
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0)
Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$installerType" `
-SilentArgs "$($silentArgs)" `
-File "$($_.UninstallString)" `
-ValidExitCodes $validExitCodes
}
if ($msi) {
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0,3010)
Uninstall-ChocolateyPackage -PackageName "$packageName" `
-FileType "$installerType" `
-SilentArgs "$($_.PSChildName) $silentArgs" `
-ValidExitCodes $validExitCodes
}
}