[RESOLVED] Chrome package improvement
Published: February 27, 2020 - 9:55 PM
Hi,
I found the method of installing Chrome in `update_package()` to get its version number rather cumbersome and sometimes failing until I restarted my VM. I found this alternative. The goal is to extract the "Comments" field from the MSI package, which contains the version number. I haven't found a clean way to extract it, but it works using `findstr`.
and a little further on
The code can probably be improved to be native Python, but it gives you an idea.
I found the method of installing Chrome in `update_package()` to get its version number rather cumbersome and sometimes failing until I restarted my VM. I found this alternative. The goal is to extract the "Comments" field from the MSI package, which contains the version number. I haven't found a clean way to extract it, but it works using `findstr`.
Code: Select all
run('for /f %a in (\'findstr "Copyright" "GoogleChromeStandaloneEnterprise64-fr.msi" ^|find "Copyright"\') do echo %a > version_chrome')
with open("version_chrome") as f:
version_chrome = f.read()Code: Select all
pe.version = version_chrome.strip() + '-0'