Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if application running - InstallJammer

I am using InstallJammer for setup creation of my application. I want to check if the application is running before proceeding with uninstall procedure.

set program <%Company%><%AppName%>.exe
set pids [twapi::get_process_ids -name $program]
foreach pid $pids {
    catch {twapi::end_process $pid -force}
}

Above given is the TCL script I tried. But the script does not return any values. How to solve this.?

like image 933
Gapchoos Avatar asked Nov 03 '22 06:11

Gapchoos


1 Answers

I assume that you are using the execute script condition, while it might be easier to just use the script condition

If you use the script condition, just use the expr given by kostix:

[llength [twapi::get_process_ids -name <%Company%><%AppName%>.exe]] > 0

If you really have to use the execute script condition, then just wrap everyting in expr { and } and you get the same result as the script condition (Or: a script condition is just a execute script condition with expr { at the beginning and } at the end).

expr {[llength [twapi::get_process_ids -name <%Company%><%AppName%>.exe]] > 0}
like image 184
Johannes Kuhn Avatar answered Nov 08 '22 11:11

Johannes Kuhn