oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.77k stars 2.73k forks source link

Single-file executables icon on Windows #10823

Open standstonecraft opened 5 months ago

standstonecraft commented 5 months ago

What is the problem this feature would solve?

Currently, the icon of an exe file built as a single-file executable with bun is a cute bun icon and cannot be changed.

What is the feature you are proposing to solve the problem?

It would be great if the build command allows us to specify an icon file like this: bun build ./index.ts --compile --outfile hello.exe --icon ./nikuman.ico

What alternatives have you considered?

The icon can be changed with Resource Hacker. However, it must be done each time you rebuild.

sohaieb commented 4 months ago

thank you @standstonecraft for raising this topic, I was about to raise it too 😄

I want also to add as a suggestion (if possible), to support an optional default json-like configuration in the route of bun project, that can replace the compiling options. something like:

// build-config.json:
{
   "outFile": "hello.exe",
   "icon": "your_icon.ico",
   "target": "windows10",
   ...
   ...
}

accordingly the command could be: bun build ./index.ts --compile (automatically target build-config.json if it exists in the root project) or bun build ./index.ts --compile --config-file custom-named-file.json (for customly named config files)

safagwq commented 4 months ago
  1. mv ~/.bun/install/cache/bun-windows-x64-v1.1.12 ~/.bun/install/cache/bun-windows-x64-v1.1.12.exe

  2. use Resource Hacker

  3. mv ~/.bun/install/cache/bun-windows-x64-v1.1.12.exe ~/.bun/install/cache/bun-windows-x64-v1.1.12

  4. ^_^ bun build --compile

nknikolay commented 3 months ago

I support you. I'd really like to see this kind of functionality. Additionally, I would like to note that I would like to apply not only the icon settings, but also add information about the version, author, copyright, and so on