Largo / ocran

Turn ruby files into .exe files on windows (supported safe fork of ocran)
MIT License
52 stars 5 forks source link

`--icon src\app.ico` results in opcode error, without the setting build goes fine. #12

Open reneweteling opened 6 months ago

reneweteling commented 6 months ago

when setting an icon the exe gets an icon only i get an opcode error, without the icon it works just fine.

When building a app like so on windows 11

bundle exec ocran `
  --windows `
  --add-all-core `
  --no-lzma `
  --icon src\app.ico `
  --output icon-true.exe `
  src\window.rb

The app has the nice icon, only when starting you get this error

image

When building without the icon it all works fine, except for the icon obviously.

bundle exec ocran `
  --windows `
  --add-all-core `
  --no-lzma `
  --output icon-false.exe `
  src\window.rb

No icon, all is fine

image

Environment

MBP m2 max UTM (https://mac.getutm.app/) running Windows 11 for Apple silicon ruby: Ruby+Devkit 3.0.6-1 (x64) (https://rubyinstaller.org/downloads/)

window.rb

just a small file to see how glimmer would work with ocran.

require 'glimmer-dsl-libui'

include Glimmer

window('hello world', 300, 200, true) {
  on_closing do
    puts 'Bye Bye'
  end
}.show
Largo commented 6 months ago

Thanks for the report. I'm looking into it. Icons used to work, so I'm checking if it works with our unreleased version. Good to see glimmer lib-ui working. It's the fastest starting GUI Framework for Ruby on Windows, due to it not loading as many files as other libs (GTK3 for instance).

Largo commented 6 months ago

I tested with the current ocran version on rubygems 1.3.15 and the master version and couldn't get the same error. Can you upload the file with the error and the icon that you are using? I'll also be releasing a new version on rubygems in a bit.

reneweteling commented 6 months ago

Archive.zip

Nice you can upload zips, thats new (at least to me) thanks @Largo for the support!!

Largo commented 6 months ago

Sorry, I meant the generated .exe file with the opcode error. I want to check if it also shows the same error on a non virtualized windows installation.

reneweteling commented 6 months ago

Archive.zip

Hi Largo,

The zip contains, all source files exact.exe (works) exact_icon.exe does not work, and the build.ps1 contains the commands used to generate the both items.

.
├── bin
│   └── build.ps1
├── exact.exe
├── exact_icon.exe
└── src
    ├── app.ico
    └── window.rb

Thanks!!