Class: Wix

Inherits:
Object
  • Object
show all
Defined in:
lib/apps/wix.rb

Class Method Summary collapse

Class Method Details

.get_build_commands(wxs_file) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/apps/wix.rb', line 7

def self.get_build_commands wxs_file
  build_commands=nil
  if(File.exists?(wxs_file))
        ext='msi'
        ext='exe' if(IO.read(wxs_file).include?('<Bundle'))
        extensions=''
        ['WixNetFxExtension','WixBalExtension','WixUtilExtension','WixUiExtension'].each{|e|
              extensions="#{extensions}-ext #{e} "
        }
  	build_commands=Array.new if build_commands.nil?
  	build_commands << "candle #{wxs_file} #{extensions}"
        
  	if(defined?(VERSION))
  		build_commands << "light #{File.basename(wxs_file,'.*')}.wixobj -out #{File.basename(wxs_file,'.*')}-#{VERSION}.#{ext} #{extensions}"
  	else
  		build_commands << "light #{File.basename(wxs_file,'.*')}.wixobj #{extensions}"
  	end
  end
  build_commands
end