getLoginItemSettings
If you provided path and args options to app.setLoginItemSettings, then you need to pass the same arguments here for openAtLogin to be set correctly.
openAtLoginboolean -trueif the app is set to open at login.openAsHiddenboolean macOS Deprecated -trueif the app is set to open as hidden at login. This does not work on macOS 13 and up.wasOpenedAtLoginboolean macOS -trueif the app was opened at login automatically.wasOpenedAsHiddenboolean macOS Deprecated -trueif the app was opened as a hidden login item. This indicates that the app should not open any windows at startup. This setting is not available on MAS builds or on macOS 13 and up.restoreStateboolean macOS Deprecated -trueif the app was opened as a login item that should restore the state from the previous session. This indicates that the app should restore the windows that were open the last time the app was closed. This setting is not available on MAS builds or on macOS 13 and up.statusstring macOS - can be one ofnot-registered,enabled,requires-approval, ornot-found.executableWillLaunchAtLoginboolean Windows -trueif app is set to open at login and its run key is not deactivated. This differs fromopenAtLoginas it ignores theargsoption, this property will be true if the given executable would be launched at login with any arguments.launchItemsObject[] Windowsnamestring Windows - name value of a registry entry.pathstring Windows - The executable to an app that corresponds to a registry entry.argsstring[] Windows - the command-line arguments to pass to the executable.scopestring Windows - one ofuserormachine. Indicates whether the registry entry is underHKEY_CURRENT USERorHKEY_LOCAL_MACHINE.enabledboolean Windows -trueif the app registry key is startup approved and therefore shows asenabledin Task Manager and Windows settings.