#22002/10/27 13:28:04
fileexists()是一个函数,IniFile是其参数,这个函数的作用是检测IniFile是否存在,是则返回1。
如果只是检测Quicktime的话,可以使用quickTimeVersion()
if quickTimeVersion() < 3.0 then
open "tt.exe"
else
open "ww.exe"
end if
要检测用户机器中是否安装必要的软件,比较好的方法是读用户的注册表。由于在Director没有直接对注册表进行操作的指令,所以我们只能借助第三方插件buddyapi xtra。
下面我以acdsee和adobe公司的acrobat reader为例来说明:
读取注册表的函数,用buddy api 插件的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\apppaths\acdsee.exe","path","error", "HKEY_LOCAL_MACHINE" )
要读取acrobat reader的安装路径,可以这么写:
baReadRegString("software\microsoft\windows\currentversion\apppaths\AcroRd32.exe","path","error", "HKEY_LOCAL_MACHINE" )