Check to see if Outlook is running

  • Thread starter Thread starter Michael Tissington
  • Start date Start date
M

Michael Tissington

I have an install which should only run if Outlook and Word are not running.

How can I check to see if Outlook or Word are running ?

How can I create a prompt in my install to ask the user to close Outlook or
Word

Thanks.
 
You'll need to create a custom action. I don't know if this is
feasible in VBscript. I use one in C++ stored in an external DLL. It's
not straightforward, as our code has to run on very old OSs and the
procedure is different on NT and 9x. We also have to detect processes
rather than applications.

You might be able to get away with using the wscript.shell object's
AppActivate() method and checking the return value.
 
There was a disscussion about this is vsnet.setup (See Detect Outlook.... in
that group). This kind of code (VBScript)

Set myOlApp = CreateObject("Outlook.Application")
Set myExplorer = myOlApp.ActiveExplorer
If TypeName(myExplorer) = "Nothing" Then
msgbox "nothing"
else
msgbox "something"
End If

tells you if Outlook is installed (the createobject) and if it's running
showing a UI (the "something" result). But it wasn't working in a custom
action and that wasn't resolved. You can use this before you launch the
setup. The alternative is to see if it's installed and then just look for a
process called Outlook.exe.
 
I'm using c++, what api do I look for a process called outlook.exe

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com


Phil Wilson said:
There was a disscussion about this is vsnet.setup (See Detect Outlook.... in
that group). This kind of code (VBScript)

Set myOlApp = CreateObject("Outlook.Application")
Set myExplorer = myOlApp.ActiveExplorer
If TypeName(myExplorer) = "Nothing" Then
msgbox "nothing"
else
msgbox "something"
End If

tells you if Outlook is installed (the createobject) and if it's running
showing a UI (the "something" result). But it wasn't working in a custom
action and that wasn't resolved. You can use this before you launch the
setup. The alternative is to see if it's installed and then just look for a
process called Outlook.exe.
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/qid=1088088624

Michael Tissington said:
I have an install which should only run if Outlook and Word are not running.

How can I check to see if Outlook or Word are running ?

How can I create a prompt in my install to ask the user to close Outlook or
Word

Thanks.
 
Depends on the operating system, but this article is the one you need:

http://support.microsoft.com/default.aspx?scid=kb;en-us;175030
--
Phil Wilson [MVP Windows Installer]
----
Michael Tissington said:
I'm using c++, what api do I look for a process called outlook.exe

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com


Phil Wilson said:
There was a disscussion about this is vsnet.setup (See Detect
Outlook....
in
that group). This kind of code (VBScript)

Set myOlApp = CreateObject("Outlook.Application")
Set myExplorer = myOlApp.ActiveExplorer
If TypeName(myExplorer) = "Nothing" Then
msgbox "nothing"
else
msgbox "something"
End If

tells you if Outlook is installed (the createobject) and if it's running
showing a UI (the "something" result). But it wasn't working in a custom
action and that wasn't resolved. You can use this before you launch the
setup. The alternative is to see if it's installed and then just look
for
a
process called Outlook.exe.
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/qid=1088088624

Michael Tissington said:
I have an install which should only run if Outlook and Word are not running.

How can I check to see if Outlook or Word are running ?

How can I create a prompt in my install to ask the user to close
Outlook
or
Word

Thanks.
 
Thanks, just what I was looking for.

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com


Phil Wilson said:
Depends on the operating system, but this article is the one you need:

http://support.microsoft.com/default.aspx?scid=kb;en-us;175030
--
Phil Wilson [MVP Windows Installer]
----
Michael Tissington said:
I'm using c++, what api do I look for a process called outlook.exe

--
Michael Tissington
http://www.oaklodge.com
http://www.tabtag.com


Phil Wilson said:
There was a disscussion about this is vsnet.setup (See Detect
Outlook....
in
that group). This kind of code (VBScript)

Set myOlApp = CreateObject("Outlook.Application")
Set myExplorer = myOlApp.ActiveExplorer
If TypeName(myExplorer) = "Nothing" Then
msgbox "nothing"
else
msgbox "something"
End If

tells you if Outlook is installed (the createobject) and if it's running
showing a UI (the "something" result). But it wasn't working in a custom
action and that wasn't resolved. You can use this before you launch the
setup. The alternative is to see if it's installed and then just look
for
a
process called Outlook.exe.
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.amazon.com/exec/obidos/tg/detail/-/1590592972/qid=1088088624

I have an install which should only run if Outlook and Word are not
running.

How can I check to see if Outlook or Word are running ?

How can I create a prompt in my install to ask the user to close Outlook
or
Word

Thanks.
 
Asking the user to manually close Outlook/WinWord is not very
professional and also will not work. To see why, close Outlook now on
your PC and you will see that it takes quite some time for the process
to actually die after the window is no longer visible. A programmatic
approach is essential here.

I work for a company called AutoUpdate+ which does automatic
updating/upgrading software, so the ability to kill a process is also
essential to us. Trust me when I say this is not a simple task,
particularly as there're slight differences between WinNT and other
Windows systems. The relevant APIs you need are
CreateToolhelp32Snapshot, Process32First, Process32Next and
ZwQuerySystemInformation (for NT4). It's easier if you choose not to
support NT4! Feel free to email simon AT autoupdateplus.com for more
info.

Simon Hayden
www.AutoUpdatePlus.com
Get software updates to your clients the Quick and Easy way!

 
Back
Top