Merge pull request #323 from Romanitho/fix-update

fixed new version implementation for pre-releases
pull/324/head
Romain 2023-04-19 22:53:48 +02:00 committed by GitHub
commit bb4ab0b7eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -92,9 +92,9 @@ if (Test-Network) {
else { else {
Write-ToLog "WAU AutoUpdate is Enabled." "Green" Write-ToLog "WAU AutoUpdate is Enabled." "Green"
#Get Available Version #Get Available Version
$WAUAvailableVersion = Get-WAUAvailableVersion $Script:WAUAvailableVersion = Get-WAUAvailableVersion
#Compare #Compare
if ([version]$WAUAvailableVersion -gt [version]$WAUCurrentVersion) { if ([version]$WAUAvailableVersion.Replace("-", ".") -ne [version]$WAUCurrentVersion) {
#If new version is available, update it #If new version is available, update it
Write-ToLog "WAU Available version: $WAUAvailableVersion" "Yellow" Write-ToLog "WAU Available version: $WAUAvailableVersion" "Yellow"
Update-WAU Update-WAU

View File

@ -19,7 +19,7 @@ function Get-WAUAvailableVersion {
} }
#Return version to windows format (1.0.0 or 1.0.0.0 for nightlies) #Return version
return (((Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v", "")).Replace("-", ".") return ((Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v", "")
} }

View File

@ -41,9 +41,9 @@ function Update-WAU {
Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue
#Set new version to registry #Set new version to registry
$WAUConfig | New-ItemProperty -Name DisplayVersion -Value $WAUAvailableVersion -Force $WAUConfig | New-ItemProperty -Name DisplayVersion -Value $($WAUAvailableVersion.Replace("-", ".")) -Force
$WAUConfig | New-ItemProperty -Name VersionMajor -Value ([version]$WAUAvailableVersion).Major -Force $WAUConfig | New-ItemProperty -Name VersionMajor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Major -Force
$WAUConfig | New-ItemProperty -Name VersionMinor -Value ([version]$WAUAvailableVersion).Minor -Force $WAUConfig | New-ItemProperty -Name VersionMinor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Minor -Force
#Set Post Update actions to 1 #Set Post Update actions to 1
$WAUConfig | New-ItemProperty -Name WAU_PostUpdateActions -Value 1 -Force $WAUConfig | New-ItemProperty -Name WAU_PostUpdateActions -Value 1 -Force