Apparatus and method for activating a device in a well, such as firing a perforating gun in a well. An electrically-activated firing system is coupled to an actuating assembly, which includes a release piston movable by fluid pressure, a firing pin, and a frangible element connected to hold the release piston in place, the frangible element being shattered in response to electrical activation of the firing system. A locking mechanism locks the firing pin to prevent movement of the firing pin, and the release piston is connected to release the locking mechanism if a minimum amount of fluid pressure is applied to the release piston after electrical activation of the firing system. A detonating assembly is connected to the perforating gun and is activable by the firing pin. The detonating assembly is activated when the firing pin is released by the locking mechanism to impact the detonating assembly.