Revert deletion of "extractAppPath" helper function from samples.