How to allow two different installation of executables from the same source code in Windows machine

Viewed 251

I'm currently working on two ReactJs Electron project using the same source code. In case my statement are confusing, I got Product A and Product B on the same source code but the differences between both are the logo and configurations.

When I use electron-builder to generate the executable file, it indeed come out as two different executable and when I install both executable, it did appear as two different application. But the problem is that, when I opened both application, it overwrite the previous installation.

I did assume changing the setAppUserModelId on my electron.js and appId, name and others in package.json will trick Windows into thinking that both project are different but ended up it doesn't.

//electron.js

app.on("ready", () => {
  createWindow();
  if (process.platform === "win32") {
    app.setAppUserModelId("com.product.a"); //similar thing goes to Product B
  }
});

//package.json

"build": {
   "appId": "com.product.a",
   "win": {
     "target": "NSIS",
     "icon": "build/logo.ico"
   }
},

Problem:

I install productA.exe first then install productB.exe, two application did show up as separate application, but when I launch Product A, it shows Product B and when I launch Product B it shows Product B (which doesn't wrong).

Expectation:

What I trying to achieve here is that, when I install productA.exe it shows Product A and when I install productB.exe it shows Product B.

Question:

Did I configure my project wrongly or did I missed out something here?

2 Answers

Upon restructuring the package.json by moving appId inside "build" to outside, the problem is solved.

you should modify package.json "name": "ProductA" or "ProductB"

Related