diff -ur rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/dependencies.rb rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/dependencies.rb --- rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-07-30 17:39:52.000000000 +0200 +++ rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/ev/dependencies.rb 2004-07-30 17:39:46.000000000 +0200 @@ -0,0 +1,32 @@ +def dlls(file, notthedefaults=true) + + # Only the dependencies in the same directory as the executable. + + todo = [] + res = [] + + todo << File.expand_path(file) + + while todo.length > 0 + todo2 = todo + todo = [] + + todo2.each do |file| + File.open(file, "rb") do |f| + strings = f.read.scan(/[\w\-\.]+/) # Hack ??? + strings.delete_if{|s| s !~ /\.dll$/i} + + strings.each do |lib| + lib = File.expand_path(lib, File.dirname(file)) + + if not lib.nil? and File.file?(lib) and not res.include?(lib) + todo << lib + res << lib + end + end + end + end + end + + res +end diff -ur rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/init.rb rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/init.rb --- rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/init.rb 2004-07-26 18:48:26.000000000 +0200 +++ rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/init.rb 2004-07-29 16:31:46.000000000 +0200 @@ -1,7 +1,21 @@ require "ev/oldandnewlocation" +require "ev/dependencies" require "ftools" require "rbconfig" +def backslashes(s) + s = s.gsub(/^\.\//, "").gsub(/\//, "\\\\") if windows? + s +end + +def windows? + not (target_os.downcase =~ /32/).nil? # Hack ??? +end + +def target_os + Config::CONFIG["target_os"] or "" +end + script = ARGV.shift rubyw = false @@ -9,36 +23,38 @@ rubyw = false if ARGV.include?("--rubyscript2exe-ruby") rubyw = true if ARGV.include?("--rubyscript2exe-rubyw") -ARGV.delete_if do |arg| - arg =~ /^--rubyscript2exe-/ -end +ARGV.delete_if{|arg| arg =~ /^--rubyscript2exe-/} bindir = Config::CONFIG["bindir"] -libruby = Config::CONFIG["LIBRUBY_SO"] if not script.nil? script = "#{script}.rb" if not script =~ /\.rbw?$/ app = File.basename(script.gsub(/\.rbw?$/, "")) libdir = File.expand_path("lib") - puts "Tracing #{app}..." + $stderr.puts "Tracing #{app}..." + + libs = $:.collect{|a| " -I " + a} oldlocation do - system("#{bindir}/ruby -r ´#{newlocation("require2lib.rb")}´ ´#{script}´ ´#{libdir}´ #{ARGV.collect{|a| "´" + a + "´"}.join(" ")}".gsub(/^\.\//, "").gsub(/\//, "\\\\")) + system(backslashes("#{bindir}/ruby #{libs.join(" ")} -r ´#{newlocation("require2lib.rb")}´ ´#{script}´ ´#{libdir}´ ") + ARGV.collect{|a| "´" + a + "´"}.join(" ")) end - puts "Copying files..." + $stderr.puts "Copying files..." Dir.mkdir("bin") Dir.mkdir("app") File.copy("#{bindir}/ruby.exe" , "bin/ruby.exe" ) File.copy("#{bindir}/rubyw.exe" , "bin/rubyw.exe" ) - File.copy("#{bindir}/#{libruby}" , "bin/#{libruby}" ) - File.copy("#{bindir}/msvcr71.dll" , "bin/msvcr71.dll" ) if File.file?("#{bindir}/msvcr71.dll") File.copy("#{oldlocation(script)}" , "app/app.rb" ) - puts "Creating #{app}.exe..." + dlls("#{bindir}/ruby.exe").each do |dll| + file = File.basename(dll) + File.copy(dll, "bin/#{file}") unless file == "ruby.exe" + end + + $stderr.puts "Creating #{app}.exe..." File.open("app.eee", "w") do |f| f.puts "r bin" @@ -56,11 +72,11 @@ appexe = "#{app}.exe" appico = "#{app}.ico" - system(".\\eee app.eee #{appexe} #{eeeexe}") + system(backslashes("./eee app.eee #{appexe} #{eeeexe}")) oldlocation do File.copy(newlocation(appexe), appexe) - system("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,") if File.file?(appico) + system(backslashes("reshacker -modify #{newlocation(appexe)}, #{appexe}, #{appico}, icon,appicon,")) if File.file?(appico) end end Binary files rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eee.exe and rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eee.exe differ Binary files rubyscript2exe-0.1.19.tar.gz/rubyscript2exe/eeew.exe and rubyscript2exe-0.1.20.tar.gz/rubyscript2exe/eeew.exe differ