0

I have a MSOffice 2016 pro plus setup.exe in the chef node. I am trying to install it via PowerShell in my recipe. The kitchen converge succeeds but fails to install office. The test kitchen instance is windows2012. The install resource I used in the chef recipe is:

powershell_script 'Install_MSOffice' do
  guard_interpreter :powershell_script
  code <<-EOH
  "some-fake-path/setup.exe /config #{node['msoffice']['temp_dir']}/config.xml"
  EOH
  timeout 600
  only_if { File.exist?("#{node['msoffice']['temp_dir']}/config.xml") }
end

If I login to machine and manually run the command : some-fake-path/setup.exe /config some-fake-path/config.xml The installation kicks off and successfully completes. I don't know what I am doing wrong. Below is my config.xml:

<Configuration Product="ProPlus">
<Display Level="none" CompletionNotice="no" SupressModal="yes" NoCancel="yes" AcceptEula="yes" />
<USERNAME Value="ITS" />
<COMPANYNAME Value="some company" />
<Setting Id="AUTO_ACTIVATE" Value="1" />
<!-- <PIDKEY Value="YC7DKG2NP32QQC3J6H88GVGXT" /> -->
<Setting Id="SETUP_REBOOT" Value="IfNeeded" />
<INSTALLLOCATION Value="%ProgramFiles%\Microsoft Office" />
<Logging Type="Verbose" Path="c:/windows/temp/office_install.log" Template="office_install.log" />
<OptionState Id="ACCESSFiles" State="Local" Children="force" />
<OptionState Id="EXCELFiles" State="Local" Children="force" />
<OptionState Id="GrooveFiles" State="Absent" Children="force" />
<OptionState Id="GrooveFiles2" State="Local" Children="force" />
<OptionState Id="OneNoteFiles" State="Local" Children="force" />
<OptionState Id="OUTLOOKFiles" State="Local" Children="force" />
<OptionState Id="PPTFiles" State="Local" Children="force" />
<OptionState Id="PubPrimary" State="Local" Children="force" />
<OptionState Id="WORDFiles" State="Local" Children="force" />
<OptionState Id="XDOCSFiles" State="Absent" Children="force" />
<OptionState Id="LyncCoreFiles" State="Local" Children="force" />
<OptionState Id="SHAREDFiles" State="Local" Children="force" />
<OptionState Id="TOOLSFiles" State="Local" Children="force" />
</Configuration>

**
  • Below is the error log:

**

WER element [P2] is set to value [OSETUP.DLL]
WER element [P3] is set to value [16.0.4266.1001]
Catalyst execution began: 09/29/2017 14:09:25.
Parsing config.xml at: C:\Windows\Temp\s.xml
Preferred product specified in config.xml to be: PROPLUS
Parsed setting: AUTO_ACTIVATE with value: 1 in config.xml.
Parsed setting: SETUP_REBOOT with value: IfNeeded in config.xml.
Logging type verbose specified in config.xml.
Log directory: c:/windows/temp specified in config.xml
Log file template: office_install.log specified in config.xml
Display level none specified in config.xml.
Suppression of modal dialogs specified in config.xml.
Hide completion notice specified in config.xml.
Auto accept license specified in config.xml.
Disable of cancel button specified in config.xml.
COMPANYNAME specified in config.xml.
INSTALLLOCATION: "C:\Program Files\Microsoft Office" specified in config.xml.
USERNAME specified in config.xml.
Setupexe Resiliency Mode is set to [PerformIfApplicable]; thus Resiliency is [disabled] for the [InstallExecutionMode]
Searching for updated versions of resource files under the 'updates' folder [C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64\updates].
Found [0] resource files under the update folder.
Searching for default versions of resource files under the folder [C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64].
Resource File Manager : Found (CultureTag=en-US) resource file at [C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64\office.en-us\OSETUPUI.DLL].
Found [1] resource files under the default folder.
Resource File Manager : Current user's LCID is [1033].
Resource File Manager : Selecting resource file (File=C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64\office.en-us\OSETUPUI.DLL) for CultureTag [en-US].
Setup temp folder set to [C:\Users\TESTWO~1\AppData\Local\Temp\Setup000011dc].
 Running in [InstallExecutionMode]. Run from TEMP folder at Copying setup UI dll from "C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64\office.en-us\OSETUPUI.DLL" to "C:\Users\TESTWO~1\AppData\Local\Temp\Setup000011dc\OSETUPUI.DLL"
Copying branding xml from "C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64\office.en-us\BRANDING.XML" to "C:\Users\TESTWO~1\AppData\Local\Temp\Setup000011dc\BRANDING.XML"
Copying setup chm from "C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64\office.en-us\SETUP.CHM" to "C:\Users\TESTWO~1\AppData\Local\Temp\Setup000011dc\SETUP.CHM"
Loaded resource file [C:\Users\TESTWO~1\AppData\Local\Temp\Setup000011dc\OSETUPUI.DLL] (CultureTag=en-US).
WER element [SuppressModal] is set to value [false]
WER element [P1] is set to value [16.0.4266.1001]
Initializing branding xml at path C:\Users\TESTWO~1\AppData\Local\Temp\Setup000011dc\BRANDING.XML
Loaded Dll : C:\Windows\Temp\OFFICE16\ProPlus\x64\MicrosoftOfficeProPlus2016_x64\proplus.ww\OSETUP.DLL.
Catalyst version is : 16.0.4266.1001
JobExecutionMode is InstallExecutionMode.
Error: Failed to check free space in drive "" ErrorCode: 3(0x3). 
WER element [SuppressModal] is set to value [true]
WER element [P4] is set to value [3]
WER element [P7] is set to value [3]
WER element [P6] is set to value [Failed to check free space in drive "%s"]
WER element [P6] is converted to [556129D7]
Catalyst execution finished: 09/29/2017 14:09:25.  Return code: 3.  Exception caught: ErrorCodeOnly.
ERF: TickCount=60473734 Name=RunSetup Description=End function

Any suggestions?
coderanger
  • 52,400
  • 4
  • 52
  • 75
spunkyquagga
  • 81
  • 1
  • 11
  • I've never used Chef before but based on what I'm reading I think the failure in the PowerShell script is not getting passed to Chef when the script exits. If I run a script that fails in PowerShell the `$LASTEXITCODE` variable does not change. If you change the PowerShell scripto run `exit 999` check to see if Chef reports a failure then. – Persistent13 Sep 29 '17 at 22:07
  • The powershell doesnt fail. It executes without any error msg but the office install fails. The error log above is obtained when the office is installed. I think something is missing from my config.xml file – spunkyquagga Sep 29 '17 at 22:54
  • Do you have `elevated: true` in your Kitchen transport config already? – coderanger Oct 13 '17 at 15:02

0 Answers0