电子应用程序名称不会更改 [英] Electron app name doesn't change

查看:86
本文介绍了电子应用程序名称不会更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用电子打包器打包我的应用程序但是没有改变它的名字,仍然显示Electron。

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

它应该使用<$我的 package.json 中的c $ c> productName 但它没有改变。

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.

知道出了什么问题吗?

修改:

阅读更多关于 electron-packager 的文档,特别是对Windows的选项。但是当我使用它们时会抛出一个错误:

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

我第一次使用它们是正常打包我的应用程序,但仍显示错误的appname

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"

在使用 - version-string之前。 ProductName 但现在即使它仍然会抛出该错误。

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

这里我将留下你的 packager.json 这是我项目的根目录

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"
}
}

推荐答案

在尝试和研究之后我决定通过程序化API打包我的应用程序

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);
});

这篇关于电子应用程序名称不会更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