Retrieving version of an MSI file (built with WiX)

后端 未结 3 960
刺人心
刺人心 2020-12-16 23:06

I\'ve created an MSI file with WiX. The source WiX file contains the version information like this:



        
3条回答
  •  春和景丽
    2020-12-16 23:19

    Found a solution: instead of calling MsiGetFileVersion(), call:

    MSIHANDLE hProduct = NULL;
    MsiOpenPackage( pszPath, &hProduct );
    
    MsiGetProductProperty( hProduct, _T("ProductVersion"), pszVersion, &dwSizeVersion );
    
    MsiCloseHandle( hProduct );
    

    (error handling omitted)

提交回复
热议问题