|
75 | 75 | [int]$BuildSystemsBuildId = -1,
|
76 | 76 |
|
77 | 77 | [Parameter(Mandatory=$false,HelpMessage="Use and increment the Revision part of the version number stored in the project file.",ParameterSetName="UseFilesRevision")]
|
| 78 | + [Alias("IncrementRevision")] |
78 | 79 | [switch]$IncrementProjectFilesRevision = $false,
|
79 | 80 |
|
80 | 81 | [Parameter(Mandatory=$false,HelpMessage="When the switch is provided, the ClickOnce Minimum Required Version will be updated to this new version.")]
|
@@ -230,20 +231,20 @@ foreach ($clickOncePropertyGroup in $clickOncePropertyGroups)
|
230 | 231 | throw "The version number '$appVersion' does not seem to have valid Major.Minor.Build version parts."
|
231 | 232 | }
|
232 | 233 | $majorMinor = $majorMinorBuildMatch.Groups["MajorMinor"].Value
|
233 |
| - $build = $majorMinorBuildMatch.Groups["Build"].Value |
234 |
| - $revision = -1 |
| 234 | + [int]$build = $majorMinorBuildMatch.Groups["Build"].Value |
| 235 | + [int]$revision = -1 |
235 | 236 |
|
236 | 237 | # If a Revision was specified in the Version, get it.
|
237 | 238 | if (![string]::IsNullOrWhiteSpace($majorMinorBuildMatch.Groups["Revision"]))
|
238 | 239 | {
|
239 |
| - $revision = $majorMinorBuildMatch.Groups["Revision"] |
| 240 | + $revision = [int]::Parse($majorMinorBuildMatch.Groups["Revision"]) |
240 | 241 | }
|
241 | 242 |
|
242 | 243 | # If we should be using the BuildSystemsBuildId for the Build and Revision.
|
243 | 244 | if ($BuildSystemsBuildId -gt -1)
|
244 | 245 | {
|
245 | 246 | # Use a calculation for the Build and Revision to prevent the Revision value from being too large, and to increment the Build value as the BuildSystemsBuildId continues to grow larger.
|
246 |
| - $build = [int]($BuildSystemsBuildId / $maxVersionPartValueAllowed) |
| 247 | + $build = [int][Math]::Floor($BuildSystemsBuildId / $maxVersionPartValueAllowed) |
247 | 248 | $revision = $BuildSystemsBuildId % $maxVersionPartValueAllowed
|
248 | 249 | }
|
249 | 250 |
|
@@ -287,6 +288,7 @@ foreach ($clickOncePropertyGroup in $clickOncePropertyGroups)
|
287 | 288 | Set-XmlNodesElementTextValue -xml $xml -node $clickOncePropertyGroup -elementName 'ApplicationRevision' -textValue $revision.ToString()
|
288 | 289 | if ($UpdateMinimumRequiredVersionToCurrentVersion)
|
289 | 290 | {
|
| 291 | + Write-Output "Updating minimum required version to be '$newVersionNumber'." |
290 | 292 | Set-XmlNodesElementTextValue -xml $xml -node $clickOncePropertyGroup -elementName 'MinimumRequiredVersion' -textValue "$newVersionNumber"
|
291 | 293 | Set-XmlNodesElementTextValue -xml $xml -node $clickOncePropertyGroup -elementName 'UpdateRequired' -textValue 'true'
|
292 | 294 | Set-XmlNodesElementTextValue -xml $xml -node $clickOncePropertyGroup -elementName 'UpdateEnabled' -textValue 'true'
|
|
0 commit comments