forked from VsVim/VsVim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dogfood.ps1
44 lines (35 loc) · 1.28 KB
/
Dogfood.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
$script:scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
function Get-ProgramFiles32() {
if ( test-path (join-path $env:WinDir "SysWow64") ) {
return ${env:ProgramFiles(x86)}
}
return $env:ProgramFiles
}
$idePath = join-path (Get-ProgramFiles32) "Microsoft Visual Studio 10.0\Common7\IDE"
$vsixInstaller = join-path $idePath "vsixInstaller.exe"
$devenv = join-path $idePath "devenv.exe"
if (-not (test-path $vsixInstaller)) {
write-error "Couldn't find $vsixInstaller"
return
}
gps devenv -ErrorAction SilentlyContinue | kill
write-host "Uninstalling VsVim"
& $vsixInstaller /quiet /uninstall:VsVim.Microsoft.e214908b-0458-4ae2-a583-4310f29687c3
$dest = join-path (resolve-path ~\) 'Dogfood'
mkdir $dest -ErrorAction SilentlyContinue
pushd $scriptPath
copy VsVim\bin\Debug\* $dest
$target = join-path $dest "VsVim.vsix"
if (-not (test-path $target)) {
$target = join-path $dest "VsVim10.vsix"
}
popd
write-host "Installing VsVim"
& $vsixInstaller /quiet $target
sleep 2
wait-process "vsixInstaller" -ErrorAction SilentlyContinue
# Even though we waited for the installer to finish devenv doesn't
# always seem to pick up the change immediately. Wait a sec for
# it all to catch up
sleep 2
& $devenv