Skip to content
Browse files

build task depends on upx, package task depends on msi

  • Loading branch information...
1 parent 67d175a commit ce0b0b384c15e530d605f9f2e7378aff02a83552 @vertiginous committed Jan 22, 2011
Showing with 35 additions and 14 deletions.
  1. +1 −0 Rakefile
  2. +2 −2 lib/pik/installer.rb
  3. +2 −2 tasks/build.rb
  4. +24 −0 tasks/common.rb
  5. +6 −10 tasks/package.rb
View
1 Rakefile
@@ -41,6 +41,7 @@ PIM
end
+require 'tasks/common'
require 'tasks/package'
require 'tasks/build'
require 'tasks/cucumber'
View
4 lib/pik/installer.rb
@@ -7,15 +7,15 @@ module Pik
module Installer
def download_directory
- @download_dir ||= config.global.fetch(:download_dir, Pik.home + 'downloads')
+ @download_dir ||= Pik.home + 'downloads'
end
def download(package, opts={})
download_directory.mkpath
target = download_directory + opts.fetch(:filename, filename(package))
- Log.info "Downloading: #{package} \n to: #{target.windows}"
+ Log.info "Downloading: #{package} \n to: #{target.windows}"
URI.download(package, target.to_s, {:progress => true, :verbose => true})
return target
end
View
4 tasks/build.rb
@@ -8,7 +8,6 @@ def correct_version?
abort "You can only build pik with ruby-1.8.7-p330" unless correct_version?
-
EXE_VERSION = {
'version' => {
'file_version_number' => "#{Pik::VERSION}.0",
@@ -39,10 +38,11 @@ def correct_version?
file 'tools/pik_runner.exe', :needs => ['tools/pik_runner.exy'] do
Dir.chdir 'tools' do
sh('ruby -S exerb pik_runner.exy')
- sh('upx --lzma pik_runner.exe') unless ENV['QUICK']
+ sh('..\tmp\upx307w\upx --lzma pik_runner.exe') unless ENV['QUICK']
end
end
+desc 'lockds down gems for building exe'
task :lockdown do
ENV['ISOLATE_ENV'] = 'production'
Rake::Task['isolate:lockdown'].invoke('lib/vendor')
View
24 tasks/common.rb
@@ -0,0 +1,24 @@
+module Installer
+ include Pik::Installer
+ extend self
+
+ def download_and_extract(url, install_root)
+ file = download(url)
+ extract(install_root, file)
+ end
+
+end
+
+file 'tmp/upx307w/upx.exe' do
+ url = 'http://upx.sourceforge.net/download/upx307w.zip'
+ Installer.download_and_extract(url, Pathname('tmp'))
+end
+
+file 'tmp/wix/candle.exe' do
+ url = 'http://wix.sourceforge.net/releases/3.5.2430.0/wix35-binaries.zip'
+ Installer.download_and_extract(url, Pathname('tmp/wix'))
+end
+
+task :package, :needs => 'tmp/wix/candle.exe'
+
+task :build, :needs => 'tmp/upx307w/upx.exe'
View
16 tasks/package.rb
@@ -1,7 +1,7 @@
require 'uuid'
require 'rake/packagetask'
-task :package => [:rebuild, 'installer:package']
+task :package => [:build, 'installer:package']
Rake::PackageTask.new('pik-update', Pik::VERSION) do |p|
p.need_zip = true
@@ -31,23 +31,19 @@ def version_string
desc "packages the msi installer"
task :package, :needs => [msi_file, :light]
- task :build_env do
- ENV['PATH'] = "#{ENV['ProgramFiles(x86)']}\\Windows Installer XML v3.5\\bin;#{ENV['PATH']}"
- end
-
- task :candle, :needs => [:build_env] do
+ task :candle do
chdir 'lib/installer/' do
+ cmd = "../../tmp/wix/candle.exe -nologo"
wxs_files = ["MyInstallDirDialog.wxs",'WixUI_MyInstallDir.wxs' , "#{@package}.wxs"].join(' ')
- # wxs_files = ["#{@package}.wxs"].join(' ')
- sh("candle -nologo #{wxs_files}")
+ sh("#{cmd} #{wxs_files}")
end
end
task :light, :needs => :candle do
chdir 'lib/installer/' do
+ cmd = "../../tmp/wix/light.exe -nologo "
wixobj_files = ["MyInstallDirDialog.wixobj", 'WixUI_MyInstallDir.wixobj', "#{@package}.wixobj"].join(' ')
- # wixobj_files = ["#{@package}.wixobj"].join(' ')
- sh("light -nologo -ext WixUtilExtension -ext WixUIExtension #{wixobj_files} -o ../../#{msi_file}")
+ sh("#{cmd} -ext WixUtilExtension -ext WixUIExtension #{wixobj_files} -o ../../#{msi_file}")
end
end

0 comments on commit ce0b0b3

Please sign in to comment.
Something went wrong with that request. Please try again.