Class: Nbuild::MsiExecCmd
Instance Method Summary collapse
- #command ⇒ Object
- #execute_internal ⇒ Object
-
#initialize(params = {}) ⇒ MsiExecCmd
constructor
A new instance of MsiExecCmd.
Methods inherited from Cmd
Constructor Details
#initialize(params = {}) ⇒ MsiExecCmd
Returns a new instance of MsiExecCmd.
6 7 8 |
# File 'lib/nbuild/msi_exec_cmd.rb', line 6 def initialize params={} @params = params end |
Instance Method Details
#command ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/nbuild/msi_exec_cmd.rb', line 10 def command msi = @params[:msi] command = "/package" if @params[:install] command = "/uninstall" if @params[:uninstall] @params[:parameters] ||= {} parameters = @params[:parameters].map{|k,v| "#{k}=\"#{v}\""}.join(' ') "msiexec.exe #{command} \"#{msi}\" /passive #{parameters}" end |
#execute_internal ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/nbuild/msi_exec_cmd.rb', line 19 def execute_internal the_command = self.command puts "executing \"#{the_command}\"" process = Process.create(:command_line => the_command) puts "waiting for pid #{process.process_id}" Process.waitpid process.process_id end |