主题:  请问如何自动判断并安装AVI的视频的code

ideagot

职务:普通成员
等级:1
金币:0.0
发贴:4
注册:2003/5/30 13:16:53
#12004/3/18 11:47:49
请问如何自动判断并安装AVI的视频的code
director中调用了avi,我使用了mpeg4的code
客户机器上没有安装这种code,如何让光盘在自动运行的时候自动判断并安装AVI的视频的code。
高人请指教啊!



我是小马

职务:普通成员
等级:3
金币:17.0
发贴:794
注册:2000/11/13 14:56:59
#22004/3/20 1:28:42
可以使用Buddy api xtra来检索注册表,看看是否安装了Mpeg4,当然前提是你知道Mpeg 的code在注册表中的安装位置!


至于用buddy api xtra的使用方法,我以acdsee和adobe公司的acrobat reader为例来说明:

读取注册表的函数,用baReadRegString( KeyName, valueName, Default, Branch )函数
  四个参数均为string类型,下面是它们的一些说明,这些你都可以在buddy api的帮助文件中查到!
KeyName is the name of the key.
valueName is the name of the value. Under 16 bit, this value is ignored.
Default is the string that is returned if the key/value doesn't exist.
Branch is the branch of the registry to use. Can be one of the following:
"HKEY_CLASSES_ROOT"
"HKEY_CURRENT_USER"
"HKEY_LOCAL_MACHINE"
"HKEY_USERS"
"HKEY_CURRENT_USER"
"HKEY_DYN_DATA"

比如我们要读取acdsee的安装路径,那么语句应该这么写:

baReadRegString( "software\microsoft\windows\currentversion\app paths\acdsee.exe", "path", "error", "HKEY_LOCAL_MACHINE" )

要读取acrobat reader的安装路径,可以这么写:
baReadRegString( "software\microsoft\windows\currentversion\app paths\AcroRd32.exe", "path", "error", "HKEY_LOCAL_MACHINE" )

也可以这么写:
baReadRegString( "software\adobe\acrobat reader\5.0\Installpath", "", "error", "HKEY_LOCAL_MACHINE" )