GetFileVersion for MSI

  • Print

Indigo Rose products feature the MSI.GetFileVersion() Lua action to retrieve the Version and Language from PE files (*.exe and *.dll). However, if you may want to know these strings of a MSI package (*.msi), you can use this Lua code below:

 
info = {};
nPackageHandle = MSI.OpenPackage("setup.msi");
error = Application.GetLastError();
if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
    info.Version = MSI.GetProductProperty(nPackageHandle, "ProductVersion");
    info.Language = MSI.GetProductProperty(nPackageHandle, "ProductLanguage");
  -- display the Version and Language strings in the debug window
    Debug.ShowWindow();
    Debug.Print("MSI Version: " .. info.Version .. "\r\n");
    Debug.Print("MSI Language: " .. info.Language .. "\r\n");
end
 
 

Add a comment (For questions, please use the contact form!)

Security code
Refresh

Our Plugins & Examples Feed

  • Dependency module for Setup Factory: Visual C/C++ 2010 SP1

    New dependency modules to add runtime support for applications developed with Microsoft Visual C/C++ 2010...

  • LuaFileSystem 1.5.0 for AutoPlay Media Studio 8

    LuaFileSystem is a Lua library developed to complement the set of functions related to...

Subscribe now!

Do you need help?

clockWe provide customer support for Indigo Rose software development products since 2008!
Please contact us if you need assistance for designing, debugging, or finishing your project on time.