-
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 = '158.3.4496'
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%20158.3.4496%20Offline%20Installer.x86.exe'
checksum = 'e2b37ade6015a9698c50ea39d55c8e8201cb10af069658ad7cb5f0beed935fd0'
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."
}