Module: main
Table of contents
Functions
Functions
main
▸ main(): Promise
<void
>
Initializes the application by determining its current state based on version and setup status. It awaits Electron's readiness before proceeding with either launching the main application window or initiating the installer process, based on whether the application is up-to-date and fully set up. In production environments, it also ensures that the default application menu is removed for a cleaner UI.
The function performs the following checks and actions:
- Retrieves the last known app version and status from
appSettingsStore
. - Compares the current app version with the stored version to determine if an update is needed.
- Checks if the application's setup status is marked as completed.
- If the app is up-to-date and ready, it directly opens the main application window.
- Otherwise, it updates the app settings to reflect the ongoing setup process and opens the installer window.
- Optionally, after the installer window is closed, it transitions to opening the main application window.
- In production mode, it removes the default application menu to align with the custom UI design.
Returns
Promise
<void
>