Merge pull request #323 from Romanitho/fix-update
fixed new version implementation for pre-releasespull/324/head
commit
bb4ab0b7eb
|
@ -92,9 +92,9 @@ if (Test-Network) {
|
|||
else {
|
||||
Write-ToLog "WAU AutoUpdate is Enabled." "Green"
|
||||
#Get Available Version
|
||||
$WAUAvailableVersion = Get-WAUAvailableVersion
|
||||
$Script:WAUAvailableVersion = Get-WAUAvailableVersion
|
||||
#Compare
|
||||
if ([version]$WAUAvailableVersion -gt [version]$WAUCurrentVersion) {
|
||||
if ([version]$WAUAvailableVersion.Replace("-", ".") -ne [version]$WAUCurrentVersion) {
|
||||
#If new version is available, update it
|
||||
Write-ToLog "WAU Available version: $WAUAvailableVersion" "Yellow"
|
||||
Update-WAU
|
||||
|
|
|
@ -19,7 +19,7 @@ function Get-WAUAvailableVersion {
|
|||
|
||||
}
|
||||
|
||||
#Return version to windows format (1.0.0 or 1.0.0.0 for nightlies)
|
||||
return (((Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v", "")).Replace("-", ".")
|
||||
#Return version
|
||||
return ((Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v", "")
|
||||
|
||||
}
|
||||
|
|
|
@ -41,9 +41,9 @@ function Update-WAU {
|
|||
Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue
|
||||
|
||||
#Set new version to registry
|
||||
$WAUConfig | New-ItemProperty -Name DisplayVersion -Value $WAUAvailableVersion -Force
|
||||
$WAUConfig | New-ItemProperty -Name VersionMajor -Value ([version]$WAUAvailableVersion).Major -Force
|
||||
$WAUConfig | New-ItemProperty -Name VersionMinor -Value ([version]$WAUAvailableVersion).Minor -Force
|
||||
$WAUConfig | New-ItemProperty -Name DisplayVersion -Value $($WAUAvailableVersion.Replace("-", ".")) -Force
|
||||
$WAUConfig | New-ItemProperty -Name VersionMajor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Major -Force
|
||||
$WAUConfig | New-ItemProperty -Name VersionMinor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Minor -Force
|
||||
|
||||
#Set Post Update actions to 1
|
||||
$WAUConfig | New-ItemProperty -Name WAU_PostUpdateActions -Value 1 -Force
|
||||
|
|
Loading…
Reference in New Issue