Auto launch to system tray on system startup - Electron + Ionic app

First time working on an electron desktop application using Ionic capacitor + electron and I am having issues with the auto launching to system tray functionality. What I need is to auto launch the app upon system startup like Slack or Skype in the system tray and not as a window.

I tried the auto-launch package but even after setting the property ‘isHidden: true’ the window shows up on startup.

//Adding auto-launch feature
  let autoLaunch = new AutoLaunch({
    name: 'App',
    path: app.getPath('exe'),
    isHidden: true
  });

  autoLaunch.enable();

autoLaunch.isEnabled()
.then(function(isEnabled){
    if(isEnabled){
        return;
    }
    autoLaunch.enable();
})
.catch(function(err){
    // handle error
}); 

Then I included the autolaunch with the app.setLoginItemSettings instead with openAsHidden attribute which also did not work and the window showed up on system launch:

app.setLoginItemSettings({
    openAtLogin: true,
    path: updateExe,
    openAsHidden : true,
    args: [
    '--processStart', `"${exeName}"`,
    '--process-start-args', `"--hidden"`
  ]
  })

I then replaced show() with hide() instead at dom ready which pushed the app to system tray on startup, but now the issue is that upon clicking the application file its hidden and I can only open it through system tray. I am looking for a solution that will open the app upon clicking the application file but on startup it should auto launch to the system tray. Similar behavior to slack or skype apps.

I generated the app file using electron-packager.

Windows version : Windows 10

Understood that the openAsHidden attribute of app.setLoginItemSettings work only with MAC. Then how does electron built apps like Slack startup hidden on windows? Which method do they use? Or is there a way with which I can determine if the app is opened by system startup or by the user, so I can use the windows.hide() and windows.show() accordingly with dom-ready event.