Page 1 of 1

Installation check

Published: October 27, 2018 - 7:36 PM
by Mathieu
- Installed WAPT version (1.6.2.7 Enterprise)
- Server OS (Linux) and version (Debian Strech)
- Operating system of the administration/package creation machine (Windows 10)


Good morning,

We will soon be implementing WAPT in our park, however I am encountering a problem with some of my packages.

Some of my packages have command lines after installation (run or install_exe_if_needed) for copying files, creating registry keys, etc
To avoid rewriting certain data and losing configuration on already installed machines, I copied part of the code from a package to verify that the software is properly installed.

I tried several methods but some packages won't install

1.

Code: Select all

def install():

    global uninstallkey
    from common import Wapt

    softname = 'DameWare Remote Support'
    check_installed_out = installed_softwares(softname)
    Software = [ soft for soft in installed_softwares(softname) if Version(soft['version']) < Version('12.0.6002.5') ]

    if Software:
        print('installing futur-DameWareRS')
        run('DameWareRS.exe /args "/qn reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=0 CENTRALSERVERHOSTNAME=*****.****.***.fr CENTRALSERVERPORT=6133"')
    else:
        print('already installed')
2.

Code: Select all

def install():

    softname = 'DameWare Remote Support'
    check_installed_out = installed_softwares(softname)
    
    if not check_installed_out:
        print('installing futur-DameWareRS')
        run('DameWareRS.exe /args "/qn reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=0 CENTRALSERVERHOSTNAME=*****.*****.****.fr CENTRALSERVERPORT=6133"')
    else:
        print('already installed')
I prefer code 1 because it checks the installed version, so if I need to update my software, the update won't happen because it will detect that the software is already installed. However, I'm encountering a problem: when I uninstall the software and then test my script, it does nothing except print the output.

When I print my variable, it is empty; my script should perform the installation.

Do you have a simpler method for deployment on workstations already in place?

I'm reaching out to you because I've been racking my brains for several weeks trying to find a solution, and the production launch date is fast approaching

Thank you.

Re: Installation check

Published: October 28, 2018 - 2:58 PM
by sfonteneau
Your first code should work; I don't see any errors.

However, please check that the installed software version is lower than 12.0.6002.5.

Re: Installation check

Published: November 1, 2018 - 10:43 AM
by Mathieu
However, I kept solution 1, but for example, with another piece of software, nothing installs even though the software isn't present on the machine; the `Software` variable displays nothing.

When I do a `print`, I get `[]` as the output.

The command works fine for checking the machine, but for a new installation, nothing happens, even though it should install since it doesn't detect the software.

Re: Installation check

Published: November 5, 2018 - 10:16 AM
by Mathieu
I think I've found a solution, but I'm not sure

I'm doing two checks and for the moment it's working

Code: Select all

def install():

    global uninstallkey
    from common import Wapt

    softname = 'DameWare Remote Support'
    check_installed_out = installed_softwares(softname)
    Software = [ soft for soft in installed_softwares(softname) if Version(soft['version']) < Version('12.1.0.34') ]

    if Software or not check_installed_out:

Re: Installation check

Published: November 5, 2018 - 2:31 PM
by sfonteneau
Why not use `install_exe_if_needed` instead of `run`?

It already performs all these checks. (If needed, copy and paste the `install_exe_if_needed` function)

https://github.com/tranquilit/WAPT/blob ... s.py#L4152

Re: Installation check

Published: November 5, 2018 - 2:40 PM
by Mathieu
For some .exe or .msi files, this solution doesn't work, which is why I switched to a run command.

We have certain commands to configure the software (ODBC configuration, copying configuration files, etc.). Without verification, even with `install_exe_if_needed`, the package will execute the configuration commands. I want to prevent the configurations from being modified.

That's why I'm looking for a way to check if the software is installed on the machine, but only execute the package if it's not.