# Silent installations via Chef in Windows

**URL:** <https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420>\
**Category:** Chef Infra (archive)\
**Created:** [June 17, 2014, 10:57pm UTC](https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420 "2014-06-17T22:57:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenneth\_Barry](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@Kenneth\_Barry](https://discourse.chef.io/u/Kenneth_Barry)\
**Post date:** [June 17, 2014, 10:57pm UTC](https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420/1 "2014-06-17T22:57:10Z")

</div>

I can’t find much information about this. Been struggling to get it working.

Anyone aware of a tutorial on how to do this right, or even, what  
alternatives they are using to perform installations?

---

<div class="post-metadata">

**Author:** ![jdunn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jdunn/32/1800_2.png) [@jdunn](https://discourse.chef.io/u/jdunn)\
**Post date:** [June 18, 2014, 6:42am UTC](https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420/2 "2014-06-18T06:42:26Z")

</div>

On Tue, Jun 17, 2014 at 3:57 PM, Kenneth Barry [kbarry-x@tunein.com](mailto:kbarry-x@tunein.com) wrote:

> I can't find much information about this. Been struggling to get it working.
> 
> Anyone aware of a tutorial on how to do this right, or even, what  
> alternatives they are using to perform installations?

Are you talking about the silent installation of software in Windows?  
What software are you trying to install?

For MSIs, msiexec /qn has generally worked for me (using either the  
windows\_package resource or the built-in 'package' resource in Chef  
11.12.x) but results vary based on how terrible the software vendor  
is... Oracle Client for example is one that refuses to install  
unattended.

- Julian

--  
[Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
[WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
[gopher://sdf.org/1/users/keymaker/ \* compliant!]  
[PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

---

<div class="post-metadata">

**Author:** ![Kapil\_Shardha1](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Kapil\_Shardha1](https://discourse.chef.io/u/Kapil_Shardha1)\
**Post date:** [June 18, 2014, 1:40pm UTC](https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420/3 "2014-06-18T13:40:27Z")

</div>

Julian,

As per the documentation [windows\_package Resource](http://docs.opscode.com/resource_windows_package.html) , the new windows\_package (built-in) resource seems to lack some attributes, like "options", that we used to have before from windows cookbook. This attribute was used to pass in command-line arguments, such as "/qn" for silent installs for MSIs that allow it. Any idea on how to pass such arguments using this new built-in resource? I did not have much success with using "package" resource either, though I mentioned the windows provider in "provider" attribute. Also, is there a way to still use this resource from windows cookbook? (something like "include\_recipe 'windows'" in recipe perhaps?)

Kenneth, due to above mentioned issue and some other requirement, I had to use following alternative, using powershell\_resource. This will install the MSI silently and generate the verbose log for installation.

powershell\_script "Install MSI Silently " do  
code \<\<-EOH

```
$command = \"msiexec /qn /i \" + "#{installerFilePath}" + \" /L*vx #{msilogFilePath} 
Invoke-Expression -Command $command
	
EOH	

```

end

Thanks

-Kapil

-----Original Message-----  
From: Julian C. Dunn [[mailto:jdunn@aquezada.com](mailto:jdunn@aquezada.com)]  
Sent: Wednesday, June 18, 2014 2:42 AM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: Silent installations via Chef in Windows

On Tue, Jun 17, 2014 at 3:57 PM, Kenneth Barry [kbarry-x@tunein.com](mailto:kbarry-x@tunein.com) wrote:

> I can't find much information about this. Been struggling to get it working.
> 
> Anyone aware of a tutorial on how to do this right, or even, what  
> alternatives they are using to perform installations?

Are you talking about the silent installation of software in Windows?  
What software are you trying to install?

For MSIs, msiexec /qn has generally worked for me (using either the windows\_package resource or the built-in 'package' resource in Chef  
11.12.x) but results vary based on how terrible the software vendor is... Oracle Client for example is one that refuses to install unattended.

- Julian

--  
[Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
[WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
[gopher://sdf.org/1/users/keymaker/ \* compliant!]  
[PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

---

<div class="post-metadata">

**Author:** ![Kenneth\_Barry](https://avatars.discourse-cdn.com/v4/letter/k/3da27b/32.png) [@Kenneth\_Barry](https://discourse.chef.io/u/Kenneth_Barry)\
**Post date:** [June 18, 2014, 2:11pm UTC](https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420/4 "2014-06-18T14:11:03Z")

</div>

Thanks for the reply. Been banging my head over this one. I'll give it a shot today, and see we hat I come up with. Curios to see what the /L\*vx means.

> On Jun 18, 2014, at 6:40 AM, Kapil Shardha [Kapil.Shardha@SimulationIQ.com](mailto:Kapil.Shardha@SimulationIQ.com) wrote:
> 
> Julian,
> 
> As per the documentation [windows\_package Resource](http://docs.opscode.com/resource_windows_package.html) , the new windows\_package (built-in) resource seems to lack some attributes, like "options", that we used to have before from windows cookbook. This attribute was used to pass in command-line arguments, such as "/qn" for silent installs for MSIs that allow it. Any idea on how to pass such arguments using this new built-in resource? I did not have much success with using "package" resource either, though I mentioned the windows provider in "provider" attribute. Also, is there a way to still use this resource from windows cookbook? (something like "include\_recipe 'windows'" in recipe perhaps?)
> 
> Kenneth, due to above mentioned issue and some other requirement, I had to use following alternative, using powershell\_resource. This will install the MSI silently and generate the verbose log for installation.
> 
> powershell\_script "Install MSI Silently " do  
> code \<\<-EOH
> 
> $command = "msiexec /qn /i " + "#{installerFilePath}" + " /L\*vx #{msilogFilePath}  
> Invoke-Expression -Command $command
> 
> EOH  
> end
> 
> Thanks
> 
> -Kapil
> 
> -----Original Message-----  
> From: Julian C. Dunn [[mailto:jdunn@aquezada.com](mailto:jdunn@aquezada.com)]  
> Sent: Wednesday, June 18, 2014 2:42 AM  
> To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: Silent installations via Chef in Windows
> 
> > On Tue, Jun 17, 2014 at 3:57 PM, Kenneth Barry [kbarry-x@tunein.com](mailto:kbarry-x@tunein.com) wrote:  
> > I can't find much information about this. Been struggling to get it working.
> > 
> > Anyone aware of a tutorial on how to do this right, or even, what  
> > alternatives they are using to perform installations?
> 
> Are you talking about the silent installation of software in Windows?  
> What software are you trying to install?
> 
> For MSIs, msiexec /qn has generally worked for me (using either the windows\_package resource or the built-in 'package' resource in Chef  
> 11.12.x) but results vary based on how terrible the software vendor is... Oracle Client for example is one that refuses to install unattended.
> 
> - Julian
> 
> --  
> [Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
> [WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
> [gopher://sdf.org/1/users/keymaker/ \* compliant!]  
> [PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

---

<div class="post-metadata">

**Author:** ![Kapil\_Shardha1](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Kapil\_Shardha1](https://discourse.chef.io/u/Kapil_Shardha1)\
**Post date:** [June 18, 2014, 2:35pm UTC](https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420/5 "2014-06-18T14:35:51Z")

</div>

Kenneth,

For msi installers, "/L\*vx" command-line switch indicates verbose logging.

> **[Command-Line Options - Win32 apps](https://learn.microsoft.com/en-us/windows/win32/msi/command-line-options?redirectedfrom=MSDN)**
>
> Command-line options for msiexec.exe for Windows Installer 3.0 and earlier. Provides a table showing options, parameters, and descriptions. Examples showing how to install products and other tasks.

-Kapil

-----Original Message-----  
From: Kenneth Barry [[mailto:kbarry-x@tunein.com](mailto:kbarry-x@tunein.com)]  
Sent: Wednesday, June 18, 2014 10:11 AM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: RE: Re: Silent installations via Chef in Windows

Thanks for the reply. Been banging my head over this one. I'll give it a shot today, and see we hat I come up with. Curios to see what the /L\*vx means.

> On Jun 18, 2014, at 6:40 AM, Kapil Shardha [Kapil.Shardha@SimulationIQ.com](mailto:Kapil.Shardha@SimulationIQ.com) wrote:
> 
> Julian,
> 
> As per the documentation  
> [windows\_package Resource](http://docs.opscode.com/resource_windows_package.html) , the new  
> windows\_package (built-in) resource seems to lack some attributes,  
> like "options", that we used to have before from windows cookbook.  
> This attribute was used to pass in command-line arguments, such as  
> "/qn" for silent installs for MSIs that allow it. Any idea on how to  
> pass such arguments using this new built-in resource? I did not have  
> much success with using "package" resource either, though I mentioned  
> the windows provider in "provider" attribute. Also, is there a way to  
> still use this resource from windows cookbook? (something like  
> "include\_recipe 'windows'" in recipe perhaps?)
> 
> Kenneth, due to above mentioned issue and some other requirement, I had to use following alternative, using powershell\_resource. This will install the MSI silently and generate the verbose log for installation.
> 
> powershell\_script "Install MSI Silently " do  
> code \<\<-EOH
> 
> $command = "msiexec /qn /i " + "#{installerFilePath}" + " /L\*vx #{msilogFilePath}  
> Invoke-Expression -Command $command
> 
> EOH  
> end
> 
> Thanks
> 
> -Kapil
> 
> -----Original Message-----  
> From: Julian C. Dunn [[mailto:jdunn@aquezada.com](mailto:jdunn@aquezada.com)]  
> Sent: Wednesday, June 18, 2014 2:42 AM  
> To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: Silent installations via Chef in Windows
> 
> > On Tue, Jun 17, 2014 at 3:57 PM, Kenneth Barry [kbarry-x@tunein.com](mailto:kbarry-x@tunein.com) wrote:  
> > I can't find much information about this. Been struggling to get it working.
> > 
> > Anyone aware of a tutorial on how to do this right, or even, what  
> > alternatives they are using to perform installations?
> 
> Are you talking about the silent installation of software in Windows?  
> What software are you trying to install?
> 
> For MSIs, msiexec /qn has generally worked for me (using either the  
> windows\_package resource or the built-in 'package' resource in Chef  
> 11.12.x) but results vary based on how terrible the software vendor is... Oracle Client for example is one that refuses to install unattended.
> 
> - Julian
> 
> --  
> [Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
> [WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
> [gopher://sdf.org/1/users/keymaker/ \* compliant!]  
> [PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]

---

<div class="post-metadata">

**Author:** ![jdunn](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jdunn/32/1800_2.png) [@jdunn](https://discourse.chef.io/u/jdunn)\
**Post date:** [June 18, 2014, 7:08pm UTC](https://discourse.chef.io/t/silent-installations-via-chef-in-windows/5420/6 "2014-06-18T19:08:44Z")

</div>

On Wed, Jun 18, 2014 at 6:40 AM, Kapil Shardha  
[Kapil.Shardha@simulationiq.com](mailto:Kapil.Shardha@simulationiq.com) wrote:

> As per the documentation [windows\_package Resource](http://docs.opscode.com/resource_windows_package.html) , the new windows\_package  
> (built-in) resource seems to lack some attributes, like "options", that we used to have before from windows cookbook.  
> This attribute was used to pass in command-line arguments, such as "/qn" for silent installs for MSIs that allow it. Any  
> idea on how to pass such arguments using this new built-in resource? I did not have much success with using "package"  
> resource either, though I mentioned the windows provider in "provider" attribute. Also, is there a way to still use this  
> resource from windows cookbook? (something like "include\_recipe 'windows'" in recipe perhaps?)

There is still an 'options' parameter that you can set to whatever  
extra flags you want msiexec to use. Looks like it is missing from the  
documentation; I'll have that corrected.

And yes, you can still use the old windows\_package provider from the  
cookbook. Depending on it in metadata in your cookbook will override  
the provider in core and allow you to install packages the old way,  
plus supports Inno, Installshield, etc. that we haven't gotten around  
to adding to core yet.

BTW, I have had lots of problems with msiexec generally (outside of  
Chef) and UAC. If you try to install an MSI using msiexec from a  
package that resides in a UAC-protected directory (example:  
C:\Users\jdunn\Downloads), it will silently fail and even /l\* doesn't  
log anything. ☹

- Julian

--  
[Julian C. Dunn [jdunn@aquezada.com](mailto:jdunn@aquezada.com) \* Sorry, I'm ]  
[WWW: [Julian Dunn's Blog - Commentary on media, technology, and everything in between.](http://www.aquezada.com/staff/julian) \* only Web 1.0 ]  
[gopher://sdf.org/1/users/keymaker/ \* compliant!]  
[PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9]
