I'm probably trying to do something stupid, but I have been writing roles to install applications via WinGet (Windows package manager) and via ansible.windows.win_command. I am on WSL2 (Ubuntu) connecting to Windows 10 on the same computer. This is working for the most part, but some roles are returning error which I think I have fixed with ignore_errors: yes.
However, I think some are launching error dialogs even when running WinGet in silent mode and as the application installer is waiting on user input, the task never completes. Should I use async and poll or what can I do? I am mostly interested in having as many applications installed via WinGet via Ansible until there is WinGet support. If a role fails I can install via WinGet manually, but I want the playbook with all the roles to run to the end at least.
You may be getting hit by the dialog to accept source agreements or package agreements.
You can either pass the flags as suggested or you could try the EXPECT module.
Related
Am on Windows 11. Once in a while, winget, the Windows Package manager, suddenly begins installing Postgres v14 without my consent as seen in this screenshot. I already have Postgres 12 and do not want an automatic install of v14. How do I prevent it from doing so?
The Windows Package Manager (a.k.a. WinGet) is a command line tool. It doesn't take action without a user running a command. There are several open-source utilities that leverage WinGet and one of those may have automatic processes.
I suggest looking to see if you have something else installed that is calling WinGet programmatically.
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.
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
I have a windows server 2003 up in the internet.
But sometime I need to restart it.
After restart, I want one of the applications to run.
I want to do this all programatically.
I can now remotely restart the server.
But the question is how can I ask that piece of software to be executed (more precisely, I want to execute a .BAT file to ask a tomcat to run)?
Because I don't want to manually log in to the machine and start that application. That is time consuming. Is there any possible way, once the machine is started, my application will be run as well?
If you're developing an application that should always be running on the server, you probably need to implement it as a Windows service. For C#, see the classes in the System.ServiceProcess namespace -- you will need to inherit from ServiceBase.
Alternatively, you can set the program to be run as a scheduled task on boot. See the Task Scheduler API to do this.
You can install Cygwin and then do it the same way we'd do it on a Linux box: via ssh, using keys.
OpenSSH is not part of the default Cygwin install, so be sure to select it. It's in the Net category.
Then, after you've installed Cygwin and sshd, read /usr/share/doc/Cygwin/openssh.README to learn how to set up sshd as a service, so it will answer requests automatically, without you having to start the ssh daemon manually.
Finally, set up keys, as described in the link above.
Part of the ssh protocol is a way to ask a remote machine to launch a program. Setting it up with keys lets you do it without needing a password.
You could try xCmd, which is a freeware app to run a command on a remote machine.
we are trying to create an MSI Installer for an app which under Windows Server 2003. The app needs users to be able to log on via Remote Desktop. Using the "TerminalServer" property looked like the correct test to ensure that's the case, but this returns "false" on machines which do have the right OS with Terminal Service running and which allow users to connect remotely.
What are we missing here?
Thanks!
Armin
IIUC, you actually do need Terminal Services installed and "on"; remote desktop might not be enough. Try also RemoteAdminTS. MSI documentation suggests they are mutually exclusive.
Run the MSI file with /l*v to find out what properties are set to what values.