Skip to content

Commit

Permalink
Version 2.0.4.0621
Browse files Browse the repository at this point in the history
First Version
  • Loading branch information
sbaerlocher authored Jul 23, 2019
2 parents 9fb16a5 + 282e311 commit bbfeddc
Show file tree
Hide file tree
Showing 12 changed files with 273 additions and 0 deletions.
Empty file added .appveyor.yml
Empty file.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Created by https://www.gitignore.io/api/powershell,visualstudiocode,chocolatey

### PowerShell ###
# Exclude packaged modules
*.zip

# Exclude .NET assemblies from source
*.dll

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### Chocolatey ###
# Exclude packaged modules
*.nupkg

# End of https://www.gitignore.io/api/powershell,visualstudiocode,chocolatey
Empty file added .gitlab-ci.yml
Empty file.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).

## 2.0.4.0621

### Added

- Initial release
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2019 ITIGO AG

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ installation with parameters.
choco install synology-activebackup-for-business-agent --params="'/RemoveDesktopIcons /CleanStartmenu'"
```

## Disclaimer

These Chocolatey Packages only contain installation routines. The software itself is downloaded from the official sources of the software developer. ITIGO AG has no affilation with the software developer.

## Author

- [Simon Bärlocher](https://sbaerlocher.ch)
Expand Down
Binary file added icon/synology-activebackup-for-business-agent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions synology-activebackup-for-business-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Chocolatey Package: Synology ActiveBackup for Business Agent

## Description

Active Backup for Business is the all-in-one backup solution, designed for streamlining and enhancing data protection in businesses' diverse IT environments. Before protecting and backing up data stored on personal computers as well as physical Windows Servers, this Active Backup Agent is required to be installed on the target device to carry out the designed backup tasks and store the backed up data. As the management is centralized on the server end, most of the actions require either DSM or device's administrative privilege.

## Package Parameters

- `/RemoveDesktopIcons` Removes the desktop icon from Synology ActiveBackup for Business Agent.
- `/CleanStartmenu` Removes frequently used Synology ActiveBackup for Business Agent shortcuts from the Startmenu.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>

<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>synology-activebackup-for-business-agent</id>
<title>Synology ActiveBackup for Business Agent</title>
<version>2.0.4.0621</version>
<authors>Synology Inc.</authors>
<owners>ITIGO AG</owners>
<packageSourceUrl>https://github.com/itigoag/chocolatey.synology-activebackup-for-business-agent</packageSourceUrl>
<projectUrl>https://www.synology.com/de-de/releaseNote/ActiveBackupBusinessAgent</projectUrl>
<iconUrl>https://rawgit.com/itigoag/chocolatey.synology-activebackup-for-business-agent/master/icon/synology-activebackup-for-business-agent.png</iconUrl>
<tags>Synology ActiveBackup for Business Agent</tags>
<copyright>Synology Inc.</copyright>
<licenseUrl>https://www.synology.com/de-de/releaseNote/ActiveBackupBusinessAgent</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>ActiveBackup for Business Agent</summary>
<description><![CDATA[
Active Backup for Business is the all-in-one backup solution, designed for streamlining and enhancing data protection in businesses' diverse IT environments. Before protecting and backing up data stored on personal computers as well as physical Windows Servers, this Active Backup Agent is required to be installed on the target device to carry out the designed backup tasks and store the backed up data. As the management is centralized on the server end, most of the actions require either DSM or device's administrative privilege.
## Package Parameters
- `/RemoveDesktopIcons` Removes the desktop icon from Synology ActiveBackup for Business Agent.
- `/CleanStartmenu` Removes frequently used Synology ActiveBackup for Business Agent shortcuts from the Startmenu.
]]></description>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$ErrorActionPreference = 'Stop';
$PackageParameters = Get-PackageParameters

$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)"

Import-Module -Name "$($toolsDir)\helpers.ps1"

$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'msi'
url = 'https://global.download.synology.com/download/Tools/ActiveBackupBusinessAgent/2.0.4-0621/Windows/i686/Synology%20Active%20Backup%20for%20Business%20Agent-2.0.4-0621-x86.msi'
url64 = 'https://global.download.synology.com/download/Tools/ActiveBackupBusinessAgent/2.0.4-0621/Windows/x86_64/Synology%20Active%20Backup%20for%20Business%20Agent-2.0.4-0621-x64.msi'
checksum = 'EE9E5E16C3ECF2282FBA387374F1D6FE56989BF0E3358ED78A8B142E4E18543E'
checksumType = 'SHA256'
checksum64 = 'DCA40C40A815C11B311F61D413E1CED175121B080882BC23993A22D6923142A7'
checksumType64 = 'SHA256'
silentArgs = '/qn'
ValidExitCodes = @(0, 1000, 1101)
}

Install-ChocolateyPackage @packageArgs

if ($PackageParameters.RemoveDesktopIcons) {
Remove-DesktopIcons -Name "Synology Active Backup for Business Agent" -Desktop "Public"
}

if ($PackageParameters.CleanStartmenu) {
Remove-FileItem `
-Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Synology\Synology Active Backup for Business Agent.lnk"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$ErrorActionPreference = 'Stop';

