-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-testcenter.ps1
60 lines (50 loc) · 1.96 KB
/
install-testcenter.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
param (
[string]$Dir = 'c:\users\administrator\downloads',
[int]$ExtraDownloads = 0
)
function Invoke-Download {
Param (
[string]$Url,
[string]$FilePath
)
Write-Output "Downloading $FilePath"
Invoke-WebRequest -Uri $Url -OutFile $FilePath
}
function Invoke-Installer {
Param (
[string]$FilePath,
[string]$ArgumentList
)
Write-Output "Installing $FilePath"
Start-Process -Wait -PassThru -FilePath $FilePath -ArgumentList $ArgumentList
}
$ProgressPreference = 'SilentlyContinue'
if ( Test-Path "$Dir/Spirent TestCenter Application.exe")
{
$stc_installer = "Spirent TestCenter Application.exe"
$vcredists = "vcredist_x86_2008.exe", "vcredist_x86_2010.exe", `
"vcredist_x86_2013.exe", "vcredist_x86_2017.exe"
}
else
{
$stc_installer = "Spirent TestCenter Application x64.exe"
$vcredists = "vcredist_x64_2008.exe", "vcredist_x64_2010.exe", `
"vcredist_x64_2013.exe", "vcredist_x64_2017.exe"
}
# Install Spirent TestCenter dependencies prior to SpirentTestCenter for a silent install
$stc_files_url = "http://stc-image-files.s3-website-us-east-1.amazonaws.com/win-install"
Invoke-Download -FilePath "$Dir/chrome_installer.exe" -Url "http://dl.google.com/chrome/install/375.126/chrome_installer.exe"
Invoke-Installer -FilePath "$Dir/chrome_installer.exe" -ArgumentList "/silent /install"
foreach ( $vcredist in $vcredists)
{
Invoke-Download -FilePath "$Dir/$vcredist" -Url "$stc_files_url/$vcredist"
Invoke-Installer -FilePath "$Dir/$vcredist" -ArgumentList "/q"
}
# Install TestCenter
Invoke-Installer -FilePath "$Dir/$stc_installer" -ArgumentList "/silent /pgpassword:postgres"
# Install extra downloads
if ( $ExtraDownloads )
{
Invoke-Download -FilePath "$Dir/Wireshark.exe" -Url "https://2.na.dl.wireshark.org/win64/all-versions/Wireshark-win64-3.4.2.exe"
Invoke-Installer -FilePath "$Dir/Wireshark.exe" -ArgumentList "/S"
}