Skip to content
Open
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
6 changes: 5 additions & 1 deletion .github/workflows/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ jobs:

- name: Install Chocolatey Core Extensions
run: |
choco install chocolatey-core.extension
choco install -y chocolatey-core.extension

- name: Install Megatools
run: |
choco install -y megatools

- name: Install AU
run: |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ distribution rights. -->
<files>
<!-- this section controls what actually gets packaged into the Chocolatey package -->
<file src="tools\**" target="tools" />
<file src="legal\**" target="legal" />
<!--Building from Linux? You may need this instead: <file src="tools/**" target="tools"
/>-->
</files>
Expand Down
15 changes: 15 additions & 0 deletions automatic/jdownloader/legal/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that the contents of this package is trustworthy.

The installer has been downloaded from the official download link listed on <https://jdownloader.org/jdownloader2>
and can be verified like this:

1. Download the following installers:
url: EMPTY
2. You can use one of the following methods to obtain the checksum
- Use powershell function 'Get-Filehash'
- Use chocolatey utility 'checksum.exe'

checksum type: sha256
checksum64: EMPTY
12 changes: 12 additions & 0 deletions automatic/jdownloader/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$ErrorActionPreference = 'Stop'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'EXE'
file = Get-Item "$toolsDir\*.exe"
silentArgs = "-q"
validExitCodes = @(0)
}

Install-ChocolateyPackage @packageArgs
36 changes: 36 additions & 0 deletions automatic/jdownloader/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$ErrorActionPreference = 'Stop'
Import-Module -Name 'au'

function global:au_SearchReplace {
@{
'.\legal\VERIFICATION.txt' = @{
'(?i)(\s+url:).*' = "`${1} $($Latest.URL)"
'(?i)(\s+checksum64:).*' = "`${1} $($Latest.Checksum64)"
}
}
}

function global:au_AfterUpdate {
Set-DescriptionFromReadme -SkipFirst 2
}

function global:au_GetLatest {

$DownloadsPage = Invoke-WebRequest -UseBasicParsing -Uri 'https://jdownloader.org/jdownloader2'
$MegaLink = ($DownloadsPage.Links | Where-Object -Property 'href' -Match 'https://mega.nz/file/')[0]

$InstallerPath = '.\tools\JDownloader2Setup.exe'
$TempPath = $InstallerPath + '.tmp'
megatools dl --no-progress --path="$TempPath" $MegaLink.href
Move-Item -Path $TempPath -Destination $InstallerPath -Force
$latestVersion = (Get-Item $InstallerPath).VersionInfo.FileVersion
$latestChecksum64 = (Get-FileHash -Path $InstallerPath -Algorithm 'SHA256').Hash

return @{
URL = $MegaLink.href
Version = $latestVersion
Checksum64 = $latestChecksum64
}
}

update -ChecksumFor none
16 changes: 0 additions & 16 deletions manual/jdownloader/tools/chocolateyInstall.ps1

This file was deleted.