Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Application with InstallAnywhere #590

Open
MaKaNu opened this issue Mar 5, 2024 · 1 comment
Open

Install Application with InstallAnywhere #590

MaKaNu opened this issue Mar 5, 2024 · 1 comment

Comments

@MaKaNu
Copy link

MaKaNu commented Mar 5, 2024

SUMMARY

We have software from keysight, which we want to install on our workstations. Their software is installed via "InstallAnywhere". Sadly Keysight has no ansible experience and so they could not help. The installation can be triggered via silent install, but behaves differently if I install it from powershell or via ansible.

It seems that the processes are not finished correctly.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_package

ANSIBLE VERSION
ansible [core 2.16.4]
  config file = /home/ansible/ansible-production/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.7 (main, Jan 29 2024, 16:03:57) [GCC 13.2.1 20230801] (/usr/bin/python)
  jinja version = 3.1.3
  libyaml = True
COLLECTION VERSION
# /usr/lib/python3.11/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 8.4.0  
CONFIGURATION
CONFIG_FILE() = /home/ansible/ansible-production/ansible.cfg
DEFAULT_HOST_LIST(/home/ansible/ansible-production/ansible.cfg) = ['/home/ansible/ansible-production/inventory']
DEFAULT_PRIVATE_KEY_FILE(/home/ansible/ansible-production/ansible.cfg) = /home/ansible/.ssh/ansible-production
DEFAULT_REMOTE_USER(/home/ansible/ansible-production/ansible.cfg) = ansible
DEFAULT_VAULT_PASSWORD_FILE(/home/ansible/ansible-production/ansible.cfg) = /home/matti.kaupenjohann/.vault_key
EDITOR(/home/ansible/ansible-production/ansible.cfg) = nvim
OS / ENVIRONMENT

windows 10

STEPS TO REPRODUCE

To fully understand the issue it might be necessary to have access to an Application, which is installed via InstallAnywhere. Due to license shenanigans I am not sure if I am allowed to share our installation files.

To understand what goes wrong it might be necessary to run directly on a system and with ansible.

to run directly:

C:\TEMP\ads_2023_update1.exe -f C:\TEMP\installer.properties -i silent

It is possible to spot the setup as children processes of powershell if the software is installed this way.

---
- name: Install ads 2023 update1
  hosts: all

  tasks:

    - name: Check for necessary files
      ansible.windows.win_file:
        path: "{{ item }}"
        state: file
      loop:
        - C:\TEMP\ads_2023_update1.exe
        - C:\TEMP\installer.properties

    - name: Install ADS
      ansible.windows.win_package:
        path: 'C:\TEMP\ads_2023_update1.exe'
        product_id: 'Advanced Design System 2023 Update 1'
        state: present
        arguments: '-f C:\TEMP\installer.properties -i silent'

In that case you can find the processes without a parent process.

The installer.properties look like this:

# Mon Jan 22 14:47:31 CET 2024
# Replay feature output
# ---------------------
# This file was built by the Replay feature of InstallAnywhere.
# It contains variables that were set by Panels, Consoles or Custom Code.



#Choose Install Set
#------------------
CHOSEN_FEATURE_LIST=DGS,Manuals,Examples,ADS
CHOSEN_INSTALL_FEATURE_LIST=DGS,Manuals,Examples,ADS
CHOSEN_INSTALL_SET=Complete

#Choose Install Folder
#---------------------
USER_INSTALL_DIR=C:\\Program Files\\Keysight\\ADS2023_Update1

#Set Your Home Directory
#-----------------------
USER_SELECTED_FOLDER=C:\\ADS-HOME

#Choose Shortcut Folder
#----------------------
USER_STARTMENU_FOLDER=Advanced Design System 2023 Update 1
ICONS_TO_DESKTOP=1

#Install
#-------
-fileOverwrite_C\:\\Users\\Admin-IKT\\AppData\\Local\\Temp\\187627.tmp\\delfont.exe=Yes
-fileOverwrite_C\:\\Users\\Admin-IKT\\AppData\\Local\\Temp\\187627.tmp\\MSVCR71.DLL=Yes
-fileOverwrite_C\:\\tmp\\vc90redist_x64.exe=Yes
-fileOverwrite_C\:\\tmp\\vc90redist_x86.exe=Yes
-fileOverwrite_C\:\\tmp\\vcredist_x64.exe=Yes
-fileOverwrite_C\:\\tmp\\vcredist_x86.exe=Yes
-fileOverwrite_C\:\\Program\ Files\\Uninstall_ADS2023_Update1\\uninstall.lax=Yes
-fileOverwrite_C\:\\Program\ Files\\Uninstall_ADS2023_Update1\\resource\\iawin64_x64.dll=Yes
-fileOverwrite_C\:\\Program\ Files\\Uninstall_ADS2023_Update1\\resource\\iawin32.dll=Yes
-fileOverwrite_C\:\\Program\ Files\\Uninstall_ADS2023_Update1\\resource\\win64_32_x64.exe=Yes
-fileOverwrite_C\:\\Program\ Files\\Uninstall_ADS2023_Update1\\resource\\remove.exe=Yes
-fileOverwrite_C\:\\Program\ Files\\Uninstall_ADS2023_Update1\\resource\\invoker.exe=Yes
EXPECTED RESULTS

After a successful installation I except a working software, with working installation and a install log file.

ACTUAL RESULTS

The Software seems to be installed, but the uninstaller is not working also the install log is missing. While the system is still activated I am able to spot processes of the installer, which are not finished and they never exit. I can kill the process or restart the system to get rid of the process, but installation did not finished successful in those cases.

I have also contacted the Developer of the installer but waiting for response, but my hope is not very high.

@jborean93
Copy link
Collaborator

Thanks for the issue, unfortunately there isn't too much we can do without access to try and replicate the problem. It could be a myriad of problems but I'll try and explain how win_product work and maybe that can help identify what is going wrong.

The module will invoke the executable given with the arguments and will wait for the process to finish. It will then check the return code to see if it is 0 or not and is used as the basic check to see if it worked. The module then exits normally and returns the result back to ansible.

In the past I have seen reports where the installed process somehow inherited the same console that the module was running under and stopped it from closing when the module has ended but that would cause the module to hang rather than return. You could try using wait_for_children: true but that will block until the installer and any processes it starts to finish before returning back.

You could try installing your application with become to potentially rule out any problems related to a network problem

- ansible.windows.win_package:
    path: 'C:\TEMP\ads_2023_update1.exe'
    product_id: 'Advanced Design System 2023 Update 1'
    state: present
    arguments: '-f C:\TEMP\installer.properties -i silent'
  become: true
  become_method: runas
  vars:
    ansible_become_user: '{{ ansible_user }}'
    ansible_become_pass: '{{ ansible_password }}'

If that doesn't work the next steps is to figure out what the installer is doing and why it doesn't work in Ansible. You could tell the developer they can replicate how Ansible runs the installer by using Invoke-Command on Windows:

Invoke-Command -ComputerName target -ScriptBlock {
    $proc = Start-Process -FileName 'C:\TEMP\ads_2023_update1.exe' -ArgumentList '-f C:\TEMP\installer.properties -i silent' -PassThru
    $proc | Wait-Process
    if ($proc.ExitCode) {
        throw "Proc failed with $($proc.ExitCode)"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants