Skip to content
Snippets Groups Projects
Commit 25d767e8 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Adapt Make-Package to recent changes in folder structure.

parent 1a1b79a6
No related branches found
No related tags found
No related merge requests found
[CmdletBinding()]
Param(
[ValidateSet("Debug", "Release")][String] $Target = "Debug"
)
$ResourceDir = "..\AutoTx\Resources"
$TemplateDir = "$($ResourceDir)\Mail-Templates"
$BinariesDir = "..\AutoTx\bin\$($Target)"
try { try {
$BuildDate = Get-Content "BuildDate.txt" -EA Stop $BuildDate = Get-Content "$($ResourceDir)\BuildDate.txt" -EA Stop
} }
catch { catch {
Write-Host "Error reading build-date, stopping." Write-Host "Error reading build-date, stopping."
Exit Exit
} }
$BaseDir = $BuildDate -replace ':','-' -replace ' ','_' $PkgDir = $BuildDate -replace ':','-' -replace ' ','_'
$BaseDir = "build_" + $BaseDir $PkgDir = "build_" + $PkgDir
Write-Host "Creating package: [$($BaseDir)]" Write-Host "Creating package [$($PkgDir)] using binaries from [$($BinariesDir)]"
if (Test-Path $BaseDir) { if (Test-Path $PkgDir) {
Write-Host "Removing existing package dir..." Write-Host "Removing existing package dir..."
Remove-Item -Recurse -Force $BaseDir Remove-Item -Recurse -Force $PkgDir
} }
$dir = New-Item -ItemType Container -Name $BaseDir $dir = New-Item -ItemType Container -Name $PkgDir
$dir = New-Item -ItemType Container -Path $BaseDir -Name "AutoTx" $dir = New-Item -ItemType Container -Path $PkgDir -Name "AutoTx"
$tgt = $dir.FullName
Copy-Item -Recurse -Force -Path "Mail-Templates" -Destination $dir.FullName Copy-Item -Recurse "$TemplateDir" $tgt
Copy-Item -Recurse -Force -Path "..\bin\Debug\*" -Destination $dir.FullName Copy-Item -Recurse "$($BinariesDir)\*" $tgt
# provide an up-to-date version of the example config file: # provide an up-to-date version of the example config file:
Copy-Item -Force -Path "configuration-example.xml" -Destination $dir.FullName Copy-Item "$($ResourceDir)\configuration-example.xml" $tgt
Copy-Item -Force -Path "configuration-example.xml" -Destination "$($BaseDir)\configuration.xml" Copy-Item "$($ResourceDir)\configuration-example.xml" "$($PkgDir)\configuration.xml"
Copy-Item -Force -Path "status-example.xml" -Destination "$($BaseDir)\status.xml" Copy-Item "$($ResourceDir)\status-example.xml" "$($PkgDir)\status.xml"
Copy-Item -Force -Path "BuildDate.txt" -Destination "$($BaseDir)\service.log" Copy-Item "$($ResourceDir)\BuildDate.txt" "$($PkgDir)\service.log"
Copy-Item -Force -Path "ScriptsConfig.ps1" -Destination $BaseDir Copy-Item "ScriptsConfig.ps1" $PkgDir
Copy-Item -Force -Path "Install-Service.ps1" -Destination $BaseDir Copy-Item "Install-Service.ps1" $PkgDir
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment