Skip to content

Instantly share code, notes, and snippets.

@DeCarabas
Last active August 29, 2015 13:56
Show Gist options
  • Save DeCarabas/9078360 to your computer and use it in GitHub Desktop.
Save DeCarabas/9078360 to your computer and use it in GitHub Desktop.
Powershell script to copy an XNA install to VS 2013 (from VS2012, but easily changeable)
$vsolddir = "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\XNA Game Studio 4.0"
$vsnewroot = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE"
$vsnewdir = "$vsnewroot\Extensions\Microsoft\XNA Game Studio 4.0"
$vsnewcache = "$env:LocalAppData\Microsoft\VisualStudio\12.0\Extensions"
# Copy files
Write-Host "Copying the extension files..."
if (-not (test-path $vsnewdir)) {
mkdir $vsnewdir | out-null
}
copy -r -force "$vsolddir\*" $vsnewdir
# Munge the manifest
Write-Host "Editing the manifest..."
$manifest = "$vsnewdir\extension.vsixmanifest"
$content = [xml](Get-Content $manifest)
$content.Vsix.Identifier.SupportedProducts.VisualStudio.Version = '12.0'
$content.Save($manifest)
# Clear the cache
if (test-path $vsnewcache) {
Write-Host "Clearing the cache..."
del -force "$vsnewcache\extensionSdks.*.cache"
del -force "$vsnewcache\extensions.*.cache"
}
# Reset VS
Write-Host "Running devenv.exe /setup ..."
Start-Process "$vsnewroot\devenv.exe" @("/setup") -Wait | out-null
Write-Host "Enjoy your XNA goodness"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment