I'm working with InstallAware Studio and I'm attempting to check to see if Excel is running, and if it is, to close it. I'm using your Check for Process command to do so, and I'm referring to your documentation found here: http://www.installaware.com/FlashHelp/checkprocess.htm.
However, I'm unable to reproduce your example using Windows Explorer. Here's my code:
Comment: Check to see if Excel is open or not
Set Variable excelIsOpen to True
Set Variable dialogResult to
Check for Process "excel.exe", get result into variable excelIsOpen
if Variable excelIsOpen Equals True
MessageBox: Close Excel, The installer has determined that Microsoft Excel is currently running and must be closed before continuing.$NEWLINE$$NEWLINE$Click OK to close Excel or Cancel to exit the installer.
if Variable dialogResult Equals OK
Terminate Program Excel
else
Terminate Installation
end
end
No matter what, I can't get excelIsOpen to be True. Is there a bug with Check for Process, or am I missing something else?
Thanks so much for your reply! Here's the info I have from Task Manager when Excel is open:
Name = "Microsoft Excel"
Process name = "EXCEL.EXE"
And when I expand the Microsoft Excel process, it shows one child with Name = "Excel".
I've tried the following for the Process Name (executable file) field in the Check Process dialog:
* excel
* EXCEL
* excel.exe
* EXCEL.exe
* Excel
* Microsoft Excel
...and none of them have worked. When I run Get-Process *excel* in PowerShell, I get this:
To make a simple test;
- create a new project from scratch using the "BLANK" project template
- copy the above code (in IA Clipboard Format) and paste it in the main script.
- Build the project and test on target machine where a notepad process is running.
the setup process has to be elevated otherwise you will be not able to detect notepad running ( expecially if notepad runs under a different user context).
Just to close the loop on this, it would seem that this solution isn't going to work for me since it's a requirement for my installer that the user NOT require Admin elevation to install the product.