Windows Programs Won T Run

broken image


Note: Use these steps for Windows programs. If you're having problems with an app you got from Microsoft Store, go to Fix problems with apps from Microsoft Store.

  1. Programs Won't Run In Xp
  2. Windows Programs Won't Run
  • You can repair some apps and programs if they're not running correctly. Note that you won't see repair, change, or modify options for all apps and programs. Repair options from the Settings page. Select Start Settings Apps Apps & features. Or just click the shortcut link at the bottom of this article. Select the app you want to fix.
  • Block you from uninstalling a program through Add or Remove Programs (or Programs and Features) in Control Panel. If you're trying to remove malware, you can use Windows Security (or another antivirus tool), or you can use the Windows Malicious Software Removal tool.

The Program Install and Uninstall troubleshooter helps you automatically repair issues when you're blocked from installing or removing programs. It also fixes corrupted registry keys.

First, you'll need to download the troubleshooter.

Because of this, there are dedicated Windows modules that are written in PowerShell and are meant to be run on Windows hosts. A list of these modules can be found here. In addition, the following Ansible Core modules/action-plugins work with Windows: addhost. Program won't run on Windows 10. 4 years ago 18 July 2016. 3 replies; 541 views A aboubenadhem Fresh Face; 1 reply Just upgraded PC to Windows 10 - Webroot now won't run, says incompatible???? Like Quote Share Tweet Share Share 3 replies. Program won't run on Windows 10. 4 years ago 18 July 2016. 3 replies; 527 views A aboubenadhem Fresh Face; 1 reply Just upgraded PC to Windows 10 - Webroot now won't.

If you see the File Download box when you start downloading, select Run or Open.

The troubleshooter provides steps for you to follow. If a program isn't listed in the uninstall options, you'll be asked for that program's product code. To access the code, you'll need a tool for reading MSI files—which is typically available to IT professionals. You'll find the product code in the property table of the MSI file.

What it fixes

The troubleshooter helps fix problems that:

  • Corrupt registry keys on 64-bit operating systems.

  • Corrupt registry keys that control the update data.

  • Prevent new programs from being installed.

  • Prevent existing programs from being completely uninstalled or updated.

  • Block you from uninstalling a program through Add or Remove Programs (or Programs and Features) in Control Panel.

If you're trying to remove malware, you can use Windows Security (or another antivirus tool), or you can use the Windows Malicious Software Removal tool.

Runs on

  • Windows 10

  • Windows 8.1

  • Windows 8

  • Windows 7

Related links

Here are some commonly asked questions in regards to Ansible and Windows andtheir answers.

Note

This document covers questions about managing Microsoft Windows servers with Ansible.For questions about Ansible Core, please see thegeneral FAQ page.

Does Ansible work with Windows XP or Server 2003?¶

Ansible does not work with Windows XP or Server 2003 hosts. Ansible does work with these Windows operating system versions:

  • Windows Server 2008 1

  • Windows Server 2008 R2 1

  • Windows Server 2012

  • Windows Server 2012 R2

  • Windows Server 2016

  • Windows Server 2019

  • Windows 7 1

  • Windows 8.1

  • Windows 10

1 - See the Server 2008 FAQ entry for more details.

Ansible also has minimum PowerShell version requirements - please seeSetting up a Windows Host for the latest information.

Are Server 2008, 2008 R2 and Windows 7 supported?¶

Microsoft ended Extended Support for these versions of Windows on January 14th, 2020, and Ansible deprecated official support in the 2.10 release. No new feature development will occur targeting these operating systems, and automated testing has ceased. However, existing modules and features will likely continue to work, and simple pull requests to resolve issues with these Windows versions may be accepted.

Can I manage Windows Nano Server with Ansible?¶

Ansible does not currently work with Windows Nano Server, since it doesnot have access to the full .NET Framework that is used by the majority of themodules and internal components.

Can Ansible run on Windows?¶

No, Ansible can only manage Windows hosts. Ansible cannot run on a Windows hostnatively, though it can run under the Windows Subsystem for Linux (WSL).

Note

The Windows Subsystem for Linux is not supported by Ansible andshould not be used for production systems.

Windows

To install Ansible on WSL, the following commandscan be run in the bash terminal:

To run Ansible from source instead of a release on the WSL, simply uninstall the pipinstalled version and then clone the git repo.

Can I use SSH keys to authenticate to Windows hosts?¶

You cannot use SSH keys with the WinRM or PSRP connection plugins.These connection plugins use X509 certificates for authentication insteadof the SSH key pairs that SSH uses.

The way X509 certificates are generated and mapped to a user is differentfrom the SSH implementation; consult the Windows Remote Management documentation formore information.

Ansible 2.8 has added an experimental option to use the SSH connection plugin,which uses SSH keys for authentication, for Windows servers. See this questionfor more information.

