autopkg / hansen-m-recipes

My recipes for Autopkg - https://github.com/autopkg
27 stars 50 forks source link

Catalina wine with MSIVersionProvider #150

Closed rustymyers closed 2 years ago

rustymyers commented 4 years ago

MSIVersionProvider utilizes wine to run lessmsi.exe. As of macOS Catalina, wine no longer functions due to the removal of 32bit kernel support or libraries. The following download recipes utilize the MSIVersionProvider:

Adobe/AdobeShockwavePlayer-Win.download.recipe
Apple/QuickTime-Win.download.recipe
Apple/iTunes-Win.download.recipe
Box/BoxEdit-Win.download.recipe
SharedProcessors/README.md
Skype/Skype-Win.download.recipe
ThomsonReuters/EndNote-Win.download.recipe
UnixUtils/7zip-Win.download.recipe
UnixUtils/7zip-Win64.download.recipe

The Zoom-Win.download has been converted to using URLTextSearcher to find the version on the web site. This might not be possible or desirable, but it works for now. Also, the regex is pretty junky, it could use some help...

Zoom/Zoom-Win.download.recipe

Other options may be to use a different tool. msitools (https://wiki.gnome.org/msitools) installs on Catalina with:

brew install msitools

Then the following command can find the version:

msiinfo export "/Users/sysman/Library/AutoPkg/Cache/local.bigfix.Zoom-Win/downloads/Zoom Video Conferencing.msi" File | awk '/Zoom.exe/ {print $5}'

The issue with this is there is no clear way of getting the version. At least, not clear to me.

Another option might be to use docker with wine: https://hub.docker.com/r/scottyhardy/docker-wine/ That may provide the best overall solution to utilize lessmsi in the future.

Finally, adding windows support to AutoPkg would be another solution. Then these tools could be run natively.

jgstew commented 4 years ago

"The issue with this is there is no clear way of getting the version. At least, not clear to me."

Can you provide example output? The whole thing, as well as whatever AWK is doing?

This might be useful: "msidump, to extract all tables or streams from an MSI file"

jgstew commented 4 years ago

I ran this: brew install msitools and now homebrew is updating, and wow my CPU is really going wild.

jgstew commented 4 years ago

This will get what you need:

msiinfo export ZoomInstallerFull.msi Property | grep ProductVersion

The "Property" table in an MSI is a standard table that contains the important strings. "ProductVersion" in the MSI maps to "DisplayVersion" in the Uninstall Registry generally.

I opened the MSI on Windows in SuperOrca to figure out where the info was, then ran MSITools on my mac to see if I could extract it.

See this screenshot:

Screen Shot 2019-11-15 at 1 21 57 PM
jgstew commented 4 years ago

Also, good job finding https://wiki.gnome.org/msitools ... it does exactly what is needed. I wish I knew about it previously.

rustymyers commented 4 years ago

Thanks @jgstew! This looks really promising. I like to use awk for a result like that so I can pull just the second output, such as:

msiinfo export ZoomInstallerFull.msi Property | awk '/ProductVersion/ {print $2}'

My plan is to update the MSIVersionProvider.py with this new tool. Hopefully I can stage a copy, otherwise I'll just have to have it as a prerequisite. Appreciate the help!!

jgstew commented 4 years ago

I've used AWK many times, but I don't remember how it works until I poke at it.

jgstew commented 4 years ago

Could make an msitools autopkg install recipe, though for some reason on my system, the brew install didn't succeed 100% and I had to switch to the right folder to use it, so that is odd, not sure why.

jgstew commented 2 years ago

I think this issue is completed: https://github.com/autopkg/hansen-m-recipes/blob/master/SharedProcessors/MSIInfoVersionProvider.py

It would be helpful if that processor allowed an input variable to set the path to MSIInfo in case it is running on a platform other than MacOS. (Windows / Ubuntu) The default for the variable could be /usr/local/bin/msiinfo to maintain current functionality as-is.

rustymyers commented 2 years ago

Done! msi_path input variable made as backup for standard path to misinformed on macOS