Page 1 of 1

Check for Process

Posted: Wed Jul 01, 2015 3:06 pm
by kurtkroeker
Hello,

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:

Code: Select all

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?

Many thanks,

Kurt Kroeker

Re: Check for Process

Posted: Thu Jul 02, 2015 12:50 pm
by FrancescoT
Dear Kurt,

did you verify if the process name is correct?

For example, recent versions of Internet Explorer have "iexplorer.exe" as process name.

you can check the names of the running processes from Task Manager (CTRL+ALT+DEL), then enter the same name with command.

Hope this helps you.

Regards

Re: Check for Process

Posted: Thu Jul 02, 2015 3:54 pm
by kurtkroeker
Hi Francesco,

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:

Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
746 40 40248 74240 458 1.48 15356 EXCEL

When I run the same command with -FileVersionInfo, I get this:

ProductVersion FileVersion FileName
-------------- ----------- --------
15.0.4727.1000 15.0.4727.1000 C:\Program Files\Microsoft Office\Office15\EXCEL.EXE

I expect ONE of those variants I posted above is the "right" input, but I've tried them all with the same result...

Re: Check for Process

Posted: Mon Jul 06, 2015 9:14 am
by kurtkroeker
I'm assuming the Check for Process command works for other people...Can anybody post a snippet for me that they know works?

Re: Check for Process

Posted: Mon Jul 06, 2015 10:49 am
by FrancescoT
Dear Kurt,

using the following code I am able to check for a "notepad" process and if this is running, it gets terminated.

Code: Select all

~InstallAware Clipboard Data~
~End~
~{0392201B-CD9E-4B96-8E1D-59F2517AF517}~
~MessageBox~
~{20C32E7C-F926-4703-881D-65EC7D539608}~
~~
~TASK_RESULT = $TASK_RESULT$~
~0~
~1~
~~
~Terminate Process~
~{A52E5DE5-A9BF-49AE-B8D5-6F935CBB1E28}~
~$PROCESS_NAME$~
~TASK_RESULT~
~If~
~{0CB66A66-36B1-4F08-A5DF-A2A959674CDE}~
~TASK_RESULT~
~0~
~TRUE~
~FALSE~
~Check Process~
~{061A48A6-1F3A-433B-BEB6-F263154082BF}~
~$PROCESS_NAME$~
~TASK_RESULT~
~Set Variable~
~{8DA0412C-20E8-47E5-B4A2-0FCB7B9C8389}~
~PROCESS_NAME$MYAH$MYAH$FALSE~
~notepad.exe~
~Set Variable~
~{268B95E2-CC8D-4C18-8C37-3588776DA9BA}~
~TASK_RESULT$MYAH$MYAH$FALSE~
~~


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.

Hope this helps you.

Regards

Re: Check for Process

Posted: Mon Jul 06, 2015 12:22 pm
by kurtkroeker
Thanks again, Francesco.

I tried your example but was unable to get it to work. Perhaps my environment has something to do with it?

Windows 8.1 Pro 64-bit
InstallAware Studio
InstallAware X2 (Build 4.03.15)
I do not have Admin privileges

Attached are my testing results from the example.

EDIT: The attachment appears to have not come through. Here's a link to the screenshot: https://drive.google.com/file/d/0Bzczgm ... sp=sharing

Re: Check for Process

Posted: Mon Jul 06, 2015 12:30 pm
by FrancescoT
Dear Kurt,

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).

Regards

Re: Check for Process

Posted: Fri Jul 17, 2015 12:00 pm
by kurtkroeker
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.

Thanks very much for your help, Francesco!