Why can I run a command locally that does not work under Ansible?¶

Ansible executes commands through WinRM. These processes are different fromrunning a command locally in these ways:

  • Unless using an authentication option like CredSSP or Kerberos withcredential delegation, the WinRM process does not have the ability todelegate the user's credentials to a network resource, causing AccessisDenied errors.

  • All processes run under WinRM are in a non-interactive session. Applicationsthat require an interactive session will not work.

  • When running through WinRM, Windows restricts access to internal WindowsAPIs like the Windows Update API and DPAPI, which some installers andprograms rely on.

Some ways to bypass these restrictions are to:

  • Use become, which runs a command as it would when run locally. This willbypass most WinRM restrictions, as Windows is unaware the process is runningunder WinRM when become is used. See the Understanding privilege escalation: become documentation for moreinformation.

  • Use a scheduled task, which can be created with win_scheduled_task. Likebecome, it will bypass all WinRM restrictions, but it can only be used to runcommands, not modules.

  • Use win_psexec to run a command on the host. PSExec does not use WinRMand so will bypass any of the restrictions.

  • To access network resources without any of these workarounds, you can useCredSSP or Kerberos with credential delegation enabled.

See Understanding privilege escalation: become more info on how to use become. The limitations section atWindows Remote Management has more details around WinRM limitations.

This program won't install on Windows with Ansible¶

Programs Won't Run In Xp

See this question for more information about WinRM limitations.

What Windows modules are available?¶

Most of the Ansible modules in Ansible Core are written for a combination ofLinux/Unix machines and arbitrary web services. These modules are written inPython and most of them do not work on Windows.

Windows Programs Won't Run

Because of this, there are dedicated Windows modules that are written inPowerShell and are meant to be run on Windows hosts. A list of these modulescan be found here.

In addition, the following Ansible Core modules/action-plugins work with Windows:

  • add_host

  • assert

  • async_status

  • debug

  • fail

  • fetch

  • group_by

  • include

  • include_role

  • include_vars

  • meta

  • pause

  • raw

  • script

  • set_fact

  • set_stats

  • setup

  • slurp

  • template (also: win_template)

  • wait_for_connection

Can I run Python modules on Windows hosts?¶

No, the WinRM connection protocol is set to use PowerShell modules, so Pythonmodules will not work. A way to bypass this issue to usedelegate_to:localhost to run a Python module on the Ansible controller.This is useful if during a playbook, an external service needs to be contactedand there is no equivalent Windows module available.

Can I connect to Windows hosts over SSH?¶

Ansible 2.8 has added an experimental option to use the SSH connection pluginto manage Windows hosts. To connect to Windows hosts over SSH, you must install and configure the Win32-OpenSSHfork that is in development with Microsoft onthe Windows host(s). While most of the basics should work with SSH,Win32-OpenSSH is rapidly changing, with new features added and bugsfixed in every release. It is highly recommend you install the latest releaseof Win32-OpenSSH from the GitHub Releases page when using it with Ansibleon Windows hosts.

To use SSH as the connection to a Windows host, set the following variables inthe inventory:

The value for ansible_shell_type should either be cmd or powershell.Use cmd if the DefaultShell has not been configured on the SSH serviceand powershell if that has been set as the DefaultShell.

Why is connecting to a Windows host via SSH failing?¶

Unless you are using Win32-OpenSSH as described above, you must connect toWindows hosts using Windows Remote Management. If your Ansible output indicates thatSSH was used, either you did not set the connection vars properly or the host is not inheriting them correctly.

Make sure ansible_connection:winrm is set in the inventory for the Windowshost(s).

Why are my credentials being rejected?¶

This can be due to a myriad of reasons unrelated to incorrect credentials.

See HTTP 401/Credentials Rejected at Setting up a Windows Host for a more detailedguide of this could mean.

Why am I getting an error SSL CERTIFICATE_VERIFY_FAILED?¶

When the Ansible controller is running on Python 2.7.9+ or an older version of Python thathas backported SSLContext (like Python 2.7.5 on RHEL 7), the controller will attempt tovalidate the certificate WinRM is using for an HTTPS connection. If thecertificate cannot be validated (such as in the case of a self signed cert), it willfail the verification process.

To ignore certificate validation, addansible_winrm_server_cert_validation:ignore to inventory for the Windowshost.

See also

Windows Guides

The Windows documentation index

Intro to playbooks

An introduction to playbooks

Windows Programs Won T Run

To install Ansible on WSL, the following commandscan be run in the bash terminal:

To run Ansible from source instead of a release on the WSL, simply uninstall the pipinstalled version and then clone the git repo.

Can I use SSH keys to authenticate to Windows hosts?¶

You cannot use SSH keys with the WinRM or PSRP connection plugins.These connection plugins use X509 certificates for authentication insteadof the SSH key pairs that SSH uses.

