Windows Exe Version - Generated with 8.5.5.1 - exe fails to start

Dear Team:

I hav just installed AppStudio 8.5.5.1 - and created a new exe fro my app. However it does not load. I’ve attached a screen shot of the errors from chrome debug.

The App runs fine in Desktop Browser.

Thank you.

Ian.

Are you building the exe using Electron or VoltBuilder?

Using Electron “Make Destktop App for Distribution using Electron”

Try deleting the Electron folder in your project directory. Does that help?

Done that…still the same errors in Chrome Debug…

Sorry…

I tried a simple new project with just a Bootstrap button. It worked fine. I’m trying to figure out of the problem is specific to your project.

Can you zip your project folder and send it to me? Alternatively, let me know what happens on your system with a Bootstrap button project.

Managed to resolve it…

The Electron and NPM version have changed from

  "devDependencies": {
    "electron": "^7.1.0",
    "electron-builder": "^22.0.0",
    "npm": "^6.13.0"
  },

to

 "devDependencies": {
    "electron": "^12.0.5",
    "electron-builder": "^22.10.5",
    "npm": "^7.11.1"
  },

Got other issues as the global npm/electron ‘process’ object no longer defined so need check all my code that has npm/electron specific stuff.

Ian.

So this code will not run now…

    if ((NSB.electron)) {
        if ((process.platform === "win32") || (process.platform === "darwin")) {
            NSB.MsgBox("Exit");
        };
    }

Uncaught ReferenceError process is not defined.

Issues with the original message centre around the latest version of electron and the contextIsolation property used on webPreferences

 webPreferences: { nodeIntegration: true,
      contextIsolation: true}
  })

by default the contextIsolation is true, if you change it to false checkout the results on a new project, you will get the same message above, and also try to use the process.platform property.

Ian.

Tip : If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly. (We fixed it for you this time)

Good catch on the versions of the dependancies. Those need to be reviewed on a regular basis - they are always getting updated.

The Uncaught ReferenceError is definitely a bug in AppStudio. We’ll get that fixed right away.

Thank you duely noted.

Ok thank you look forward to the update when ready…

Thank you again.

Where are you executing this code? Is it right at startup of your app?

This code is executed on the startup form on show basically it sets the menu option for exit on windows or darwin platforms.

I have included an example project with a snippet of code which fails, it executed on the onclick of the button.

If you change the nodeIntegration and contextIsolation properties in the framework propertries for electron you either get the jQuery missing message highlighted at the beginning of this thread or the Uncaught ReferenceError process is not defined.

Hope that makes sense.

Project1.appstudio.zip (9.7 KB)

If you set the following electrion properties to
‘‘webPreferences: { nodeIntegration : true, contextIsolation: true }’’

The result the app runs but you get the message Uncaught ReferenceError process is not defined.

If you set the following electrion properties to
‘‘webPreferences: { nodeIntegration : true, contextIsolation: false }’’

The result the app fails to startup and you get the message at the start of this support thread.

Hope this helps.

Yes, this is a big help!