Search code examples
javascriptnode.jselectronnode-modules

Electron app name doesn't change


i'm packaging my application using electron-packager but isn't changing its name, and still display "Electron".

it's supposed to use the productName in my package.json but it doesn't change.

even if i made an installer, the name of the app installed, shortcut and process still is Electron

i've read that maybe the problem is electron-prebuilt but i didn't have it as a dependency on my project.

Any idea what is wrong?

Edit:

reading more on the documentation of electron-packager there's an options especially to windows. but when i use them throws me an error:

Fatal error: Unable to commit changes
undefined

the first time i used them was "working" good packaging my app, but still displaying wrong the appname

electron-packager ./ --platform=win32 --arch=ia32 --overwrite=true --appname="TierraDesktop" --version-string.ProductName="TierraDesktop" --version-string=InternalName="TierraDesktop" --version-string.CompanyName="Cosmica" --version-string.FileDescription="Sistema de gestion comercial" --version-string.OriginalFilename="TierraDesktop"

before was working with --version-string.ProductName but now even with it still throws that error.

here i'll leave you my packager.json that's on the root of my project

{
"name": "TierraDesktop",
"productName": "TierraDesktop",
"version": "2.0.5",
"description": "Aplicacion de escritorio tierra de colores",
"main": "main.js",
"scripts": {
    "start": "electron main.js"
},
"repository": {
    "type": "git",
    "url": "git+https://github.com/xxxx/xxxxx.git"
},
"author": "xxxxx",
"devDependencies": {
    "debug-menu": "^0.4.0",
    "electron-winstaller": "^2.3.3"
},
"dependencies": {
    "electron-json-storage": "^2.0.0"
}
}

Executable

Process name

Application name


Solution

  • Ok after trying and researching i've decided to package my application via programmatic API

    with this script i can achieve all what i want. hope this help someone with the same problem.

    var packager = require('electron-packager');
    var options = {
        'arch': 'ia32',
        'platform': 'win32',
        'dir': './',
        'app-copyright': 'Paulo Galdo',
        'app-version': '2.0.5',
        'asar': true,
        'icon': './app.ico',
        'name': 'TierraDesktop',
        'ignore': ['./releases', './.git'],
        'out': './releases',
        'overwrite': true,
        'prune': true,
        'version': '1.3.2',
        'version-string':{
          'CompanyName': 'Paulo Galdo',
          'FileDescription': 'Tierra de colores', /*This is what display windows on task manager, shortcut and process*/
          'OriginalFilename': 'TierraDesktop',
          'ProductName': 'Tierra de colores',
          'InternalName': 'TierraDesktop'
        }
    };
    packager(options, function done_callback(err, appPaths) {
        console.log(err);
        console.log(appPaths);
    });