-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/tunisiano187/Chocolatey-p…
- Loading branch information
Showing
9 changed files
with
95 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
VERIFICATION | ||
Verification is intended to assist the Chocolatey moderators and community | ||
in verifying that this package's contents are trustworthy. | ||
|
||
1. Download the installer: | ||
|
||
x32: https://sourceforge.net/projects/freeplane/files/freeplane%20stable/Freeplane-Setup-with-Java-1.12.5.exe/download | ||
|
||
2. You can use one of the following methods to obtain the checksum: | ||
- Use powershell function 'Get-FileHash' | ||
- Use Chocolatey utility 'checksum.exe' | ||
- Using AU: | ||
Get-RemoteChecksum https://sourceforge.net/projects/freeplane/files/freeplane%20stable/Freeplane-Setup-with-Java-1.12.5.exe/download | ||
|
||
3. Compare to Checksum: | ||
|
||
checksum32: d214c610141466289b5bd717447626c706bab9aebb4fc86b6091f26ae5335523 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import-module au | ||
|
||
$releases = 'https://ftp.gnu.org/gnu/units/windows/' | ||
|
||
function global:au_SearchReplace { | ||
@{ | ||
'.\legal\VERIFICATION.txt' = @{ | ||
"(?i)(\s+x32:).*" = "`${1} $($Latest.URL32)" | ||
"(?i)(Get-RemoteChecksum).*" = "`${1} $($Latest.URL32)" | ||
"(?i)(\s+checksum32:).*" = "`${1} $($Latest.Checksum32)" | ||
} | ||
} | ||
} | ||
|
||
function global:au_BeforeUpdate { | ||
. ..\..\scripts\Get-FileVersion.ps1 | ||
$FileVersion = Get-FileVersion $Latest.URL32 -keep | ||
Move-Item -Path $FileVersion.TempFile -Destination "tools\units-$($Latest.Version)-setup.exe" | ||
$Latest.Checksum32 = $FileVersion.Checksum | ||
$Latest.ChecksumType32 = $FileVersion.checksumType | ||
} | ||
|
||
function global:au_AfterUpdate($Package) { | ||
Invoke-VirusTotalScan $Package | ||
} | ||
|
||
function global:au_GetLatest { | ||
# URL of the GNU FTP directory | ||
$url = "https://ftp.gnu.org/gnu/units/windows/" | ||
|
||
# Fetch the HTML content from the page | ||
$response = Invoke-WebRequest -Uri $url | ||
|
||
# Extract all the file links from the page | ||
$fileLinks = $response.Links | Where-Object { $_.href -match '\.exe$' } | ||
|
||
# Define a regex pattern to extract the version numbers | ||
$versionPattern = '(\d+\.\d+)' | ||
|
||
# Initialize variables to store the highest version and its URL | ||
$highestVersion = [Version]"0.0" | ||
$highestVersionUrl = "" | ||
|
||
# Iterate over each file link and compare versions | ||
foreach ($link in $fileLinks) { | ||
if ($link.href -match $versionPattern) { | ||
$version = [Version]$matches[1] | ||
|
||
# Compare the current version with the highest version found so far | ||
if ($version -gt $highestVersion) { | ||
$highestVersion = $version | ||
$highestVersionUrl = $url + $link.href | ||
} | ||
} | ||
} | ||
|
||
# Output the URL of the file with the highest version | ||
if ($highestVersionUrl) { | ||
$url = $highestVersionUrl | ||
$version = $highestVersion | ||
} | ||
|
||
$Latest = @{ URL32 = $url; Version = $version } | ||
return $Latest | ||
} | ||
|
||
update -NoCheckChocoVersion |