Skip to content

Commit 90ba4b8

Browse files
committed
[Project] Automate release packing during build
1 parent 8940199 commit 90ba4b8

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

PackRelease.ps1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
if (Test-Path -Path "$((Get-Location).Path)\bin\Debug\SysprepPreparator.exe" -PathType Leaf) {
2-
New-Item -Path ".\out" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
3-
Copy-Item -Path ".\bin\Debug\Microsoft.Dism.dll" -Destination ".\out\Microsoft.Dism.dll" -Verbose -Force
4-
Copy-Item -Path ".\bin\Debug\IniFileParser.dll" -Destination ".\out\IniFileParser.dll" -Verbose -Force
5-
New-Item -Path ".\out\Languages" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
6-
Copy-Item -Path ".\bin\Debug\Languages\*.ini" -Destination ".\out\Languages" -Verbose -Force
7-
Copy-Item -Path ".\bin\Debug\SysprepPreparator.exe*" -Destination ".\out" -Verbose -Force
8-
Compress-Archive -Path ".\out\*" -DestinationPath ".\SysprepPreparator.zip" -Force
2+
Write-Host "Packing release..."
3+
New-Item -Path "$((Get-Location).Path)\out" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
4+
Copy-Item -Path "$((Get-Location).Path)\bin\Debug\Microsoft.Dism.dll" -Destination "$((Get-Location).Path)\out\Microsoft.Dism.dll" -Verbose -Force
5+
Copy-Item -Path "$((Get-Location).Path)\bin\Debug\IniFileParser.dll" -Destination "$((Get-Location).Path)\out\IniFileParser.dll" -Verbose -Force
6+
New-Item -Path "$((Get-Location).Path)\out\Languages" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
7+
Copy-Item -Path "$((Get-Location).Path)\bin\Debug\Languages\*.ini" -Destination "$((Get-Location).Path)\out\Languages" -Verbose -Force
8+
Copy-Item -Path "$((Get-Location).Path)\bin\Debug\SysprepPreparator.exe*" -Destination "$((Get-Location).Path)\out" -Verbose -Force
9+
Compress-Archive -Path "$((Get-Location).Path)\out\*" -DestinationPath "$((Get-Location).Path)\SysprepPreparator.zip" -Force
10+
} else {
11+
Write-Host "Output directory not found."
912
}

SysprepPreparator.vbproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,7 @@
212212
<Target Name="AfterBuild">
213213
</Target>
214214
-->
215+
<PropertyGroup>
216+
<PostBuildEvent>"\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -command "cd '$(ProjectDir)' ; iex '$(ProjectDir)PackRelease.ps1'"</PostBuildEvent>
217+
</PropertyGroup>
215218
</Project>

0 commit comments

Comments
 (0)