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 {
|
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
|
||||||
|
|
|
@ -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", "")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue