Help with waiting while a process is running
I took your script and changed


Changed the PID assignment to pgrep
Changed -o s= to -o stat= for ps
Removed the unnecessary ; at the end of some lines


It's a bit hard to test, but something like

#!/bin/bash
PROCESS="Installer"
PID=$(pgrep "$PROCESS")
while s=`ps -p $PID -o stat=` &amp;&amp; [[ "$s" &amp;&amp; "$s" != 'Z' ]]; do
    echo "$PROCESS is running, waiting for it to terminate"
    sleep 1
done
echo "$PROCESS is not running anymore"
SCRIPT HERE


should work.

If you are not worried about the Installer getting into Zombie state you could rely on the fact that ps exits with 1 if no process is found, and significantly simplify the loop condition.