electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

Unexcept directory created when icon needs transformat

Open ChingCdesu opened this issue 1 year ago • 5 comments

  • Electron-Builder Version: 23.5.0
  • Node Version: v16.13.2 and v18
  • Electron Version: 20.0.3
  • Electron Type (current, beta, nightly): current
  • Target: Windows (Unexcept behavior), macOS (Build successfully)

I started build after added a .png icon and received a build error, shows cannot find icon files in ${target directory}/.icon-ico\icon.ico.

I check the code in node_modules and source code on github, finally located error is in file packages/app-builder-lib/src/platformPackager.ts#L684. The variable config.directories.output is not expanded, my configuration is release/${version}, and I got a directory named ${version}. image

Something is weird on my mac, electron-builder also created ${version} directory, but app can be built successfully with icon.

My temporary solution is saving different format of icon to my buildResources directory.

ChingCdesu avatar Sep 02 '22 18:09 ChingCdesu

The variable config.directories.output is not expanded

This functionality was never supported. Happy to accept a PR if you'd like to contribute! Setting up a local dev environment is fairly straight forward too https://github.com/electron-userland/electron-builder/blob/master/CONTRIBUTING.md#to-setup-a-local-dev-environment

mmaietta avatar Sep 02 '22 23:09 mmaietta

ok, I will do it in few days, I need test on different platforms and CI

ChingCdesu avatar Sep 03 '22 08:09 ChingCdesu

I forked the repo and create a branch to commit code, and I need some help.

Q: How to test modified electron-builder with custom configuration (specified arch and os) or for an existed electron project? I ran pnpm test but it took too long.

ChingCdesu avatar Sep 07 '22 09:09 ChingCdesu

Use TEST_FILES= to specify the exact tests you're looking to run. UPDATE_SNAPSHOT=true for updating snapshots. For custom configuration, can you elaborate more? What arch are you trying to run for?

mmaietta avatar Sep 07 '22 15:09 mmaietta

Use TEST_FILES= to specify the exact tests you're looking to run. UPDATE_SNAPSHOT=true for updating snapshots. For custom configuration, can you elaborate more? What arch are you trying to run for?

I want to test on x64-windows portable exe, the issue is only found on this platform. I also want to figure out why ( I'm noob, sorry).

My project: MaaAssistantArknights/MaaAsstElectronUI I defined the buildResource directory where icon.png placed.

Do I need to set TEST_FILES=$project_directory and start pnpm test?

CI is running when I am writing this comment.

ChingCdesu avatar Sep 07 '22 17:09 ChingCdesu

It's the name of the test file(s) comma-separated :) Example: TEST_FILES=masTest pnpm test-all

mmaietta avatar Oct 07 '22 15:10 mmaietta