Creates the main application window and registers IPC listeners.
Sets up the preload script, window options, and loads the appropriate URL or file depending on environment.
Creates the main application window and registers IPC listeners.