Installation check

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

October 27, 2018 - 7:36 PM

- 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.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 28, 2018 - 2:58 PM

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.
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

November 1, 2018 - 10:43

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.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

November 5, 2018 - 10:16 AM

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:
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

November 5, 2018 - 2:31 PM

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
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

November 5, 2018 - 2:40 PM

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.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
Locked