mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
24 lines
564 B
PowerShell
24 lines
564 B
PowerShell
[CmdletBinding()]
|
|
[Alias()]
|
|
Param
|
|
(
|
|
# EXE path
|
|
[Parameter(Mandatory=$true, Position=0)]
|
|
$ExePath
|
|
)
|
|
|
|
try
|
|
{
|
|
$versionInfo = (Get-Item "$ExePath").VersionInfo
|
|
|
|
# Generate the app version - the build number (MS calls it revision) is always 0 because the Windows Store requires that
|
|
$AppVersion = "$($versionInfo.FileMajorPart).$($versionInfo.FileMinorPart).$($versionInfo.FileBuildPart).0"
|
|
|
|
Write-Output "SET OTTD_VERSION=$($AppVersion)"
|
|
}
|
|
catch
|
|
{
|
|
Write-Output "@ECHO Error retrieving EXE version - did you provide a path?"
|
|
exit 1
|
|
}
|