Created
October 20, 2015 20:09
-
-
Save dealproc/3cf063efa0b7547b4e39 to your computer and use it in GitHub Desktop.
drey.install.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$installPath, | |
$toolsPath, | |
$package, | |
$project | |
) | |
# Find Debug configuration and set debugger settings. | |
Write-Host "`tSetting startup information in Debug configuration" | |
$project.Save() | |
[xml]$prjXml = Get-Content $project.FullName | |
foreach ($PropertyGroup in $prjXml.project.ChildNodes) | |
{ | |
if ($PropertyGroup.StartAction -ne $null) | |
{ | |
exit | |
} | |
} | |
$propertyGroupElement = $prjXml.CreateElement("PropertyGroup", $prjXml.Project.GetAttribute("xmlns")); | |
$startActionElement = $prjXml.CreateElement("StartAction", $prjXml.Project.GetAttribute("xmlns")); | |
$propertyGroupElement.AppendChild($startActionElement) | |
$propertyGroupElement.StartAction = "Program" | |
$startProgramElement = $prjXml.CreateElement("StartProgram", $prjXml.Project.GetAttribute("xmlns")); | |
$propertyGroupElement.AppendChild($startProgramElement) | |
$propertyGroupElement.StartProgram = "`$(SolutionDir)Runtime\Runtime.exe" | |
$prjXml.project.AppendChild($propertyGroupElement); | |
$writerSettings = new-object System.Xml.XmlWriterSettings | |
$writerSettings.OmitXmlDeclaration = $false | |
$writerSettings.NewLineOnAttributes = $false | |
$writerSettings.Indent = $true | |
$projectFilePath = Resolve-Path -Path $project.FullName | |
$writer = [System.Xml.XmlWriter]::Create($projectFilePath, $writerSettings) | |
$prjXml.WriteTo($writer) | |
$writer.Flush() | |
$writer.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment