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. 32 5135
Hi,
Just an idea, but couldn't this be done using the FileSearch Object?
--
HTH,
Don
=============== ==============
Use My*****@Telus.N et 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*****@hotmai l.com> wrote in message
news:PT******** ***********@new ssvr25.news.pro digy.com... 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.
> 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.EX E", "EXCEL.EXE" )
With Application.Fil eSearch
.NewSearch
.LookIn = "C:\Program Files\Microsoft Office\OFFICE11 \"
.SearchSubFolde rs = False
.Filename = varExe
.MatchTextExact ly = True
.FileType = msoFileTypeAllF iles
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 wrote: 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.EX E", "EXCEL.EXE" ) With Application.Fil eSearch .NewSearch .LookIn = "C:\Program Files\Microsoft Office\OFFICE11 \" .SearchSubFolde rs = False .Filename = varExe .MatchTextExact ly = True .FileType = msoFileTypeAllF iles 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...
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.EX E", "EXCEL.EXE" )
CheckComps = Len(Dir$("C:\Pr ogram Files\Microsoft
Office\OFFICE10 \" & varExe)) > 0
If CheckComps = False Then
MsgBox varExe & " is required for for this application to
function properly."
Exit For
End If
Next
Debug.Print "CheckComps done " & Timer - sngStart
End Function
The result:
CheckComponants done 0.1875
CheckComponants done 0.1875
CheckComponants done 0.203125
CheckComponants done 0.1875
CheckComponants done 0.203125
CheckComps done 0
CheckComps done 0
CheckComps done 0
CheckComps done 0
Good old Dir$()
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
I realise these are first attempts but both are flwed to some extent as the
Office folder path is hardcoded.
If on the other hand you check the registry at
HKLM\Software\M icrosoft\Office \{version}\{app lication}\Insta llRoot\Path
Where
{version} is 8.0, 9.0, 10.0 etc.
{application} is Word, Outlook or Excel
This will tell you where the exe should be installed.
--
Terry Kreft
MVP Microsoft Access
"Trevor Best" <nospam@localho st> wrote in message
news:40******** *************** @auth.uk.news.e asynet.net... deko wrote:
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.EX E", "EXCEL.EXE" ) With Application.Fil eSearch .NewSearch .LookIn = "C:\Program Files\Microsoft Office\OFFICE11 \" .SearchSubFolde rs = False .Filename = varExe .MatchTextExact ly = True .FileType = msoFileTypeAllF iles 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...
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.EX E", "EXCEL.EXE" ) CheckComps = Len(Dir$("C:\Pr ogram Files\Microsoft Office\OFFICE10 \" & varExe)) > 0 If CheckComps = False Then MsgBox varExe & " is required for for this application to function properly." Exit For End If Next Debug.Print "CheckComps done " & Timer - sngStart
End Function
The result: CheckComponants done 0.1875 CheckComponants done 0.1875 CheckComponants done 0.203125 CheckComponants done 0.1875 CheckComponants done 0.203125 CheckComps done 0 CheckComps done 0 CheckComps done 0 CheckComps done 0
Good old Dir$()
-- Error reading sig - A)bort R)etry I)nfluence with large hammer
> If on the other hand you check the registry at
HKLM\Software\M icrosoft\Office \{version}\{app lication}\Insta llRoot\Path Where {version} is 8.0, 9.0, 10.0 etc. {application} is Word, Outlook or Excel
This will tell you where the exe should be installed.
Good suggestion. What I really want to do is prevent installation of the
MDE if any of the Office programs are missing. If the MDE installs without
the other programs, the result is Missing References and ugly errors.
I've successfully created a basic MSI, and have a VBScript that checks those
registry locations - on the assumption the component is installed if the
InstallRoot\Pat h Key is not null, but getting the script into a Custom
Action in the Installer has been a real time suck. I'm new to creating
MSI's - but my version of Visual Studio can create them and that's what I've
been using. If I could figure out the Installer I'd be all set.
Terry Kreft wrote: I realise these are first attempts but both are flwed to some extent as the Office folder path is hardcoded.
I don't try to be too clever when writing aircode or modifying someone
elses code for usenet purposes, had I been writing this in a real app I
would have used SysCmd(acSysCmd AccessDir), a bit easier than snooping
around the registry :-)
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
> would have used SysCmd(acSysCmd AccessDir), a bit easier than snooping around the registry :-)
I came up with this, but in testing it never ran - I just got the "Missing
Reference" errors. The start up form never had a chance to open. Oh well,
back to the Installer...
Anyway, thanks for the help.
Public Function CheckComponents () As Boolean
Dim varExe As Variant
Dim strApp As String
Dim blnQuit As Boolean
blnQuit = False
For Each varExe In Array("WINWORD. EXE", "OUTLOOK.EX E", "EXCEL.EXE" )
CheckComponents = Len(Dir$(SysCmd (acSysCmdAccess Dir) & varExe)) > 0
If CheckComponents = False Then
blnQuit = True
Select Case varExe
Case "WINWORD.EX E"
strApp = "Word"
Case "OUTLOOK.EX E"
strApp = "Access"
Case "EXCEL.EXE"
strApp = "Excel"
End Select
MsgBox "Microsoft " & strApp & " is required for for this " & _
"applicatio n to function properly.", vbCritical, " Microsoft " &
strApp & " Not Found"
End If
Next
If blnQuit Then DoCmd.Quit
Exit Function
deko wrote: would have used SysCmd(acSysCmd AccessDir), a bit easier than snooping around the registry :-)
I came up with this, but in testing it never ran - I just got the "Missing Reference" errors. The start up form never had a chance to open. Oh well, back to the Installer...
Anyway, thanks for the help.
That's because you're using early binding still, you will need to
uncheck the references and use late binding (use early binding for
development to get intellisense, etc), then for example change:
Dim wb as new excel.workbook
wb.dosomthing
to
dim wb as object
set wb=createobject ("excel.workboo k")
wb.dosomthing
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
"Terry Kreft" <te*********@mp s.co.uk> wrote in
news:7d******** ************@ka roo.co.uk: I realise these are first attempts but both are flwed to some extent as the Office folder path is hardcoded.
If on the other hand you check the registry at HKLM\Software\M icrosoft\Office \{version}\{app lication}\Insta llR oot\Path
Where {version} is 8.0, 9.0, 10.0 etc. {application} is Word, Outlook or Excel
This will tell you where the exe should be installed.
Note that Access itself does not follow the same rules.
A97 uses:
HKEY_LOCAL_MACH INE, "SOFTWARE\Micro soft\Office\8.0 \OfficeBin\Path
A2K uses:
HKEY_LOCAL_MACH INE,
"SOFTWARE\Micro soft\Office\8.0 \Access\Install Root\Path
OR
HKEY_LOCAL_MACH INE,
"SOFTWARE\Micro soft\Office\8.0 \Common\Install Root\Path
It's a pain. A real pain.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: deko |
last post by:
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.
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |