We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

atanc
Posts: 7
Joined: Thu Apr 23, 2020 12:21 am

Check version of file in MSI using VBScript

Hi,

I need to check the version of a file included in an MSI package that is being run, but am unsure on how to go about this. I have a "Launch attached file" custom action that runs a VBscript, which I think I can also use for this purpose? If so, how do I read the file version of a specific file within the msi? Are there any VBscript samples showing how to do this?

Thanks in advance,
Anthony
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Check version of file in MSI using VBScript

Hello Anthony and welcome to Advanced Installer forums,

As the MSI file is basically a database, you can open it and get the required information from it. In this case, you may want to look at the "File" table. The "File" table contains all the files and also their "Version" attribute.

Basically, what you need to do here is open the MSI database, access the "File" table and get the "Version" attribute for your file.

Unfortunately, we do not have a how-to for this (using VBScript).

However, my colleague Dan created a similar How-To by using a C# custom action:

MSI Open Database to get list of file paths to the installed files in a custom dll

There you can also find a sample project for it and also the .SLN file for the custom action, so you can inspect its' code.

In what regards VBScript, I am pretty sure you can find plenty of sample projects on the internet on how to do this.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
atanc
Posts: 7
Joined: Thu Apr 23, 2020 12:21 am

Re: Check version of file in MSI using VBScript

Thanks Catalin, as long as I know Im on the right path by doing this via a Custom action script, I'm good to go.

Appreciate your help

Cheers,
Anthony
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Check version of file in MSI using VBScript

You are always welcome, Anthony!

I am really glad I could help.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”