Corporate executives worried about workplace shootings are quietly installing gunfire-detection systems in U.S. offices and factories. Most don’t tell employees what the sensors are, for fear of alarming them.

The rapid uptick in adoption of gunshot sensors follows a wave of workplace shootings in the past year. The latest occurred Friday when a man opened fire at an Aurora, Ill., factory following his termination, killing five co-workers and injuring five police officers. Deadly incidents in recent months include shootings...