Xav83 / chocolatey-packages

Implementation of the template to create and maintain chocolatey packages both manual and automatic (mostly automatic)
https://chocolatey.org/profiles/Xav83
Apache License 2.0
3 stars 4 forks source link

phantombot package invalid download and install dir param request #19

Closed Destroy666x closed 7 months ago

Destroy666x commented 1 year ago

Hi,

1st of all, the package has a big issue of downloading the wrong release. This regex is incorrect: https://github.com/Xav83/chocolatey-packages/blob/develop/automatic/phantombot/update.ps1#L21 It assumes any kind of release basically and gets the 1st one, so PhantomBot-3.7.0.1-arm-bsd-other.zip in case of current version instead of proper PhantomBot-3.7.0.1-win.zip. The regex should include win and escape the extension dot like \.. So: $re = "PhantomBot.+win\.zip$"

Secondly, it would be nice if we could override the unzip location. So something like /InstallDir param that's available in many Chocolatey community packages would be handy.

Xav83 commented 1 year ago

Hi @Destroy666x :slightly_smiling_face:

Thank you a lot for creating this issue!

I have corrected the error in the update script for the Phantombot package (https://github.com/Xav83/chocolatey-packages/commit/a2bf09d0dcd3e5c47bf90536ba175ee6f8526151). From now on, all the new package version will point to the right zip. Thank you again for noticing and notifying me :pray:

About the second point, do you have some example of package that have the feature /InstallDir ? To avoid reinventing the wheel, and to make sure that I understand your request :wink:

Destroy666x commented 1 year ago

Thanks.

I do indeed. Many Chocolatey packages in the official community repository have it, for instance. Few examples:

It's mostly nice to have for apps that don't use standard install locations such as C:\Program Files by default. I don't recall where this was installed or unzipped but the location was quite random. Most likely either in the location where the install PS script is or in C:\tools

Xav83 commented 7 months ago

Hi @Destroy666x,

I have create a Pull Request #30 with the modification on the phantombot package which, if I understand correctly the code in the examples you mentioned, should allow people to be able to specify a parameter /InstallDir in order to specify another folder where to install Phantombot.

Feel free to comment on the Pull Request #30, if you see an error, something missing, or if everything looks fine to you :wink: I'll integrate it next week, after a few tests on my Windows machine. After that, this feature will be integrated in the next update of Phantombot. :slightly_smiling_face:

Destroy666x commented 7 months ago

Thanks, looks good, I'll check if it works fine later

It indeed does