jruby/rawr exe bundling headbanging with windows xp.

Since I could find nothing on this online, some notes in case it helps anyone.

On Windows XP SP3
jruby 1.5.5
rawr 1.4.5

I was trying to do this:

jruby -S rake rawr:bundle:exe

I kept getting this error:

** Invoke rawr:bundle:exe (first_time)
** Invoke rawr:jar (first_time)
** Invoke package/jar/sersol_delete_url_check.jar (first_time, not_needed)
** Invoke package/classes/java/org/rubyforge/rawr/Main.class (first_time, not_needed)
** Invoke src/org/rubyforge/rawr/Main.java (first_time, not_needed)
** Invoke package/classes/java (first_time, not_needed)
** Invoke package/classes/META-INF (first_time, not_needed)
** Invoke package/jar (first_time, not_needed)
** Execute rawr:jar
cp lib/java/jruby-complete.jar package/jar/lib/java/jruby-complete.jar
** Invoke package/windows (first_time, not_needed)
** Execute rawr:bundle:exe
Creating Windows application in package/jar/sersol_delete_url_check.exe
rake aborted!
private method `split’ called for nil:NilClass
c:/jruby-1.5.5/lib/ruby/gems/1.8/gems/rawr-1.4.5/lib/exe_bundler.rb:95:in `deploy’
c:/jruby-1.5.5/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call’

I poked around in exe_bundler.rb and made it put file_dir_name, the part of file_dir_name split out for use in output, and output to the screen:

FILE DIR NAME: c:/jruby-1.5.5/lib/ruby/gems/1.8/gems/rawr-1.4.5/lib
OUTPUT: Error: The filename, directory name, or volume label syntax is incorrect.

I’m on my work computer so I don’t have full admin permissions, but I can run this fine in the cmd window myself:
fsutil fsinfo volumeinfo c:

Anyway, all of that is leading up to finding out whether my file system is FAT32 or NTFS, so it can do:

if 'NTFS' == output.split("n")[3].split(':')[1].strip
sh "echo y | cacls "#{file_dir_name}/launch4j/bin-win/windres.exe" /G "#{ENV['USERNAME']}":F"
sh "echo y | cacls "#{file_dir_name}/launch4j/bin-win/ld.exe" /G "#{ENV['USERNAME']}":F"

I know it is NTFS, so I just commented out the if block lines:

#if 'NTFS' == output.split("n")[3].split(':')[1].strip
sh "echo y | cacls "#{file_dir_name}/launch4j/bin-win/windres.exe" /G "#{ENV['USERNAME']}":F"
sh "echo y | cacls "#{file_dir_name}/launch4j/bin-win/ld.exe" /G "#{ENV['USERNAME']}":F"

That’s hideous, but hey, the next run of rawr:bundle:exe worked with no errors, successfully creating my exe.

Of course, now that I have an exe, I have found that it appears to do nothing, regardless of how I run it. But figuring that out is for another day, because I must get ready to leave work.

One thought on “jruby/rawr exe bundling headbanging with windows xp.”

Leave a Reply

Your email address will not be published. Required fields are marked *