bcurran3 / ChocolateyPackages

My published Chocolatey packages
207 stars 94 forks source link

Fix incorrect Get-OSArchitectureWidth comparison #299

Closed brogers5 closed 9 months ago

brogers5 commented 2 years ago

This changeset resolves a subtle install script failure that is only apparent on 32-bit systems. I experienced the exact same issue with a few of my packages, and did a recursive search on my machine for other places this may have happened. As I've previously cloned your repository, a couple of your packages came up.

The gist of it is that Get-OSArchitectureWidth -eq 64 will effectively ignore the -eq 64 portion, since Get-OSArchitectureWidth is a function and does not recognize -eq as a valid parameter. PowerShell will return the numerical address width value (i.e. 32 or 64) instead of performing the intended bool comparison. As this will always return a non-zero value, it will trigger the behavior intended for 64-bit systems on 32-bit systems.

This can be fixed by either wrapping Get-OSArchitectureWidth -eq 64 in parentheses to enable a correct interpretation of the condition, or change -eq to the supported -Compare parameter to return a bool value instead. I opted for the -Compare approach, as this isn't dependent on what could otherwise come across as redundant parentheses.

I've bumped the version of both affected packages using package fix notation.

bcurran3 commented 2 years ago

Thanks.

I think there's an update to the program. If you update the URL, checksum, and package version I'll pull it in.

brogers5 commented 2 years ago

I've rebased against master's current state, and updated both affected packages to the latest available version as requested. They were tested successfully against both 32-bit and 64-bit operating systems.

Some things I felt I should note:

brogers5 commented 2 years ago

And some optional thoughts I had while going through these:

bcurran3 commented 1 year ago

Coming back round to this...

RE: Snappy Driver Installer I remember there was some drama about this. A split between the devs and then two versions? I think one ver had a virus scare or was a virus? I also believe someone else created a Chocolatey package with the newer split version. I have no idea of the status of either now.

Assuming Snappy Driver is still around and kicking, I don't have an interest in maintaining it. I'd love to add you as a maintainer. Let me know your ChocolateyId if you accept.

RE: TeamSpeak Server I see the package is out of date. I don't use this and have no interest in it. I think it was late one night and I saw TeamSpeak Client was available on chocolatey.org and thought to myself that the server version should be too. I had more time back then... hahahaha

I'd love to pass maintainership of TeamSpeak Server to you as well. Let me know your ChocolateyId if you accept.

brogers5 commented 1 year ago

Unfortunately, I don't really use either of these, so I feel maintainership would be best assumed by someone else if you'd rather hand it off. Perhaps some RFMs are in order?

bcurran3 commented 9 months ago

Closing this as I am no longer creating or maintaining Chocolatey packages. Sorry, out of my control.

Hopefully you've enjoyed my work and found it useful.

Bella Ciao!