Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(wixtoolset) Change to only track GitHub v3 releases #2197

Merged
merged 2 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 14 additions & 23 deletions automatic/wixtoolset/update.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Import-Module AU
Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"

#$redirectPage = 'http://wixtoolset.org/releases/v3-10-3-3007/' # Provided in case we need to update the latest stable
$releases = 'http://wixtoolset.org/releases/'
# We are currently tracking version 3. We only track version 3 as it looks like version 4 will be available as a .NET tool,
# and possibly not through its own installer.

$softwareName = 'WiX Toolset*'
$padUnderVersion = '3.10.4'

function global:au_BeforeUpdate { Get-RemoteFiles -Purge -NoSuffix }

Expand All @@ -25,31 +25,22 @@ function global:au_SearchReplace {
}
}
}
function global:au_GetLatest {

$builder = New-Object System.UriBuilder($releases)
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing
$re = '(rc[\d]+|stable)$'
$builder.Path = $download_page.Links | ? href -match $re | select -first 1 -expand href
$redirectPage = Get-RedirectedUrl $builder.ToString()
$preReleaseSuffix = if ($builder.Path.EndsWith('stable')) { '' }
else {
$index = $builder.Path.IndexOf('rc')
"-" + $builder.Path.Substring($index)
}
function global:au_AfterUpdate {
Update-Metadata -key 'releaseNotes' -value $Latest.ReleaseNotes
}

$downloadBuilder = New-Object System.UriBuilder($redirectPage)
$download_page = Invoke-WebRequest -Uri $redirectPage -UseBasicParsing
$downloadBuilder.Path = $download_page.Links | ? href -match "\.exe$" | select -first 1 -expand href
function global:au_GetLatest {
$release = Get-GitHubRelease -Owner 'wixtoolset' -Name 'wix3'

$verRe = '\/v?'
$version32 = ($builder.Path -split "$verRe" | select -last 1 -skip 1) -replace '\-','.'
if ($preReleaseSuffix) { $version32 += $preReleaseSuffix }
$url = $release.assets | ? browser_download_url -match "\.exe$" | Select-Object -First 1 -ExpandProperty browser_download_url
$version = $release.name -split 'v' | Select-Object -Last 1

@{
URL32 = $downloadBuilder.Uri.ToString()
Version = $version32
ReleasesUrl = $redirectPage
URL32 = $url
Version = Get-Version $version
ReleasesUrl = $release.html_url
ReleaseNotes = $release.body
}
}

Expand Down
2 changes: 1 addition & 1 deletion automatic/wixtoolset/wixtoolset.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ With Burn, the WiX bootstrapper, you can create setup bundles that install prere
The WiX SDK includes managed and native libraries that make it easier to write code that works with Windows Installer, including custom actions in both C# and C++.

]]></description>
<releaseNotes>Will be replaced by updater</releaseNotes>
<dependencies>
<dependency id="dotnet3.5" version="3.5.20160716" />
<dependency id="chocolatey-core.extension" version="1.3.3" />
</dependencies>
</metadata>
<files>
Expand Down