UE4 Initialize, UE4 Update, UE4 Shutdown -code to run in editor and standalone game?

Hey Guys,

I’ve been building some code that i would want to run in Editor, Editor game mode, and Standalone game mode (Cooked). Would the best way to do this without having multiple code paths for different interaction modes (e.g In editor, Game mode etc) to add my code initialization, update, shutdown into where UE4 initializes, Updates, and Shuts down.

Where does UE4 as standard control UE4 Initialization, UE4 Update, UE4 Shutdown?

Cheers

James