如何检查已安装的组件? [英] How to check for installed compnents?
问题描述
我正在尝试在VS.NET中创建一个MSI,它将检查已安装的Office
系统组件 - 所以我的MDE只会在满足要求的情况下安装。
我正在考虑使用VBScript检查注册表项/值。任何人
之前在这条路上旅行?其他建议?
提前致谢。
I''m trying to create an MSI in VS.NET that will check for installed Office
System components - so my MDE will only install if requirements are met.
I''m thinking about using VBScript to inspect Registry keys/values. Anyone
travel this road before? Other suggestions?
Thanks in advance.
推荐答案
只是一个想法,但不能使用FileSearch对象吗?
-
HTH,
Don
=============================
使用我的***** @ Telus.Net 电子邮件
免责声明:
专业PartsPerson
业余数据库程序员{:o)
我是Access97用户,所以所有发布的代码
样品也是基于Access97的
除非另有说明。
Do SinksIn = True
文件/保存,< slam手指放在书桌抽屉里>
循环
======================== ========
" deko" <德***** @ hotmail.com>在消息中写道
新闻:PT ******************* @ newssvr25.news.prodigy。 com ...
Hi,
Just an idea, but couldn''t this be done using the FileSearch Object?
--
HTH,
Don
=============================
Use My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)
I''m an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.
Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop
================================
"deko" <de*****@hotmail.com> wrote in message
news:PT*******************@newssvr25.news.prodigy. com...
我正在尝试在VS.NET中创建一个MSI来检查已安装的Office
系统组件 - 所以我的MDE只会在满足要求的情况下安装。<我正在考虑使用VBScript检查注册表项/值。有没有人之前在这条路上旅行?其他建议?
提前致谢。
I''m trying to create an MSI in VS.NET that will check for installed Office
System components - so my MDE will only install if requirements are met.
I''m thinking about using VBScript to inspect Registry keys/values. Anyone
travel this road before? Other suggestions?
Thanks in advance.
>只是一个想法,但是不能使用FileSearch对象吗?
我试过这个:
公共函数CheckComponents()作为布尔值
On Error GoTo HandleErr
Dim varExe As Variant
CheckComponents = False
For each varExe In Array (WINWORD.EXE,OUTLOOK.EXE,EXCEL.EXE)
使用Application.FileSearch
.NewSearch
.LookIn =" C:\Program Files\Microsoft Office \ OFFICE11 \"
.SearchSubFolders = False
.Filename = varExe
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
CheckComponents = IIf(.Execute(),True,False)
结束
如果CheckComponents = False那么
MsgBox varExe& "这个申请需要
正常运作。
退出
结束如果
下一步
退出功能
但是它非常*很慢。尽管如此,从应用程序内部检查已安装组件
的想法,而不是安装例程,可能是一个
选项...
> Just an idea, but couldn''t this be done using the FileSearch Object?
I tried this:
Public Function CheckComponents() As Boolean
On Error GoTo HandleErr
Dim varExe As Variant
CheckComponents = False
For Each varExe In Array("WINWORD.EXE", "OUTLOOK.EXE", "EXCEL.EXE")
With Application.FileSearch
.NewSearch
.LookIn = "C:\Program Files\Microsoft Office\OFFICE11\"
.SearchSubFolders = False
.Filename = varExe
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
CheckComponents = IIf(.Execute(), True, False)
End With
If CheckComponents = False Then
MsgBox varExe & " is required for for this application to
function properly."
Exit For
End If
Next
Exit Function
But it''s *very* slow. Still, the idea of checking for installed components
from within the app, rather than with an install routine, may be an
option...
deko写道:
deko wrote:
只是一个想法,但不能这样做使用FileSearch对象?
Just an idea, but couldn''t this be done using the FileSearch Object?
我试过这个:
Public Function CheckComponents()As Boolean
On Error GoTo HandleErr
Dim varExe As Variant
CheckComponents = False
对于每个varExe In Array(WINWORD.EXE,OUTLOOK.EXE,EXCEL.EXE)
使用Application.FileSearch
.NewSearch
.LookIn =" C:\Program Files\Microsoft Office \OFFICE11 \"
.SearchSubFolders = False
.Filename = varExe
.MatchTextExactly = True
.FileType = msoFileTypeAllFi les
CheckComponents = IIf(.Execute(),True,False)
结束
如果CheckComponents = False那么
MsgBox varExe& "这个应用程序需要正常运行。
退出
结束如果
下一页
退出功能
但它' '非常*很慢。尽管如此,从应用程序内部检查已安装组件的想法,而不是安装例程,可能是一个
选项...
I tried this:
Public Function CheckComponents() As Boolean
On Error GoTo HandleErr
Dim varExe As Variant
CheckComponents = False
For Each varExe In Array("WINWORD.EXE", "OUTLOOK.EXE", "EXCEL.EXE")
With Application.FileSearch
.NewSearch
.LookIn = "C:\Program Files\Microsoft Office\OFFICE11\"
.SearchSubFolders = False
.Filename = varExe
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
CheckComponents = IIf(.Execute(), True, False)
End With
If CheckComponents = False Then
MsgBox varExe & " is required for for this application to
function properly."
Exit For
End If
Next
Exit Function
But it''s *very* slow. Still, the idea of checking for installed components
from within the app, rather than with an install routine, may be an
option...
我把你的计时器功能类似于我修改过的
版本中的一个:
函数CheckComps()
Dim varExe As Variant
Dim sngStart As Single
sngStart =计时器
CheckComps = False
For Each varExe In Array(WINWORD.EXE,OUTLOOK.EXE,EXCEL.EXE)
CheckComps = Len(Dir
I put a timer function in yours similar to the one in my modified
version below:
Function CheckComps()
Dim varExe As Variant
Dim sngStart As Single
sngStart = Timer
CheckComps = False
For Each varExe In Array("WINWORD.EXE", "OUTLOOK.EXE", "EXCEL.EXE")
CheckComps = Len(Dir
这篇关于如何检查已安装的组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!