Skip to content

Add Battle.net package recipe#8

Open
Zoullx wants to merge 1 commit intochocolatey-community:masterfrom
Zoullx:master
Open

Add Battle.net package recipe#8
Zoullx wants to merge 1 commit intochocolatey-community:masterfrom
Zoullx:master

Conversation

@Zoullx
Copy link
Copy Markdown

@Zoullx Zoullx commented Jan 4, 2023

The updates to the Battle.net chocolatey package can't be pushed to the public feed because the executable is built on demand and therefore has a different checksum every time it's downloaded. But I would still like to submit the updates somewhere so that the community can access a working Battle.net chocolatey package.

Copy link
Copy Markdown
Member

@TheCakeIsNaOH TheCakeIsNaOH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing this package over here, sorry it took so long to take a look at it.

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Read this before creating packages: https://docs.chocolatey.org/en-us/create/create-packages -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default comment in this file can be removed.

This package requires the `autohotkey` chocolatey package
This package requires the `chocolatey-misc-helpers.extension` chocolatey package

The updater requires a properly configured installation of [AU](https://github.com/majkinetor/au)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to mention chocolatey-au here as well.

$fileLocation = Join-Path $toolsDir 'Battle.net-Setup.exe'
$checksumType = 'sha256'

Invoke-WebRequest $url -OutFile $fileLocation -UseBasicParsing
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not really any point in downloading the file beforehand to get the checksum for Install-ChocolateyPackage, at least security wise.


### Notes:

The Battle.net Launcher is built on demand when downloaded, so the checksum will be calculated on demand to be provided to `Install-ChocolateyPackage`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this package would only be used in internal repositories, it probably would make more sense to embed the installer in the package. But I'm open to discussion on this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants