-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tastreu
authored
Sep 26, 2018
1 parent
5a5b3fd
commit 5897f0d
Showing
1 changed file
with
50 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,57 @@ | ||
$toolsDir = $(Split-Path -Parent $MyInvocation.MyCommand.Definition) | ||
$packageName = 'VeeamAgentWindows' | ||
$packageVersion = '2.1.0.423' | ||
$installerDir = Join-Path $toolsDir 'installer' | ||
$downloadURL = "https://download5.veeam.com/$($packageName)_$packageVersion.zip" | ||
$installer = "$($packageName)_$packageVersion.exe" | ||
$ErrorActionPreference = 'Stop'; | ||
$PackageParameters = Get-PackageParameters | ||
|
||
$toolsDir = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" | ||
|
||
$url = 'https://download5.veeam.com/VeeamAgentWindows_2.2.0.589.zip' | ||
$checksumZip = 'e7df5e7dca4394e698c7e9c22f16a698ca6dac88ca2f58a60078977b88cce873c41484bc5eb061bcfa6a4ab6bf0b34b23bf914cfbd289588124d9df107b9b80d' | ||
$checksumTypeZip = 'SHA512' | ||
|
||
Import-Module -Name "$($toolsDir)\helpers.ps1" | ||
|
||
$zipArgs = @{ | ||
packageName = $packageName | ||
url = $downloadURL | ||
unzipLocation = $installerDir | ||
checksum = '603988d6d6983d7875a767ebc226200e' | ||
checksumType = 'md5' | ||
packageName = $env:ChocolateyPackageName | ||
url = $url | ||
unzipLocation = $ENV:TMP | ||
checksum = $checksumZip | ||
checksumType = $checksumTypeZip | ||
} | ||
|
||
Install-ChocolateyZipPackage @zipArgs | ||
|
||
$packageArgs = @{ | ||
packageName = $installer | ||
fileType = 'exe' | ||
file = "$installerDir\$installer" | ||
silentArgs = '/silent /accepteula' | ||
ValidExitCodes = @(0,1000,1101) | ||
packageName = $env:ChocolateyPackageName | ||
fileType = 'EXE' | ||
file = "$($ENV:TMP)\VeeamAgentWindows_$($packageVersion).exe" | ||
silentArgs = '/silent /accepteula' | ||
validExitCodes = @(0, 1000, 1101) | ||
} | ||
|
||
Install-ChocolateyInstallPackage @packageArgs | ||
Install-ChocolateyZipPackage @zipArgs | ||
|
||
Install-ChocolateyInstallPackage @packageArgs | ||
|
||
if ($PackageParameters.NoAutostartHard) { | ||
Update-RegistryValue ` | ||
-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" ` | ||
-Name "Veeam.EndPoint.Tray.exe" ` | ||
-Type Binary ` | ||
-Value ([byte[]](0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)) ` | ||
-Message "Disable Veeam Agent Autostart" | ||
} else { | ||
Update-RegistryValue ` | ||
-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" ` | ||
-Name "Veeam.EndPoint.Tray.exe" ` | ||
-Type Binary ` | ||
-Value ([byte[]](0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)) ` | ||
-Message "Default Veeam Agent Autostart" | ||
} | ||
|
||
if ($PackageParameters.CleanStartmenu) { | ||
Remove-FileItem ` | ||
-Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Veeam\" | ||
Install-ChocolateyShortcut ` | ||
-ShortcutFilePath "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Veeam Agent.lnk" ` | ||
-TargetPath "C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Tray.exe" | ||
Install-ChocolateyShortcut ` | ||
-ShortcutFilePath "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Veeam File Level Restore.lnk" ` | ||
-TargetPath "C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.FLR.exe" | ||
} |