How do I use MsiGetProductInfo to get installed version number c# winforms 4.0? -


i'm trying installed version number of win fomrs application using msigetproductinfo function. try alter code found on post, wing ding looking text when alter call function so

msigetproductinfo("{9806c9be-59d4-4dee-802f-0e492023de8a}", "installproperty_versionstring", builder, ref len); 

its 4.0 c# winforms project installed standard vs2010 setup project. client machines win 7 , win xp

have checked return value of function? if returns error, it's possible buffer filled garbage.

this list of possible returns, msdn page here

return value

error_bad_configuration configuration data corrupt.

error_invalid_parameter invalid parameter passed function.

error_more_data buffer small hold requested data.

error_success function completed successfully.

error_unknown_product product unadvertised or uninstalled.

error_unknown_property property unrecognized.

note msigetproductinfo function returns error_unknown_property if application being queried advertised , not installed.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -