Skip to content

Commit

Permalink
(wixtoolset) Change to track wix3 releases
Browse files Browse the repository at this point in the history
Due to changes upstream on the website, to make continued checks as easy
as possible this commit changes to explicitly only track releases made on GitHub
for version 3 of the software.

ref chocolatey-community#2187
  • Loading branch information
AdmiringWorm committed Mar 27, 2023
1 parent e479461 commit ec6c4a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
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
1 change: 1 addition & 0 deletions automatic/wixtoolset/wixtoolset.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ 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" />
Expand Down

0 comments on commit ec6c4a1

Please sign in to comment.