ruby - Setting filepaths inside your .rb file when converted into an exe with ocra -
i've had lot of trouble getting 1 wxruby scripts use image file included in exe ocra. if didn't have original image file in same directory exe, exe wouldn't find image.
shape = file.join('warning3.png' )
i wanted script find image included in exe.
in ocra documentation mentions dir.chdir file.dirname($0)
didn't meant when mentioned.
if need use image file in script can make sure works merely having dir.chdir(file.dirname($0))
line before try use of images.
for example in app i'm using image file , couldn't exe work if wasn't in same dir file below works anywhere far.
dir.chdir(file.dirname($0)) shape = file.join('warning3.png' )
i think sets script's current directory exe's directory inside it? if i'm wrong please let me know!
Comments
Post a Comment