Electron - Run & Make Windows App - Appstudio 8

Hi Guys,

Could there be a little feature - on deploy you have deployment switches like.

#ELECTRON-WINDOWS
// Code placed in here that would on be run if delployed Windows…
#END-ELECTRON

e.g. #ELECTRON-MACOS, #ELECTRON-WINDOWS etc.

What do you think?

Kind regards

Ian.

1 Like

You can do this now:

if (NSB.electron) {
  // Code placed in here that would on be run if deployed via Electron
}

Once you have checked that you are running Electron, you can get the OS in the process.platform property:

if (NSB.electron) {
  if (process.platform === "win32") {
    // Electron Windows
  }
  if (process.platform === "darwin") {
    // Electron MacOS
  }
}
1 Like