Automate package installs with Chef on Windows - windows

I'm new to the Chef world, and I'm trying to come up with a solution to automate the installation of a few programs. I've found that installers can be run with the windows_package command, but that seems to only provide automation when the installer has a silent option. Is there a way to provide a series of clicks or a list of the buttons that should be pressed during the installation to automate those installers that do not have a silent mode.

There is nothing specifically in Chef for this. You would have to use a tool that does this like AutoIt. Chef can run AutoIt, but it doesn't implement those features itself.

Related

MECM Brosix Application Installer

I am running into an issue when trying to add Brosix as an application to MECM for quick and easy deployment upon imaging of a laptop. This requires the Brosix installer to run in unattended mode (aka silently/quietly) but I cannot find such a command when running the installer and I am also planning on running their installer with the /advanced command so that it installs for all users instead of a singular one. So far /silent has not worked for me and neither has /unattended when running these installers in cmd or Powershell.
It seems Brosix did not make support for silent or unattended installs using their advanced installer which installs for all users, although I was unable to confirm this from Brosix despite calling them and making a support ticket. Therefore, it seems the solution for MECM is to have it be a per-user install (that is silent normally) which is something you need to set up when you build it in MECM.

How to run an AutoIT script on Windows Node using Chef?

I'm attempting to install Applications (Adobe Reader, Access Database, etcetera) on a Windows Server 2012 R2 Node by using Chef to download compiled AutoIT scripts onto the Node along with the corresponding installers - I've been using this approach because not all .exe files have silent installers and in my (limited) experience sometime a GUI installer gives the user more control over the application, allowing a user to set an application to "Check for updates manually", etcetera.
The compiled AutoIT scripts I've made work perfectly, but Chef for some reason will not run these .exe files.
I've tried the following approaches with Chef (placing both the application installers and the AutoIT Compiled Scripts in 'C:\To_Install'):
powershell_script 'Run AutoIT installer with PowerShell' do
code <<-EOH
C:\\To_Install\\#{fileName}
EOH
end
and
execute 'Run AutoIT installer with CMD' do
command "C:\\To_Install\\#{fileName}"
end
I am positive that all the applications I wish to install have been transferred to the node without error, and Chef is interacting with the node properly in all other ways (setting the clock, changing user permissions and settings, creating directories, etcetera).
Is there something I've overlooked? Does Chef run .exe files through some different process than a typicall user would?
Thanks in advance!
Copying down from comments:
Yeah, so WinRM runs in a "headless session". Graphical tools generally won't work. I don't know of any good way around this. You'll need to fix your installers to have a true silent mode, or re-package them using MSI or Nuget.

How to I create a Windows service from a script, run as administrator

I have a Windows installer script for a Windows application I'm delivering to customers. I want to have the application installed as a Windows service.
I've been reading up on various ways to do this. The closest I've found that can do this from a command is sc.exe as described in Create windows service from executable here at Stackoverflow, but this command requires running it as administrator, which as far as I can tell, also requires submitting an administrator's password.
In my build script, there's no way to right-click and "run as administrator".
Is there any way to do this from a build script (I'm using my company's installation packager to do this, which uses Ant-like XML build files with an command and statements -- so, much like running at the Windows command line). If I could figure out a command-line implementation that my customers can use I could give them this package.
Thanks for any tips.
Scott

Unattended Installation of an EXE (Without user interaction)

Is there any scripting language available for creating Silent Installation (without giving input and clicking next, agree and finish)...? I want to do unattended installation of NewsGator.exe application in windows server, which scripting would be best..? Thanks in Advance for your reply.
NSIS provides the very simple /S flag for running installers.
It's also extremely easy to create a dead simple installer.
All the MSI installers can support silent installations supplying the input parameters thru the command line in the form of:
installer.exe /v/qn"PARAMETER=VALUE PARAMETER=VALUE"
try autoit, here is an example of how to automate a WinZip install :
http://www.autoitscript.com/autoit3/docs/tutorials/winzip/winzip.htm
I have used it to automate several installs in the company i work with, its pretty straight forward.

Install multiple softwares with one installer (install wrapper?)

I'm looking for a solution to run multiple setup files (.exe and .msi) in sequence without any user input. The idea is to have everyone in my workgroup to have the same development tools (eclipse, python, cygwin, etc) by running one installer. Besides creating a batch script, is there a software out there that could create such a wrapper of installers?
Thanks!
From my knowledge there aren't any tools which create this type of wrappers, or if there are they are not MSI-based. This is because Windows Installer is very restrictive when it comes to running multiple installers simultaneously.
You can try using a setup authoring tool which supports package prerequisites. This way you can create a dummy package which installs nothing, but still handles all the applications you want installed.
If you want some suggestions don't hesitate to contact me.

Resources