ocran icon indicating copy to clipboard operation
ocran copied to clipboard

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

Open reneweteling opened this issue 2 years ago • 5 comments

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

reneweteling avatar Feb 13 '24 13:02 reneweteling

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 avatar Feb 14 '24 03:02 Largo

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.

Largo avatar Feb 14 '24 05:02 Largo

Archive.zip

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

reneweteling avatar Feb 14 '24 07:02 reneweteling

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.

Largo avatar Feb 14 '24 14:02 Largo

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!!

reneweteling avatar Feb 14 '24 16:02 reneweteling