Permalink
Browse files

Merge pull request #100 from crigor/fix-batch-files

Fix batch files
  • Loading branch information...
2 parents 33cb534 + 01fe006 commit 052fdd58c292ccbad1b6c5849f80717583e956c3 @emachnic emachnic committed Sep 20, 2017
View
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2014 RailsInstaller Team.
+Copyright (c) 2010-2017 RailsInstaller Team.
All rights reserved. See CONTRIBUTORS.txt for complete list.
Permission is hereby granted, free of charge, to any person
View
@@ -1 +1 @@
-3.2.1
+3.4.0
View
@@ -5,23 +5,26 @@
:category: gems
:list:
- rake
+ -
+ :name: bundler
+ :version: "1.15.3"
-
:name: rails
- :version: "5.0.0.1"
+ :version: "5.1.3"
-
:name: activerecord-sqlserver-adapter
- :version: "4.2.15"
+ :version: "5.1.1"
- tiny_tds
- sqlite3
- sqlite3-ruby
- rubyzip
- rb-readline
-
:name: coffee-rails
- :version: "4.2.1"
+ :version: "4.2.2"
-
:name: jquery-rails
- :version: "4.2.1"
+ :version: "4.3.1"
-
:name: sass-rails
:version: "5.0.6"
@@ -41,13 +44,13 @@
:target: 'DevKit'
:url: "http://s3.amazonaws.com/railsinstaller/Resources/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe"
-:ruby220:
+:ruby233:
:category: component
- :title: Ruby 2.2.0
- :name: Ruby220
+ :title: Ruby 2.3.3
+ :name: Ruby233
:regex: '^.*$'
- :url: "http://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-i386-mingw32.7z"
- :rename: Ruby2.2.0
+ :url: "http://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-i386-mingw32.7z"
+ :rename: Ruby2.3.3
:git:
:category: component
@@ -3,7 +3,7 @@ module RailsInstaller
def self.build!
components = [
- BSDTar, SevenZip, DevKit, Git, Ruby220,
+ BSDTar, SevenZip, DevKit, Git, Ruby233,
PostgresServer, Sqlite3, Sqlite3Dll
]
@@ -21,9 +21,11 @@ def self.build!
stage_postgresql
+ stage_todo_application
+
stage_gems
- stage_todo_application
+ fix_batch_files
stage_setup_scripts
@@ -38,7 +40,7 @@ def self.build!
#
def self.package!
- unless %x{iscc --version}.scan("Inno Setup 5")
+ unless %x{iscc}.scan("Inno Setup 5")
printf "ERROR: Inno Setup is required in order to package RailsInstaller.\n"
printf " http://www.jrsoftware.org/isdl.php#qsp\n"
printf "Please see README.md for full RailsInstaller instructions.\n"
@@ -52,7 +54,7 @@ def self.package!
iscc "\"#{File.join(RailsInstaller::Root, "resources", "railsinstaller", "railsinstaller.iss")}\"",
"/dInstallerVersion=#{railsinstaller_version}",
"/dStagePath=\"#{RailsInstaller::Stage}\"",
- "/dRubyPath=\"#{RailsInstaller::Ruby220.rename}\"",
+ "/dRubyPath=\"#{RailsInstaller::Ruby233.rename}\"",
"/dResourcesPath=\"#{File.join(RailsInstaller::Root, "resources")}\"",
"/o\"#{RailsInstaller::PackageDir}\"",
"/frailsinstaller-#{railsinstaller_version}"
@@ -1,6 +1,6 @@
module RailsInstaller
- require "net/http"
+ require "net/https"
require "tempfile"
# Original download() code taken from Rubinius and then butchered ;)
@@ -193,7 +193,7 @@ def self.stage_sqlite
if File.exist?(File.join(Stage, file))
FileUtils.mv(
File.join(Stage, file),
- File.join(Stage, Ruby220.rename, "bin", file)
+ File.join(Stage, Ruby233.rename, "bin", file)
)
end
end
@@ -207,7 +207,7 @@ def self.stage_postgresql
if File.exist?(File.join(Stage, file))
FileUtils.cp(
File.join(Stage, PostgresServer.target, "bin", file),
- File.join(Stage, Ruby220.rename, "bin", file)
+ File.join(Stage, Ruby233.rename, "bin", file)
)
end
end
@@ -218,7 +218,7 @@ def self.stage_postgresql
#
def self.link_devkit_with_ruby
devkit_path = File.join(Stage, DevKit.target)
- ruby_path = File.join(Stage, Ruby220.rename)
+ ruby_path = File.join(Stage, Ruby233.rename)
FileUtils.mkdir_p(devkit_path) unless File.directory?(devkit_path)
Dir.chdir(devkit_path) do
File.open("config.yml", "w") do |file|
@@ -239,8 +239,8 @@ def self.stage_git
def self.stage_gems
section Gems
- build_gems(File.join(Stage, Ruby220.rename), Gems.list)
- build_gem(File.join(Stage, Ruby220.rename), "pg", {
+ build_gems(File.join(Stage, Ruby233.rename), Gems.list)
+ build_gem(File.join(Stage, Ruby233.rename), "pg", {
:args => [
"--",
"--with-pg-include=#{File.join(Stage, "pgsql", "include")}",
@@ -249,14 +249,29 @@ def self.stage_gems
})
end
+ def self.fix_batch_files
+ ruby_path = File.join(Stage, Ruby233.rename)
+ bin_path = File.join(ruby_path, "bin/")
+ filenames = Dir.glob("#{bin_path}*.bat")
+ filenames.each do |filename|
+ text = File.read(filename)
+ fixed = text.gsub(/#{bin_path}/, '')
+ other_bin_path = bin_path.gsub(/\//, '\\\\\\\\')
+ fixed = fixed.gsub(/#{other_bin_path}/, '')
+ File.open(filename, "w") { |file|
+ file.write fixed
+ }
+ end
+ end
+
def self.stage_todo_application
section RailsTodo
todo_path = File.join(Stage, "Sites", "todo")
FileUtils.rm_rf(todo_path) if File.exist?(todo_path)
git_binary = File.join(Stage, Git.target, "bin", "git")
- line = %Q(#{git_binary} clone https://github.com/engineyard/todo todo)
+ line = %Q(#{git_binary} clone -b railsinstaller https://github.com/engineyard/todo todo)
applications_path = File.join(RailsInstaller::Stage, "Sites")
FileUtils.mkdir_p applications_path unless File.exist?(applications_path)
@@ -267,9 +282,9 @@ def self.stage_todo_application
FileUtils.rm_rf(File.join(todo_path, ".git"))
end
- gem_install File.join(Stage, Ruby220.rename), "bundler"
+ gem_install File.join(Stage, Ruby233.rename), "bundler", :version => "1.15.3"
- ruby_binary("bundle", "bundle", "", File.join(Stage, Ruby220.rename))
+ ruby_binary("bundle", "install", "", File.join(Stage, Ruby233.rename), File.join(applications_path, "todo"))
end
def self.stage_rails_sample_application
@@ -278,7 +293,7 @@ def self.stage_rails_sample_application
section Rails
sample = File.join(Stage, "Sites", "sample")
FileUtils.rm_rf(sample) if File.exist?(sample)
- ruby_binary("rails", "new", "sample", File.join(Stage, Ruby220.rename))
+ ruby_binary("rails", "new", "sample", File.join(Stage, Ruby233.rename))
end
# Renders setup scripts to be used post-installation
@@ -298,7 +313,7 @@ def self.stage_setup_scripts
%w( publickey.bat ).each do |file|
FileUtils.cp(
File.join(RailsInstaller::Scripts, file),
- File.join(Stage, Ruby220.rename, "bin", file)
+ File.join(Stage, Ruby233.rename, "bin", file)
)
end
end
@@ -353,14 +368,12 @@ def self.gem_install(ruby_path, gem,options = {})
sh line
end
- def self.ruby_binary(name, line, action, ruby_path, options = {})
+ def self.ruby_binary(name, line, action, ruby_path, directory_path, options = {})
printf " => rails #{line} #{action}\n" if $Flags[:verbose]
%w(GEM_HOME GEM_PATH).each { |variable| ENV.delete(variable)}
line = %Q(#{File.join(ruby_path, "bin", "ruby")} -S #{name} #{line} #{action})
line += options[:args] if options[:args]
- applications_path = File.join(RailsInstaller::Stage, "Sites")
- FileUtils.mkdir_p applications_path unless File.exist?(applications_path)
- Dir.chdir(applications_path) { sh line }
+ Dir.chdir(directory_path) { sh line }
end
def self.iscc(*params)
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2014 RailsInstaller Team.
+Copyright (c) 2010-2017 RailsInstaller Team.
Except:
@@ -77,6 +77,7 @@ WizardSmallImageFile={#ResourcesPath}\images\RailsInstallerWizardImageSmall.bmp
PrivilegesRequired=lowest
ChangesAssociations=yes
ChangesEnvironment=yes
+UsePreviousAppDir=no
#if Defined(SignPackage) == 1
SignTool=risigntool sign /a /d $q{#InstallerNameWithVersion}$q /du $q{#InstallerHomepage}$q /t $qhttp://timestamp.comodoca.com/authenticode$q $f
@@ -75,11 +75,11 @@ def git_config(key)
version: #{run "git --version"}
ruby:
- bin: #{File.join(Config[:railsinstaller_path], "Ruby2.0.0", "bin", "ruby.exe")}
+ bin: #{File.join(Config[:railsinstaller_path], "Ruby2.3.3", "bin", "ruby.exe")}
version: #{run "ruby -v"}
rails:
- bin: #{File.join(Config[:railsinstaller_path], "Ruby2.0.0", "bin", "rails.bat")}
+ bin: #{File.join(Config[:railsinstaller_path], "Ruby2.3.3", "bin", "rails.bat")}
version: #{run "rails -v"}
ssh:

0 comments on commit 052fdd5

Please sign in to comment.