The way X509 certificates are generated and mapped to a user is differentfrom the SSH implementation; consult the Windows Remote Management documentation formore information.

Ansible 2.8 has added an experimental option to use the SSH connection plugin,which uses SSH keys for authentication, for Windows servers. See this questionfor more information.

Why can I run a command locally that does not work under Ansible?¶

Ansible executes commands through WinRM. These processes are different fromrunning a command locally in these ways:

  • Unless using an authentication option like CredSSP or Kerberos withcredential delegation, the WinRM process does not have the ability todelegate the user's credentials to a network resource, causing AccessisDenied errors.

  • All processes run under WinRM are in a non-interactive session. Applicationsthat require an interactive session will not work.

  • When running through WinRM, Windows restricts access to internal WindowsAPIs like the Windows Update API and DPAPI, which some installers andprograms rely on.

Some ways to bypass these restrictions are to:

  • Use become, which runs a command as it would when run locally. This willbypass most WinRM restrictions, as Windows is unaware the process is runningunder WinRM when become is used. See the Understanding privilege escalation: become documentation for moreinformation.

  • Use a scheduled task, which can be created with win_scheduled_task. Likebecome, it will bypass all WinRM restrictions, but it can only be used to runcommands, not modules.

  • Use win_psexec to run a command on the host. PSExec does not use WinRMand so will bypass any of the restrictions.

  • To access network resources without any of these workarounds, you can useCredSSP or Kerberos with credential delegation enabled.

See Understanding privilege escalation: become more info on how to use become. The limitations section atWindows Remote Management has more details around WinRM limitations.

This program won't install on Windows with Ansible¶

Programs Won't Run In Xp

See this question for more information about WinRM limitations.

What Windows modules are available?¶

Most of the Ansible modules in Ansible Core are written for a combination ofLinux/Unix machines and arbitrary web services. These modules are written inPython and most of them do not work on Windows.

Windows Programs Won't Run

Because of this, there are dedicated Windows modules that are written inPowerShell and are meant to be run on Windows hosts. A list of these modulescan be found here.

In addition, the following Ansible Core modules/action-plugins work with Windows:

  • add_host

  • assert

  • async_status

  • debug

  • fail

  • fetch

  • group_by

  • include

  • include_role

  • include_vars

  • meta

  • pause

  • raw

  • script

  • set_fact

  • set_stats

  • setup

  • slurp

  • template (also: win_template)

  • wait_for_connection

Can I run Python modules on Windows hosts?¶

No, the WinRM connection protocol is set to use PowerShell modules, so Pythonmodules will not work. A way to bypass this issue to usedelegate_to:localhost to run a Python module on the Ansible controller.This is useful if during a playbook, an external service needs to be contactedand there is no equivalent Windows module available.

Can I connect to Windows hosts over SSH?¶

Ansible 2.8 has added an experimental option to use the SSH connection pluginto manage Windows hosts. To connect to Windows hosts over SSH, you must install and configure the Win32-OpenSSHfork that is in development with Microsoft onthe Windows host(s). While most of the basics should work with SSH,Win32-OpenSSH is rapidly changing, with new features added and bugsfixed in every release. It is highly recommend you install the latest releaseof Win32-OpenSSH from the GitHub Releases page when using it with Ansibleon Windows hosts.

To use SSH as the connection to a Windows host, set the following variables inthe inventory:

The value for ansible_shell_type should either be cmd or powershell.Use cmd if the DefaultShell has not been configured on the SSH serviceand powershell if that has been set as the DefaultShell.

Why is connecting to a Windows host via SSH failing?¶

Unless you are using Win32-OpenSSH as described above, you must connect toWindows hosts using Windows Remote Management. If your Ansible output indicates thatSSH was used, either you did not set the connection vars properly or the host is not inheriting them correctly.

Make sure ansible_connection:winrm is set in the inventory for the Windowshost(s).

Why are my credentials being rejected?¶

This can be due to a myriad of reasons unrelated to incorrect credentials.

See HTTP 401/Credentials Rejected at Setting up a Windows Host for a more detailedguide of this could mean.

Why am I getting an error SSL CERTIFICATE_VERIFY_FAILED?¶

When the Ansible controller is running on Python 2.7.9+ or an older version of Python thathas backported SSLContext (like Python 2.7.5 on RHEL 7), the controller will attempt tovalidate the certificate WinRM is using for an HTTPS connection. If thecertificate cannot be validated (such as in the case of a self signed cert), it willfail the verification process.

To ignore certificate validation, addansible_winrm_server_cert_validation:ignore to inventory for the Windowshost.

See also

Windows Guides

The Windows documentation index

Intro to playbooks

An introduction to playbooks

Tips and tricks

Tips and tricks for playbooks

User Mailing List

Have a question? Stop by the google group!

irc.freenode.net

#ansible IRC chat channel





broken image