Permalink
Browse files

Created railsinstaller:package rake task.

  • Loading branch information...
1 parent 11a1313 commit 8964aa26d86f9c58ceb2d58a7bf61f96cf13bf8b @wayneeseguin wayneeseguin committed Jan 11, 2011
View
@@ -3,3 +3,5 @@
stage/
.idea/
archives/
+*.swp
+*~
View
@@ -1 +1 @@
-0.0.0
+0.0.1
View
@@ -1,7 +1,8 @@
module RailsInstaller # Ensure that the RailsInstaller project root is defined.
- Root = File.expand_path(File.join(File.dirname(__FILE__), ".."))
- Stage = File.expand_path(File.join(Root, "stage"))
- Archives = File.expand_path(File.join(Root, "archives"))
+ Root = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+ Stage = File.expand_path(File.join(Root, "stage"))
+ Archives = File.expand_path(File.join(Root, "archives"))
+ PackageDir = File.expand_path(File.join(Root, "pkg"))
end
%w[ rubygems fileutils ostruct yaml erb uri open-uri open3 zip/zip ].each do |name|
@@ -47,4 +47,34 @@ def self.build!
end
+ #
+ # package()
+ #
+ # Packages a binary installer release version together as a
+ # self contained installer using Inno Setup scripting.
+ #
+ def self.package!
+ version = File.read(File.join(RailsInstaller::Root, "VERSION")).chomp
+
+ command = [
+ "iscc",
+ "\"#{File.join(RailsInstaller::Root, "resources", "railsinstaller", "railsinstaller.iss")}\"",
+ "/dInstallerVersion=#{version}",
+ "/dStagePath=\"#{RailsInstaller::Stage}\"",
+ "/dRubyPath=\"#{RailsInstaller::RubyInstaller.rename}\"",
+ "/o\"#{RailsInstaller::PackageDir}\"",
+ "/frailsinstaller-#{version}"
+ ].join(' ')
+
+ printf "DEBUG: > #{command}\n" if $Flags[:verbose]
+ printf "Packaging... this *will* take a while...\n"
+ output, error, status = Open3.capture3(command)
+
+ if $Flags[:verbose]
+ puts output
+ puts error unless error.empty?
+ end
+
+ end
+
end
@@ -40,7 +40,7 @@ def unzip(package)
entries.each do |entry|
printf "DEBUG: Extracting #{entry.name}\n" if $Flags[:verbose]
-
+
files << entry.name
FileUtils.rm_f(entry.name) if File.exists?(entry.name)
View
@@ -2,7 +2,7 @@ namespace :railsinstaller do
desc "Package all RailsInstaller components into a single executable installer."
task :package do
-
+ RailsInstaller.package!
end
end
@@ -100,9 +100,9 @@ en.DiskSpaceMBLabel=Required free disk space: ~[mb] MB
[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-Source: ..\..\{#StagePath}\{#RubyPath}\*; DestDir: {app}\{#RubyPath}; Flags: recursesubdirs createallsubdirs
-Source: ..\..\{#StagePath}\Git\*; DestDir: {app}\Git; Flags: recursesubdirs createallsubdirs
-Source: ..\..\{#StagePath}\DevKit\*; DestDir: {app}\DevKit; Flags: recursesubdirs createallsubdirs
+Source: {#StagePath}\{#RubyPath}\*; DestDir: {app}\{#RubyPath}; Flags: recursesubdirs createallsubdirs
+Source: {#StagePath}\Git\*; DestDir: {app}\Git; Flags: recursesubdirs createallsubdirs
+Source: {#StagePath}\DevKit\*; DestDir: {app}\DevKit; Flags: recursesubdirs createallsubdirs
Source: setvars.bat; DestDir: {app}
[Registry]

0 comments on commit 8964aa2

Please sign in to comment.