-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.ps1
288 lines (247 loc) · 8.77 KB
/
setup.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
function _cmd($command) {
$result = cmd.exe /c "$command 2>&1" #stderr hack
return $result
}
function Install-NeededFor {
param([string] $packageName = '', [bool] $defaultAnswer = $true)
if ($packageName -eq '') {return $false}
$yes = '6'
$no = '7'
$msgBoxTimout='-1'
$defaultAnswerDisplay = 'Yes'
$buttonType = 0x4;
if (!$defaultAnswer) {$defaultAnswerDisplay = 'No'; $buttonType= 0x104;}
$answer = $msgBoxTimeout
try {
$timeout = 10
$question = "Do you need to install $($packageName)? Defaults to `'$defaultAnswerDisplay`' after $timeout seconds"
$msgBox = New-Object -ComObject WScript.Shell
$answer = $msgBox.Popup($question, $timeout, "Install $packageName", $buttonType)
}
catch {
}
if ($answer -eq $yes -or ($answer -eq $msgBoxTimeout -and $defaultAnswer -eq $true)) {
write-host "Installing $packageName"
return $true
}
write-host "Not installing $packageName"
return $false
}
function is64Bit
{
if ([System.IntPtr]::Size -eq 8)
{
return $true
}
else
{
return $false
}
}
$install_location = "\\uat-nas02.durrants.uat\software$\Build\Core"
$progFiles86 = $env:ProgramFiles
if (is64Bit)
{
$progFiles86 = ${env:ProgramFiles(x86)}
"This machine is 64bit"
}
else {
"This machine is 32bit"
}
"Using $progFiles86 for program files"
$installVim = Install-NeededFor 'vim'
$installhg = Install-NeededFor 'mecurial'
$installdropbox = Install-NeededFor 'dropbox'
$installskydrive = Install-NeededFor 'skydrive'
$installemacs = Install-NeededFor 'emacs'
$installintellij = Install-NeededFor 'InteliJ'
$installiis = Install-NeededFor 'IIS' $false
$currentPath = Split-Path -parent $MyInvocation.MyCommand.Definition
$packagePath = Join-Path $currentPath VS_Extensions\davearkell.vsextensions
& setuptnsNames\setuptnsNames.ps1
# install ruby.devkit, and ruby if they are missing
if ($installVim) {
cinstm KickAssVim
}
if ($installhg) {
cinstm Posh-GIT-HG
}
else {
cinstm Poshgit
}
$gitBinDir = Join-Path $progFiles86 "git\bin"
if(-not ($env:PATH.Split(';') -contains $gitBinDir)) {
Write-Host "Adding $($gitBinDir) to your working path"
[System.Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$gitBinDir", "Machine")
}
if ($installdropbox) {
cinstm dropbox
}
if ($installskydrive) {
cinstm SkyDrive
}
if ($installemacs) {
cinstm Emacs
}
if ($installintellij) {
$intellijPath = Join-Path $currentPath IntelliJIDEA.11.1.2
cinst IntelliJIDEA -source $intellijPath
}
[System.Diagnostics.Process]::Start("c:\chocolatey\bin\cinst", "GnuWin")
if (Test-Path $install_location)
{
if (-Not (Test-Path(Join-Path $progFiles86 "Microsoft SDKs\Silverlight\v4.0\Toolkit\Apr10\")))
{
"Installing Silverlight 4"
_cmd "$install_location\Silverlight4_Tools.exe /q:a /c:""setup.exe /q /norestart"" /norestart"
_cmd "C:\windows\system32\msiexec.exe /qb /i ""$install_location\silverlight_4_Toolkit_April_2010.msi"""
}
if (-Not (Test-Path(Join-Path $progFiles86 "Microsoft SDKs\Expression\Blend\Silverlight")))
{
"Installing BlendSLSDK"
_cmd "C:\Windows\System32\msiexec.exe /qb /i ""$install_location\BlendSLSDK_en.msi"""
}
if (-Not (Test-Path(Join-Path $progFiles86 "Microsoft SDKs\Expression\Blend\.NETFramework\v4.0")))
{
"Installing BlendWPFSDK"
_cmd "C:\Windows\System32\msiexec.exe /qb /i ""$install_location\BlendWPFSDK_en.msi"""
}
if (-Not (Test-Path(Join-Path $progFiles86 "Telerik\RadControls for WPF Q2 2010 SP2")))
{
"Installing Telerik Controls"
_cmd "C:\Windows\System32\msiexec.exe /qb /i ""$install_location\RadControls_for_WPF40_2010_2_0924_DEV.msi"""
}
if (-Not (Test-Path(Join-Path $progFiles86 "Keyoti Inc\RapidSpell WPF")))
{
"Installing Keyoti RapidSpell"
_cmd "C:\Windows\System32\msiexec.exe /qb /i ""$install_location\RapidSpellWPF-2.0.0-UD-Setup.msi"""
}
if (-Not (Test-Path(Join-Path $progFiles86 "Actipro Software\WPFStudio\v11.1.0540")))
{
"Installing Actipro"
_cmd "C:\Windows\System32\msiexec.exe /qb /i ""$install_location\ActiProSyntaxEditor\Setup.msi"""
}
if (-Not (Test-Path "C:\Program Files\SVNCommandLine\bin\svn.exe"))
{
"Installing SVNCommand Line"
Copy-Item $install_location\SVNCommandLine "C:\Program Files\" -recurse
}
$msbuildPath = Join-Path $progFiles86 "MSBuild"
Copy-Item $install_location\VDProjSettingsModifier.exe $msbuildPath
Copy-Item $install_location\MsiProductCodeExtractor.exe $msbuildPath
if (-Not (Test-Path(Join-Path $progFiles86 "Microsoft Silverlight\4.0.51204.0")))
{
"Installing Silverlight Developer"
_cmd "$install_location\Silverlight_Developer.exe /q"
}
if (-Not (Test-Path(Join-Path $progFiles86 "MSBuild\Microsoft\VisualStudio\TextTemplating\v10.0")))
{
"Installing Visual Studio 2010 SDK and Visual Studio 2010 Modelling & Visualisation SDK for T4 build time transformation support"
Copy-Item $install_location\VisualStudio2010SDK $env:Temp -recurse
Copy-Item $install_location\VisualStudio2010ModellingAndVisualisationSDK $env:Temp -recurse
_cmd "C:\windows\system32\msiexec.exe /qb /i ""$env:Temp\VisualStudio2010SDK\vssdk.msi"""
_cmd "C:\windows\system32\msiexec.exe /qb /i ""$env:Temp\VisualStudio2010ModellingAndVisualisationSDK\vs_vmsdk.msi"""
Remove-Item $env:Temp\VisualStudio2010SDK -recurse
Remove-Item $env:Temp\VisualStudio2010ModellingAndVisualisationSDK -recurse
}
if (-Not (Test-Path(Join-Path $progFiles86 "Java\jdk1.6.0_24")))
{
"Installing Java JDK"
_cmd "$install_location\jdk-6u24-windows-i586.exe /s /v""/qn REBOOT=Suppress"""
}
if (-Not (Test-Path "C:\Program Files\JavaBuildTools\apache-ant-1.8.2\INSTALL"))
{
"Installing Java Build tools"
Copy-Item $install_location\JavaBuildTools "C:\Program Files\" -recurse
}
if (-Not (Test-Path(Join-Path $progFiles86 "Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025")))
{
"Installing Ajax Web Extensions"
_cmd "C:\windows\system32\msiexec.exe /qb /i ""$install_location\AJAX Web Extentions.msi"""
}
}
else
{
"Not installing old batch file stuff, as I can't access the shared drive"
}
if (-Not (Test-Path(Join-Path $progFiles86 "Terminals")))
{
"Installing Terminals"
_cmd "C:\Windows\System32\msiexec.exe /qb /i ""SetupTerminals_v2.0.msi"""
Copy-Item Terminals.config $progFiles86\Terminals
Copy-Item Credentials.xml $progFiles86\Terminals
}
cinstm ruby.devkit
#perform ruby updates and get gems
_cmd "C:\ruby193\bin\gem update --system"
cgem rake
cgem bundler
cgem win32console
cgem colorize
cgem mustache
#restore the nuget packages
#$nugetConfigs = Get-ChildItem '.\' -Recurse | ?{$_.name -match "packages\.config"} | select
#foreach ($nugetConfig in $nugetConfigs) {
# Write-Host "restoring packages from $($nugetConfig.FullName)"
# nuget install $($nugetConfig.FullName) /OutputDirectory packages
#}
#rake
cinstm virtualbox
cinstm Firefox
cinstm GoogleChrome.Dev
cinstm python
#cinstm easy.install # issue here
#cinstm pip # issue here
cinstm vlc
cinstm sysinternals
cinstm gitextensions
cinstm kdiff3
cinstm tortoisesvn
cinstm svn
cinstm notepadplusplus
cinstm 7zip
cinstm 7zip.commandline
cinstm fiddler
cinstm putty
cinstm windirstat
cinstm curl
cinstm skype
cinstm wget
cinstm FoxitReader
cinst SourceCodePro
cinst ConEmu -Version 12.4.17.1
$conemuProgFiles = $progFiles86.Replace("\", "\\")
Get-Content conEmu.reg | Foreach-Object{$_ -replace "PROGFILES", "$conemuProgFiles"} | Set-Content 'conEmu2.reg'
reg Import conEmu2.reg
"c:\program files\conemu.exe /UpdateJumpList"
Remove-Item conEmu2.reg
cinstm linqpad4
cinstm ilmerge
cinstm dotPeek
cinstm kaxaml
cinstm msbuild.communitytasks
#cinstm Silverlight
#cinstm Silverlight5SDK
cinstm specflow
cinst SQLExpressManagementStudio -source webpi
Write-Host "Finished checking for/installing Visual Studio Items."
cinst davearkell.vsextensions -source $packagePath -force
if ($installiis) {
cinst ASPNET -source webpi
cinst ASPNET_REGIIS -source webpi
cinst DefaultDocument -source webpi
cinst DynamicContentCompression -source webpi
cinst HTTPRedirection -source webpi
cinst IIS7_ExtensionLessURLs -source webpi
cinst IISExpress -source webpi
cinst IISExpress_7_5 -source webpi
cinst IISManagementConsole -source webpi
cinst ISAPIExtensions -source webpi
cinst ISAPIFilters -source webpi
cinst NETExtensibility -source webpi
cinst RequestFiltering -source webpi
cinst StaticContent -source webpi
cinst StaticContentCompression -source webpi
cinst UrlRewrite2 -source webpi
cinst WindowsAuthentication -source webpi
}