-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgather_gui_publish.ps1
39 lines (30 loc) · 1.17 KB
/
gather_gui_publish.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<#
PUBLISH RANSEILINK GUI
This script is designed to gather files after publishing the app via visual studio
#>
param([string] $Destination=$pwd)
# Establish file paths
$rlRootDir = "${env:USERPROFILE}\source\repos\RanseiLink"
$rlReleaseDir = "$rlRootDir\RanseiLink.Windows\bin\Release\net6.0-windows\publish\win-x64"
$csproj = "$rlRootDir\RanseiLink.Windows\RanseiLink.Windows.csproj"
# Read version from csproj
$csprojXml = [xml](Get-Content $csproj)
$versionPrefix = $csprojXml.Project.PropertyGroup.VersionPrefix
$versionSuffix = $csprojXml.Project.PropertyGroup.VersionSuffix
if ($versionSuffix)
{
$version = "${versionPrefix}-${versionSuffix}"
}
else
{
$version = "${versionPrefix}"
}
$rlExportDir = "${Destination}\RanseiLink-${version}"
Write-Host "Publishing to directory '${rlExportDir}'"
# Copy the published directory
Copy-Item -Path $RlReleaseDir -Destination $RlExportDir -Exclude *.pdb -Recurse
# Rename the exe to contain the version number
Rename-Item -Path "$rlExportDir\RanseiLink.Windows.exe" -NewName "RanseiLink-${version}.exe"
# Copy latest plugins
#Copy-Item -Path "$Destination\LatestPlugins" -Destination "$rlExportDir\Plugins" -Recurse
read-host