Hi
I am executing "ABC.msi" file through chef-recipe. This ABC.msi will create a directory with name ABC in c drive. In the same recipe, I am also accessing ABC directory. but I am getting below error:
[2018-09-07T01:51:00-07:00] ERROR: Remote chef-client error follows:
[2018-09-07T01:51:00-07:00] ERROR: SystemCallError: execute[Create_ABCService_Window_Service] (Hello::create_ABC_service line 8) had an error: SystemCallError: The directory name is invalid. - CreateProcessW
Recipe:
# Install ABC installer
execute 'ABC-installer' do
cwd "#{Chef::Config['file_cache_path']}/ABC"
command "ABC.msi"
end
# Create ABCService window service
execute 'Create_ABCService_Window_Service' do
cwd "C:/ABC/Server/bin/service"
command "installABCService.bat"
end
But when I am dividing the above recipe into two parts and executes them separately, then it is working fine:
recipe_1.rb
# Install ABC installer
execute 'ABC-installer' do
cwd "#{Chef::Config['file_cache_path']}/ABC"
command "ABC.msi"
end
recipe.rb_2.rb
# Create ABCService window service
execute 'Create_ABCService_Window_Service' do
cwd "C:/ABC/Server/bin/service"
command "installABCService.bat"
end