|
15 | 15 | [string]$buildOutputPath = "WinRemoteControl\bin\Release\net6.0-windows\win-x86\publish", |
16 | 16 | [string]$CsprojPath = "WinRemoteControl\WinRemoteControl.csproj", |
17 | 17 | [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, |
19 | 19 | [string]$baseDirectory = "$PSScriptRoot", |
20 | 20 | [string]$installerOutputPath = "Installer\Output", |
21 | 21 | [string]$setupExecutableName = "WinRemoteControl_Setup_32" |
@@ -48,12 +48,6 @@ $installerFolderPath = Join-Path (Get-Location).Path "Installer" |
48 | 48 | $innoSetupScriptPath = Resolve-Path (Join-Path $installerFolderPath "InstallerScript.iss") |
49 | 49 | $innoSetupResourcesPath = Resolve-Path (Join-Path $installerFolderPath "InnoSetupResources") |
50 | 50 |
|
51 | | -# Normalize installer output path |
52 | | -#if(![System.IO.Path]::IsPathRooted($installerOutputPath)) |
53 | | -#{ |
54 | | -# $installerOutputPath = Join-Path (Get-Location).Path $installerOutputPath |
55 | | -#} |
56 | | - |
57 | 51 | if($pathsAreRelativeToBaseDirectory) |
58 | 52 | { |
59 | 53 | $buildOutputPath = Join-Path $baseDirectory $buildOutputPath |
@@ -88,8 +82,12 @@ if (-Not (Test-Path $innoSetupCompilerPath)) |
88 | 82 | } |
89 | 83 |
|
90 | 84 | # 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 | +} |
93 | 91 |
|
94 | 92 | LogSection "END Pre-compilation tasks" |
95 | 93 |
|
|
0 commit comments