-
Notifications
You must be signed in to change notification settings - Fork 374
/
chocolateyinstall.ps1
32 lines (26 loc) · 1003 Bytes
/
chocolateyinstall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$ErrorActionPreference = 'Stop'
if (!$PSScriptRoot) {
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
. "$PSScriptRoot\helper.ps1"
$version = '157.4.4808'
if (!(IsVersionAlreadyInstalled $version)) {
$stop_dropbox = if (Get-Process -Name Dropbox -ErrorAction SilentlyContinue) { $false } else { $true }
$packageArgs = @{
packageName = $env:ChocolateyPackageName
softwareName = "Dropbox"
url = 'https://edge.dropboxstatic.com/dbx-releng/client/Dropbox%20157.4.4808%20Offline%20Installer.x86.exe'
checksum = '3c5f34ab81ef7c57ea73f9289ab678a06c3a262818d748f7f29333db2cda81c6'
fileType = 'exe'
checksumType = 'sha256'
silentArgs = '/s'
validExitCodes = @(0, 1641, 3010)
}
Install-ChocolateyPackage @packageArgs
if ($stop_dropbox -and (Get-Process -Name Dropbox -ErrorAction SilentlyContinue)) {
Stop-Process -processname Dropbox
}
}
else {
Write-Host "Dropbox $version is already installed."
}