Closed rustymyers closed 2 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"
I ran this: brew install msitools
and now homebrew is updating, and wow my CPU is really going wild.
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:
Also, good job finding https://wiki.gnome.org/msitools ... it does exactly what is needed. I wish I knew about it previously.
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!!
I've used AWK many times, but I don't remember how it works until I poke at it.
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.
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.
Done! msi_path input variable made as backup for standard path to misinformed on macOS
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:
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...
Other options may be to use a different tool. msitools (https://wiki.gnome.org/msitools) installs on Catalina with:
Then the following command can find the version:
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.