chtof / chocolatey-packages

Apache License 2.0
12 stars 37 forks source link

Update and fix full auto install and uninstall of Battle.net chocolatey package #62

Closed Zoullx closed 1 year ago

Zoullx commented 2 years ago

I changed the .gitignore to allow the Battle.net-Setup.exe to be committed because if we download the installer exe we obtain a different sha every time and I use these chocolatey packages with Ansible and it needs the shas to exist and match otherwise the task fails.

I also had to change the way that the uninstaller was being called so that it used the built in chocolatey function in order to get rid of chocolateys prompt about not being able to automatically detect automatic uninstallation.

chtof commented 2 years ago

@Zoullx You want the installer embedded in the Chocolatey package. Have you checked if the installer is redistributable? cf. https://docs.chocolatey.org/en-us/create/create-packages : Sometimes called embedding the binaries, there are functions in the automation scripts you can call that will use the installers directly from the package instead of downloading first. This makes for the most reliable and deterministic packages, but ensure you have the legal right to distribute the software first if publishing to a public location (like the community package repository).

chtof commented 2 years ago

@Zoullx Have you read my previous post?

Zoullx commented 2 years ago

Sorry, life has been a bit crazy for me lately. I tried looking the redistribution rights but wasn't really able to find anything, however, I recently tried using my internal package setup this way to configure one of my machines with Ansible and it looks like Ansible can't automatically install this package anyway because of the way that Ansible works. So I wouldn't be opposed to removing the exe and the hash stuff so that this package can be published publicly and then I'll personally just use my internal package. Do you want me to add the commit to this PR to remove those things?

Zoullx commented 1 year ago

Alright, I made some changes in the effect of removing the embedded executable and made it to where the install script will download and grab the checksum from the downloaded executable and then use that downloaded executable for installation. No more embedded executable and no more issues with the checksum changing every time the executable is downloaded.

I also made some changes to some of the times in the ahk script as I saw longer times on some machines where those shorter times didn't work.

Do you think that these changes will work for the public feed?

Zoullx commented 1 year ago

I've updated the gitignore to ignore the Battle.net Setup executable again.

I also have an auto update script for the Battle.net package as well, if you would like to take a look at that.

chtof commented 1 year ago

You can't generate the checksum on the fly during the installation. The checksum is to ensure the binary scanned by the antivirus during the Chocolatey review is the same than the one installed.

Zoullx commented 1 year ago

Well darn. I guess the only option at that point would be to just not specify the checksum since the executable is built on demand and hence the checksum changes every time. Would you like me to make those changes and submit them to the PR?

chtof commented 1 year ago

You can't publish a Chocolatey package for a binary when the checksum changes too often. Chocolatey packages use checksum to ensure the binary scanned by antivirus is the same binary installed for security reasons.