Wow! An answer anyone can understand
For windows. When you put your mouse over the application in the task bar you should get a window name. If not, find the window name. Use this function and it should close the application. I did it with the onInit because I wanted to close the application before the re-installed.
FindWindow $0 "" "Window Name"
IntCmp $0 0 done
SendMessage $0 16 0 0