require 'fileutils' module SixUpdaterWeb OLDLOCATION = if defined?(TAR2RUBYSCRIPT) oldlocation else ENV['BASE_PATH'] ? ENV['BASE_PATH'] : Dir.pwd end # unless ENV['BASE_PATH'] # ENV['BASE_PATH'] = OLDLOCATION # end SPECIAL = true SIX_ADMIN = true end case RUBY_PLATFORM when /-mingw32$/, /-mswin32$/ begin %x[chcp] rescue puts "WARNING: chcp was not found. If the web-client doesn't start properly, " puts "Please follow these steps:" puts f = File.join(ENV['WINDIR'], 'system32', 'chcp.com').gsub!("/", "\\") path = SixUpdaterWeb::OLDLOCATION nf = File.join(path, "tools", "ruby", "bin").gsub!("/", "\\") puts "Copy #{f} to #{nf}" puts "And rename the copy to chcp.EXE. Then restart this program" puts puts "More info, at: http://dev-heaven.net/wiki/six-arma-updater/Six_Updater_Suite#Known-Issues" sleep 10 end end begin # If env var VERSION exists and is a number, and no VERSION= argument is passed, migration will likely fail. # move original env VERSION value to OS_VERSION, in case it's needed, and reset ENV["VERSION"]. if not ARGV.any?{ |arg| /^VERSION=/i.match(arg) } ENV["OS_VERSION"] = ENV["VERSION"] ENV["VERSION"] = nil end rescue puts "ERROR: #{$!}" end ENV["RAILS_ENV"] = "production" require 'config/six-updater-web'