Windows(在Windows上)的代码Electron应用程序

发布于 2025-02-02 02:51:01 字数 1631 浏览 4 评论 0原文

正如标题中所说的那样,这是IM试图做的:使用Windows 10,使用从第三方供应商(以P12格式)购买的证书代码我的电子应用程序。

我已经在这里阅读了文档: https://wwww.electron.build/configuration/configuration/configuration/win/win 此处: https://wwwww.electron.build/code-signing 并意识到我需要使用适当的键(CERTIFTILEFILE和CELIDEDPASSWORD)提供证书文件和密码(如果设置)的路径。

我还看到了这些答案:

(也有很多问题和答案是指人在Mac上建造Windows的人,但这不是我在这里所做的),

但这似乎并没有解决这个问题。

这些就是我的软件包中的行。将json设置为参考相关路径/密码:

"certificateFile ": "./certificate_file.p12",
"certificatePassword ": "password"

我意识到最好将这些设置设置在.env文件中,然后从那里读取它们,我打算以后进行。但是,据我了解,这应该就足够了吗?

我的构建命令是:

"build": "electron-builder build"

这会产生以下内容:

”在此处输入图像描述

但根本没有提及签名。如果我在皇家身上很愚蠢,请随时指出 ^ _ ^在哪里非常感谢!

更新

As it says in the title, this is what im trying to do: using windows 10, codesign my electron app using the certificate purchased from a third party vendor (which is in p12 format).

I've read the docs here: https://www.electron.build/configuration/win and here: https://www.electron.build/code-signing
And realise that I need to provide a path to the certificate file and password (if one is set) using the appropriate keys (certificateFile and certificatePassword).

I've also seen these answers:

(There's also loads of questions and answers referring to people building for windows on mac, but that's not what im doing here)

But this doesnt seem to address the question.

These are how the lines in my package.json are set referring to the relevant path/password:

"certificateFile ": "./certificate_file.p12",
"certificatePassword ": "password"

I realise that it is better to have these set in a .env file and read them from there, which I intend to do later. But as I understand it, this should suffice shouldnt it?

My build command is:

"build": "electron-builder build"

And this produces the following:

enter image description here

But there is no mention of signing taking place at all. If Im being royally stupid, please feel free to point out where ^_^ many thanks in advance!

Updates

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

自演自醉 2025-02-09 02:51:01

它可能是明显更简单地在电子构建器外签名的EXE。在这种情况下,我采用的方法是使用 ssl。 COM的SSL经理GUI

您可以向此页面并查看他们对工具的文档在这里

大约一个星期来调查与电子构建器的代码,但仍然不确定如何做。
使用此工具约5分钟。完毕。

It may be significantly simpler to sign your exe OUTSIDE of electron builder. In which case, the approach I took was to use SSL.com's SSL manager GUI.

You can read about it toward the bottom of this page and see their documentation of the tool here.

About a week looking into codesigning with electron builder, still not entirely sure how to do it.
About 5 mins using this tool. Done.

情栀口红 2025-02-09 02:51:01

我不记得整个过程,但是我不得不弄乱了几天才能使它起作用。

在我的package.json文件中,我有一个这样的构建对象:


"build":
    ...
    "win": {
      "certificateFile": "private/mycertificate.pfx",
      "verifyUpdateCodeSignature": true,
      "publisherName": [
        "My Company Name"
      ]
    },

然后在发布之前,我在Windows PowerShell中运行此对象以设置Env变量:

setx CSC_KEY_PASSWORD my-certifcate-password-here

然后最后:

electron-builder -w

I don't remember the whole process but I had to fumble around for a few days to get it working.

In my package.json file I have a build object like this:


"build":
    ...
    "win": {
      "certificateFile": "private/mycertificate.pfx",
      "verifyUpdateCodeSignature": true,
      "publisherName": [
        "My Company Name"
      ]
    },

Then before publishing I run this in windows powershell to set the env variable:

setx CSC_KEY_PASSWORD my-certifcate-password-here

Then finally:

electron-builder -w
迷你仙 2025-02-09 02:51:01

如果您已经有代码签名证书,则可以在poffage.json文件中添加以下配置。

"build": {
...
"win": {
...
"certificateFile": "path to your certificate file (certificate.pfx)",
"certificatePassword": "the password of your cert"
   }
}

请记住,密码是您使用openssl的.cer文件的导出.pfx文件的密码

If you already have a code signing certificate, then you can add the following configuration in your package.json file.

"build": {
...
"win": {
...
"certificateFile": "path to your certificate file (certificate.pfx)",
"certificatePassword": "the password of your cert"
   }
}

Kindly remember, the password is the same password that you've used to export .pfx file from .cer file using openssl

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文