noreply at rubyforge.org
2010-Feb-01 16:53 UTC
[wxruby-development] [ wxruby-Bugs-27762 ] Generated ruby file from xrc source uses incorrect xml.load statement
Bugs item #27762, was opened at 2010-02-01 11:53 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=27762&group_id=35 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Joel Dezenzio (jdezenzio) Assigned to: Nobody (None) Summary: Generated ruby file from xrc source uses incorrect xml.load statement Initial Comment: When packaging any WxRuby project into an executable for windows porting, the xml.load statement that''s generated in the ruby file from xrc source resolves to the current working directory. If your app.exe is sitting in the desktop, the xml.load resolves to: C:/users/joel/desktop/ui/ui.xrc .. which is incorrect as an executable (for instance ocra) is unpackaged in the appdata/temp directory on windows (the correct path) and run from there. Because you are using xml.load with a relative path instead of an absolute path, it will not work. You need to change xml.load from xml.load(''blah.xrc'') to: xml.load(File.join(File.dirname(__FILE__),"blah.xrc")) I have tested this code on multiple gui apps and it works in all locations where the executable is placed and run. Per the ruby api, load resolves to an absolute path. Thanks. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=27762&group_id=35