如何在Ubuntu环境下使用Electron-Forge制作Windows的电子打包应用程序?

pw136qt2  于 2023-01-06  发布在  Electron
关注(0)|答案(1)|浏览(411)

我正在Ubuntu 22.04桌面环境中开发。要为Windows制作打包的应用程序,我需要使用MS Windows环境还是可以在Ubuntu 22.04桌面环境中进行?我问这个问题是因为我没有看到任何与“windows”相关的输出:

/out/make$ ls -lah
total 20K
drwxrwxr-x 5 raphy raphy 4,0K gen  5 12:42 .
drwxrwxr-x 4 raphy raphy 4,0K gen  5 12:41 ..
drwxrwxr-x 3 raphy raphy 4,0K gen  5 12:41 deb
drwxrwxr-x 3 raphy raphy 4,0K gen  5 12:42 rpm
drwxrwxr-x 3 raphy raphy 4,0K gen  5 12:42 zip

即使我已经设置了package.json maker-squirle:

"makers": [
    {
      "name": "@electron-forge/maker-squirrel",

我是否必须在我的Ubuntu 22.04桌面环境中安装葡萄酒终端,才能正确地生产Windows打包应用程序?或者我还需要做什么?

4c8rllxm

4c8rllxm1#

正在执行:yarn make --platform=win32我收到以下消息:

raphy@raohy:~/ForgeTypescriptReactWebpack$ yarn make --platform=win32
yarn run v1.22.19
$ electron-forge make --platform=win32
✔ Checking your system
✔ Loading configuration
✔ Resolving make targets
  › Making for the following targets: squirrel, zip
❯ Running package command
  ✔ Preparing to package application
  ✔ Running packaging hooks
    ✔ Running generateAssets hook
    ✔ Running prePackage hook
      ✔ [plugin-webpack] Preparing native dependencies: 1 / 1
      ✔ [plugin-webpack] Building webpack bundles
  ❯ Packaging application
    ❯ Packaging for x64 on win32
      ✔ Copying files
      ✔ Preparing native dependencies [0.1s]
      ✖ Finalizing package
        › Wrapper command 'wine64' not found on the system. Consult your Linux distribution's package manager to deter…
          Wine is required to use the appCopyright, appVersion, buildVersion, icon, and
          win32metadata parameters for Windows targets.
          See https://github.com/electron/electron-packager#building-windows-apps-from-non-windows-platforms for detai…
  ◼ Running postPackage hook
◼ Running preMake hook
◼ Making distributables
◼ Running postMake hook

An unhandled rejection has occurred inside Forge:
Error: Wrapper command 'wine64' not found on the system. Consult your Linux distribution's package manager to determine how to install Wine.

Wine is required to use the appCopyright, appVersion, buildVersion, icon, and
win32metadata parameters for Windows targets.

See https://github.com/electron/electron-packager#building-windows-apps-from-non-windows-platforms for details.
at spawnWrapper (/home/raphy/ForgeTypescriptReactWebpack/node_modules/cross-spawn-windows-exe/dist/src/wrapper.js:77:19)
    at async module.exports (/home/raphy/ForgeTypescriptReactWebpack/node_modules/rcedit/lib/rcedit.js:42:3)
    at async WindowsApp.runRcedit (/home/raphy/ForgeTypescriptReactWebpack/node_modules/electron-packager/src/win32.js:95:7)
    at async WindowsApp.create (/home/raphy/ForgeTypescriptReactWebpack/node_modules/electron-packager/src/win32.js:105:5)
    at async Promise.all (index 0)
    at async packager (/home/raphy/ForgeTypescriptReactWebpack/node_modules/electron-packager/src/index.js:204:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

因此,必须安装Wine
安装wine并再次执行yarn make --platform=win32之后,我得到了一些奇怪的错误,为此我打开了另一篇文章

相关问题