Class: InnoTask
- Includes:
- FileUtils
- Defined in:
- lib/rakeutils/innotask.rb
Overview
Implements programmatic control of the InnoSetup5 application.
Instance Method Summary collapse
-
#compile(dest_dir, filename, script) ⇒ Object
Compile setup script.
-
#find_app ⇒ Object
initialize.
-
#initialize ⇒ InnoTask
constructor
Constructor.
Methods inherited from CLApp
#execute, #normalize_dir_path, #quote_all_values, #quote_value, #rubyize_path, #windowize_path
Constructor Details
#initialize ⇒ InnoTask
Constructor
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rakeutils/innotask.rb', line 23 def initialize() super( find_app ) # Call parent constructor. app_path = find_app if app_path.nil? or app_path.empty? or !File.exist?(app_path) if Ktutils::OS.windows? # ISCC_EXE_PATH env var should point to the executable. # ie. "M:/Inno5.3.5/ISCC.exe" msg = "ISCC_EXE_PATH environment variable is not configured correctly " msg += "or Inno Setup is not installed." msg += "\nISCC not found" raise msg else msg = "iscc command not found. " msg += "See <https://katastrophos.net/andre/blog/2009/03/16/setting-up-the-inno-setup-compiler-on-debian/> " msg += "for instructions on installing Inno Setup in linux." msg += "\niscc not found" raise msg end end end |
Instance Method Details
#compile(dest_dir, filename, script) ⇒ Object
Compile setup script.
- dest_dir
-
destination directory
- filename
-
Output base filename
- script
-
Script to be compiled
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/rakeutils/innotask.rb', line 59 def compile(dest_dir, filename, script) dest_dir = File.( dest_dir ) script = File.( script ) # Make sure the paths are in windows format for the compiler. dest_dir = windowize_path( dest_dir ) script = windowize_path( script ) puts "dest_dir: #{dest_dir}" puts "filename: #{filename}" puts "script: #{script}" begin execute( cmd_line, false ) rescue Exception => e puts "!!! Errors occured during compilation of setup script." puts e. end end |
#find_app ⇒ Object
initialize
46 47 48 49 50 51 52 |
# File 'lib/rakeutils/innotask.rb', line 46 def find_app if Ktutils::OS.windows? app_path = ENV["ISCC_EXE_PATH"] else app_path = `which iscc`.chomp end end |