$packageArgs = @{
packageName = $env:ChocolateyPackageName
softwareName = ''
fileType = ''
silentArgs = ''
validExitCodes = @(0, 3010, 1605, 1614, 1641)
}

if ($key.Count -eq 1) {
$key | ForEach-Object {
$packageArgs['file'] = "$($_.UninstallString)"
if ($packageArgs['fileType'] -eq 'MSI') {
$packageArgs['silentArgs'] = "$($_.PSChildName) $($packageArgs['silentArgs'])"
$packageArgs['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 package maintainer the following keys were matched:"
$key | ForEach-Object {Write-Warning "- $($_.DisplayName)"}
}

# Custome Settings from Package
## Remove files and folders
if (Get-Item -Path "<Path>" -ErrorAction SilentlyContinue) {
Remove-Item `
-Path "<Path>" `
-Recurse
Write-Output `
-InputObject "Remove Shortcut <Path>"
}
112 changes: 112 additions & 0 deletions synology-activebackup-for-business-agent/tools/helpers.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
function Test-RegistryValue {

param (
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Path,
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Value
)

try {
Get-ItemProperty -Path $Path | Select-Object -ExpandProperty $Value -ErrorAction Stop | Out-Null
return $true
}
catch {
return $false
}

}

function Remove-FileItem {

param (
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Path
)

try {
Remove-Item `
-Path $Path `
-Recurse
Write-Output `
-InputObject "Remove $($Path)"

}
catch {
Write-Output `
-InputObject "Failed remove $($Path)"
}

}

function Update-RegistryValue {

param (
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Path,
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Name,
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Value,
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Type,
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Message
)

try {
Set-ItemProperty `
-Path $Path `
-Name $Name `
-Value $Value
Write-Output `
-InputObject $Message


}
catch {
New-ItemProperty `
-Path $Path `
-Name $Name`
-PropertyType $Type `
-Value $Value
Write-Output `
-InputObject $Message
}

}

function Set-CleanInstall {

try {
Get-ChildItem "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)\.." -recurse -Exclude '*.ps1', '*pm1' |
Where-Object {$_.Length -gt 1gb} |
Remove-Item
return $true
}
catch {
return $false
}

}

function Remove-DesktopIcons {

param (
[parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Name,
[parameter(Mandatory = $false)]$Desktop
)
if (!$Desktop) {
$Desktop = 'All'
}
if ($Desktop -eq 'All') {
foreach ($User in Get-ChildItem -Path "C:\Users") {
Remove-FileItem -Path "C:\users\$($User)\desktop\$($Name).lnk"
}
Remove-FileItem -Path "C:\Users\default\desktop\$($Name).lnk"
Remove-FileItem -Path "C:\Users\Public\Desktop\$($Name).lnk"
}
elseif ($Desktop -eq 'Public') {

Remove-FileItem -Path "C:\Users\Public\Desktop\$($Name).lnk"

}
elseif ($Desktop -eq 'Default') {

Remove-FileItem -Path "C:\Users\Default\desktop\$($Name).lnk"

}

}

0 comments on commit bbfeddc

Please sign in to comment.