bennymeg / nx-electron

Electron schematics for nrwl nx platform
Apache License 2.0
307 stars 82 forks source link

The parameter "useAppIdAsId" have no effect. #282

Open morgan-wild opened 3 months ago

morgan-wild commented 3 months ago

Describe the bug

The parameter "useAppIdAsId" doesn't have any effect in the url of the squirrel updater.

It is still using the "name" of the entire nx solution (package.json), not the app's (from its project.json) or the id (from maker.options.json).

To Reproduce Steps to reproduce the behavior:

  1. Name you solution 'my-nx-solution' in the main package.json file
  2. Configure your electron app to use windows.squirrel
  3. Set the following configuration in the maker.options.json file:
{
    "$schema": "../../../../../node_modules/nx-electron/src/validation/maker.schema.json",
    "productName": "my-app",
    "appId": "com.company.myapp",
    "win": {
        "icon": "apps/my-app/src/assets/favicon.ico",
        "target": "squirrel"
    },
    "squirrelWindows": {
        "useAppIdAsId": false,
    }
}
  1. Build, Make and install the app after enabling the auto update service.
  2. Observe the requested url:
https://my-domain/updates/win32/0.0.0/RELEASES?id=my-nx-solution&localVersion=0.0.0&arch=amd64
  1. Note the id is the name of the nx solution, not the app's.

  2. Enable the option "useAppIdAsId"

{
    "$schema": "../../../../../node_modules/nx-electron/src/validation/maker.schema.json",
    "productName": "my-app",
    "appId": "com.company.myapp",
    "win": {
        "icon": "apps/my-app/src/assets/favicon.ico",
        "target": "squirrel"
    },
    "squirrelWindows": {
        "useAppIdAsId": true, <------
    }
}
  1. Build, Make and install the app.

  2. Observe the requested url:

https://my-domain/updates/win32/0.0.0/RELEASES?id=my-nx-solution&localVersion=0.0.0&arch=amd64

There is no changes.

Expected behavior

When useAppIdAsId is false, we should have the app name from its project.json file:

https://my-domain/updates/win32/0.0.0/RELEASES?id=my-app&localVersion=0.0.0&arch=amd64

When useAppIdAsId is true, we should have the app id from the maker.options.json file:

https://my-domain/updates/win32/0.0.0/RELEASES?id=com.company.myapp&localVersion=0.0.0&arch=amd64

Desktop (please complete the following information):