Skip to content

Commit 5a78f13

Browse files
committed
Fix version path on XML
1 parent cc7d410 commit 5a78f13

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

GenerateInstaller.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ param
1515
[string]$buildOutputPath = "WinRemoteControl\bin\Release\net6.0-windows\win-x86\publish",
1616
[string]$CsprojPath = "WinRemoteControl\WinRemoteControl.csproj",
1717
[string]$SetupIconFile = "WinRemoteControl\Resources\big_icon_5jt_icon.ico",
18-
[Parameter(HelpMessage="Overrides build identifier, script tries to get it automatically")][Version]$buildIdentifier,
18+
[Parameter(HelpMessage="Overrides build identifier, script tries to get it automatically")]$buildIdentifier,
1919
[string]$baseDirectory = "$PSScriptRoot",
2020
[string]$installerOutputPath = "Installer\Output",
2121
[string]$setupExecutableName = "WinRemoteControl_Setup_32"
@@ -48,12 +48,6 @@ $installerFolderPath = Join-Path (Get-Location).Path "Installer"
4848
$innoSetupScriptPath = Resolve-Path (Join-Path $installerFolderPath "InstallerScript.iss")
4949
$innoSetupResourcesPath = Resolve-Path (Join-Path $installerFolderPath "InnoSetupResources")
5050

51-
# Normalize installer output path
52-
#if(![System.IO.Path]::IsPathRooted($installerOutputPath))
53-
#{
54-
# $installerOutputPath = Join-Path (Get-Location).Path $installerOutputPath
55-
#}
56-
5751
if($pathsAreRelativeToBaseDirectory)
5852
{
5953
$buildOutputPath = Join-Path $baseDirectory $buildOutputPath
@@ -88,8 +82,12 @@ if (-Not (Test-Path $innoSetupCompilerPath))
8882
}
8983

9084
# Get version from csproj
91-
$xml = [Xml] (Get-Content $CsprojPath)
92-
$buildIdentifier = [Version] $xml.Project.PropertyGroup.Version
85+
if($null -eq $buildIdentifier )
86+
{
87+
LogDebug "Build identifier not set, try to obtain it from .csproj"
88+
$xml = [Xml] (Get-Content $CsprojPath)
89+
$buildIdentifier = [version] $xml.Project.PropertyGroup[1].Version
90+
}
9391

9492
LogSection "END Pre-compilation tasks"
9593

0 commit comments

Comments
 (0)