Skip to content

Instantly share code, notes, and snippets.

@serra
Forked from ferventcoder/setup.ps1
Last active December 19, 2015 02:48
Show Gist options
  • Save serra/5885160 to your computer and use it in GitHub Desktop.
Save serra/5885160 to your computer and use it in GitHub Desktop.
This sets up your development machine to wrok with openkas.
$scriptDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
$openkasDir = "c:\Openkas"
[Environment]::SetEnvironmentVariable("OpenkasDir", "$openkasDir", "Machine")
# directory for data and some configuration files
mkdir $openkasDir
mkdir "$openkasDir\scripts\"
mkdir "$openkasDir\periodic_backup\"
function Install-NeededFor {
param(
[string] $packageName = ''
,[bool] $defaultAnswer = $true
)
if ($packageName -eq '') {return $false}
$yes = '6'
$no = '7'
$msgBoxTimeout='-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
}
#install chocolatey
if (Install-NeededFor 'chocolatey') {
iex ((new-object net.webclient).DownloadString("http://chocolatey.org/install.ps1"))
}
Write-Host "Grabbing required frameworks"
cinst netframework2 -source webpi
cinst NETFramework35 -source webpi
cinst NETFramework4 -source webpi
cinst NETFramework4Update402 -source webpi
cinst NETFramework4Update402_KB2544514_Only -source webpi
cinst WindowsInstaller31 -source webpi
cinst WindowsInstaller45 -source webpi
if (Install-NeededFor 'VS2010 Full Edition SP1') {
cinst VS2010SP1Pack -source webpi
}
cinst MVC3 -source webpi
cinst MVC3Loc -source webpi
Write-Host "Finished checking for/installing Visual Studio Items."
cinst SQLManagementStudio -source webpi
if (Install-NeededFor 'IIS') {
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
}
# this installed most tools, but not all; perhaps because of missing dependencies
cinst all -source https://www.myget.org/F/openkas-tools/
cinst libreoffice
cinst githubforwindows
cinst gitextensions
nuget sources add -name openkas -source http://www.myget.org/F/openkas/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment