简体   繁体   中英

NSIS - 3rd party application version check

Well my installer installs some 3rd party msi installer silently. Now currently I'm checking the existing version by registry read method of Uninstall key (SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall{GUID}). But this leads to some problem like each time the company giving me a new updated installer, I need to change this GUID.

And yes, I cannot rely on the 3rd party company's installer upgrade method as sometimes their msi gets screwed up, so need to check for the upgrade scope manually.

Now one way to overcome this, reading the version number of that 3rd party installed files and take decision accordingly.

Is there any other way that anyone can point me?

NSIS has a function GetFileVersion that may help you. Just pass it one of the executable files from the third party files. Here is my example:

${GetFileVersion} "$UserDir\thirdParty.exe" $CurrentVersionString
StrCpy $CurrentVersion $CurrentVersionString
DetailPrint "The Current version is: $CurrentVersion"

This will work provided the third party software properly versions their executables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM