Class: Raykit::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/raykit/installer.rb

Class Method Summary collapse

Class Method Details

.make_msi(wxs_file, source_dir, msi_filename) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/raykit/installer.rb', line 5

def self.make_msi(wxs_file, source_dir, msi_filename)
  name = "#{File.basename(wxs_file, ".wxs")}"
  FileUtils.cp(wxs_file, "#{source_dir}/#{File.basename(wxs_file)}")
  Dir.chdir(source_dir) do
    run("candle #{File.basename(wxs_file)}")
    run("light #{name}.wixobj")
    FileUtils.cp("#{name}.msi", msi_filename)
    raise "#{msi_filename} does not exist" if !File.exist?(msi_filename)
    File.delete("#{name}.wixobj")
  end
end