diff --git a/lib/ruby-processing/exporters/application_exporter.rb b/lib/ruby-processing/exporters/application_exporter.rb index 4a24415c..2eccd537 100644 --- a/lib/ruby-processing/exporters/application_exporter.rb +++ b/lib/ruby-processing/exporters/application_exporter.rb @@ -37,21 +37,22 @@ def export!(sketch) file_list = Dir.glob(app_dir + "{/**/*.{rb,jar},/data/*.*}").map {|f| f.sub(app_dir + "/", "")} @class_path = file_list.map {|f| "$JAVAROOT/" + f.sub(prefix+"/", "") }.join(":") @linux_class_path = file_list.map{|f| f.sub(prefix+"/", "")}.join(":") - @windows_class_path = file_list.map{|f| f.sub(prefix+"/", "")}.join(",") + @windows_class_path = file_list.map{|f| f.sub(prefix+"/", "").gsub('/', '\\')}.join(";") # Do it. render_erb_in_path_with_binding(app_dir, binding, :delete => true) rm Dir.glob(app_dir + "/**/*.{class,java}") runnable = app_dir + "/" + File.basename(@main_file, ".rb") move app_dir + "/run", runnable - move app_dir + "/run.exe", runnable + ".exe" + move app_dir + "/run.bat", "#{runnable}.bat" chmod 0755, runnable + chmod 0755, "#{runnable}.bat" cd app_dir + "/Contents/Resources" # Poor ol' windows can't symlink. # TODO... win = RUBY_PLATFORM.match(/mswin/) - puts "I'm afraid windows can't export Apps quite yet" and exit if win - ln_s('../../lib', 'Java') + puts "\nSorry. Applications exported from Windows won't run on Macs...\n" if win + ln_s('../../lib', 'Java') unless win end def usage(predicate) diff --git a/lib/templates/application/lib/args.txt.erb b/lib/templates/application/lib/args.txt.erb deleted file mode 100644 index 8b6033a8..00000000 --- a/lib/templates/application/lib/args.txt.erb +++ /dev/null @@ -1,4 +0,0 @@ - -org.jruby.Main -ruby-processing/runners/run.rb -<%= @main_file %> \ No newline at end of file diff --git a/lib/templates/application/run.bat.erb b/lib/templates/application/run.bat.erb new file mode 100644 index 00000000..bb9718ab --- /dev/null +++ b/lib/templates/application/run.bat.erb @@ -0,0 +1,4 @@ +@echo off +echo loading... +cd lib +java -cp "<%= @windows_class_path %>" org.jruby.Main ruby-processing/runners/run.rb <%= @main_file %> \ No newline at end of file diff --git a/lib/templates/application/run.exe b/lib/templates/application/run.exe deleted file mode 100644 index 01636ebb..00000000 Binary files a/lib/templates/application/run.exe and /dev/null differ