Ansible 2.7 on windows 2012 does not accept /norestart option - windows

I am experiencing a problem with /norestart option on Windows 2012, using ansible. Below is the code
win_package:
product_id: auto
path: 'C:\Path\to\file\file.exe'
become_method: runas
arguments: /silent /norestart
ensure: present
expected_return_code: [0,3010]
It installs software in silent mode, which automatically reboots the system. I want to avoid this reboot, but the norestart option is not working at all. Do you have any suggestions ?

the win_package module doesn't strip away commands, this would be an issue with the exe itself, if you add the actual program name it would help but I suggest running it yourself and see if it behaves the same or contact the vendor

Related

Microsoft Deployment Workbench chocolatey problem

I am currently testing Microsoft Deployment Workbench for automated Windows installation.
I have created a workflow with Windows 11 and would like to install the various programs via chocolatey after the Windows 11 installation.
Here you can see my workflow:
chocolatey is installed with a .bat script using:
command line: cmd.exe /c "%SCRIPTROOT%\BTNHD\chocoinstall.bat"
with the following content:
#powershell -noProfile -ExecutionPolicy unrestricted -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
then we restart the computer
then the script is started with the different programs, which looks like this:
command line: cmd.exe /c "%SCRIPTROOT%\BTNHD\installtemplate.bat"
with the following content:
choco install firefox --yes
choco install vlc --yes
Unfortunately it installs only the first software in the list at step 3, in my case Firefox and after that it takes a while and aborts with these error messages:
Now I have already tried the following things:
the reboot removed unfortunately no improvement
for each program a separate script and accordingly a separate installation step
tested other programs
changed the script
unfortunately there is nothing in the chocolatey log that can help me.
If I start the script manually, but everything works fine.
I currently do not know what to do and hope someone can help me, if there is any information missing, please let me know.
Thank you!

Windows 7 embedded

Due to turn windows features on or off is blank, so I need to install IIS using command line, How can I install default IIS using command line?
I have found a solution to it. See: http://reboot.pro/topic/16383-windows-embedded-standard-7-add-packages-on-a-live-image/
Basically you need to get the .cab package from the installation dvd and then feed it to DISM, like: DISM.exe /online /Add-Package /PackagePath:C:\Temp /NoRestart
Have you try to use the optionalfeatures command? Are you administrator on the computer?
Also you can try the DISM if the above doesn't work for you.

Why does this command line restart Windows 7?

I'm writing an automated, deplorable script that uninstalls Windows 10 related updates and files from Windows 7, 8, and 8.1. However, when I run the following command line in Windows 7, It initiates a system reboot within a minute, leaving the rest of the script to be interrupted in the process.
wusa /uninstall /kb:******* /quiet
What exactly is going on? Windows 8.1 handles it fine, but Windows 7 always seems to shutdown mid-script. As a side note, the update will in fact be uninstalled once the system preps back up. When running the command without /quiet at the end, there is an uninstall confirmation box, and then one after that which asks to reboot now or later. Could it be that the /quiet command is selecting "Restart Now"? If so, how can I select "Restart Later" without having a prompt appear?
As described in KB934307, an unattended installation (or uninstallation) will by default reboot automatically if one is needed to complete the operation.
Use the /norestart option to prevent that from happening.
If you do use /norestart, make sure you check the return value. This will be 3010 if a restart is needed or 0 if no restart is needed; any other value indicates that the operation failed. At the end of the script, if any of the changes returned 3010 you should reboot the machine or advise the user to do so.

Can I make a custom MSI that includes Vagrant, VirtualBox and other dependencies?

Summary: I want to figure out a way to automate the installation of a project and it's dependencies onto the Windows(7, 8) platform. In particular I want to install all the dependencies required to "vagrant up", and I want to distribute this to my team members.
Problems: I have considered using a freeware tool ( http://www.advancedinstaller.com/ ) to help me create an MSI. However i think vagrant is now only available to download with specialized MSI installers. see http://mitchellh.com/abandoning-rubygems
In addition to needing vagrant, I want to automate the installation of oracle virtualbox, and we need a few vagrant plugins.
I also want to include the project itself.I have a vagrantfile that has been tested and works well.
Restatment of the problem:
In other words, since Vagrant appears to provide only MSI installers for Windows, I don't know if it is still possible to create a custom msi that includes the other items I want. If it were possible I don't know how to do it. If there is a better way than using MSI, pease tell.
A Windows Installer package is not meant to be a recursive structure.
Try a WiX's Bootstrapper project to create an EXE with chained sub-installers. It uses the WiX burn engine, which is a bootstrapper, downloader (optional), bundler (optional embedding), chainer, reboot manager, package manager.
If you use Advanced Installer (as you mentioned) you can add Vagrant, VirtualBox and the other dependencies in the "Prerequisites" page to as described in their tutorials:
http://www.advancedinstaller.com/user-guide/tutorial-professional.html#prerequisites
You can automate their installation by setting command lines for them.
Have you tried using something like Chocolatey?
I've used it before to create BAT scripts to do the installation of Virtual Box and Vagrant on Windows 7.
Something like the following could be a place to start:
#echo off
if not exist C:\Chocolatey goto InstallChocolatey
echo Chocolatey already installed.
goto:InstallPrograms
:InstallChocolatey
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
:InstallPrograms
call cinst chocolatey
call cinst virtualbox
call cinst vagrant

Suppress the reboot prompt for the .NET 3.5 SP1 redist

I have an InstallShield 2009 Basic MSI project that I've modified to load the 3.5 SP1 redistributable for the .NET framework. It loads fine but as soon as it finishes it displays a prompt saying the system has to reboot, and you can either say yes and it will reboot, or no and it will stop the install.
I then went in and edited the .NET Framework 3.5 Service Pack 1 (Web Download) redistributable using InstallShield's prerequisite editor. I changed the behavior if it needs a reboot to 'Note it, fail to resume if the machine is rebooted, and reboot after the installation'. I interpreted that as meaning the reboot prompt would not be shown until the end of the install, but it still showed up in the same place.
Is there a way to suppress the prompt until the end of the install? Do I need to pick a different option from that drop-down in the pre-req editor?
Bonus question: if I need to run my install unattended, is there a way to automatically have it reboot after the entire install is finished if one is needed?
EDIT:
The command switches mentioned below would probably work, but in the case of running the install unattended it will be launched from another program, and I really don't want to modify that app just for this one case. Here's a better question: is a reboot really required after installing .NET 3.5 SP1, or is it one of those things where a reboot would be good but is not absolutely needed for programs to start using the 3.5 framework?
If you type msiexec /? in the Start -> Run box, you'll get a screen with command line options for the MSI runtime, including the following:
Restart Options
/norestart
Do not restart after the installation is complete
/promptrestart
Prompts the user for restart if necessary
/forcerestart
Always restart the computer after installation
You can suppress the reboot prompt entirely by adding the following to the MSI's setup command line:
REBOOT=ReallySuppress
But then it won't prompt at the end of your complete install, as it sounds like you were hoping for; you're just stopping the prompting altogether.
As for your additional question, you can force a reboot with the following switch:
REBOOT=Force REBOOTPROMPT=Supress
Here you're telling the Windows Installer to prompt for a reboot always, and then suppressing the prompt so it just happens.

Resources