Indicate the validity of an installation

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
raikyn
Messages: 8
Registration: May 2, 2016 - 3:36 p.m.

March 6, 2017 - 4:00 PM

Hello,

I've been regularly creating packages for a little over a year and I'm encountering a problem:

I created a package to install business software (ERDAS 2014 in this case). It installs without any issues , but WAPT considers the installation incorrect, and I have no idea why.

As a result, this package (despite being correctly configured) will try to reinstall itself every time a change is made on the PCs where the package is installed.

My question is: Is it possible to tell WAPT (via the console) that a package is properly installed? (Force the OK status?).

I don't want to use the "Forget package" function, because I'd like to be able to uninstall it cleanly via the WAPT console when needed.

If this functionality doesn't exist, perhaps this could be implemented?
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

March 6, 2017 - 4:30 PM

Hello,

to help you we need the contents of the package (setup.py).

If, for example, you run it, it's possible that it won't return a status of 0, and therefore Wapt considers the installation to have failed.

To know exactly what Wapt is doing, you need to tell us the error:
https://www.wapt.fr/fr/doc/Utilisation/ ... et-general

Simon
raikyn
Messages: 8
Registration: May 2, 2016 - 3:36 p.m.

March 7, 2017 - 08:53

Hello, apparently it's a "status" problem; it's not at 0.

Here's the content of setup.py:

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = ['{4099F374-39B8-4226-9AC2-2069CEE8BF82}']


def install():
run(r'"foundation\Setup.exe" /s ERDASFoundation2014 /ni ACCEPT_EULA=1')


The error:
CalledProcessError: Command '('"foundation\\Setup.exe" /s ERDASFoundation2014 /ni ACCEPT_EULA=1',)' returned non-zero exit status 1

I should point out that if I run this command directly from the command prompt on the PC, I don't get any errors.
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

March 7, 2017 - 11:01

Good morning,

Personally, I use the install_exe_if_needed function: https://dev.tranquil.it/sphinxdocs/sour ... _if_needed

You will first need the uninstall_key; here's where it can be found:

Code: Select all

# For OS 64bits and Software 32bits version : HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
# For OS 32 bits or 64bits (and Software 64bits version) : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
Sincerely,
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

March 7, 2017 - 6:01 PM

The `install_exe_if_needed` function will also throw an error.

https://dev.tranquil.it/sphinxdocs/sour ... _if_needed

Indeed, it accepts exit codes 0 and 3010, but return codes 1 are not among them.

If you use `install_exe_if_needed` on the second pass, it shouldn't generate an error because the `uninstallkey` will be found!

You can, if you wish, add exit code 1, as is OK for Wapt:

`run('"install.exe" /s',accept_returncodes=[0, 1, 3010])`.

But is exit code 1 a normal exit code?

Simon
raikyn
Messages: 8
Registration: May 2, 2016 - 3:36 p.m.

March 8, 2017 - 09:59

Thank you so much, it works thanks to accept_returncodes=[0, 1, 3010].
I had already seen this function, but having never used it, I had forgotten about it...sorry for the trouble.

Regarding exit code 1, I admit that, in most cases, it did indeed correspond to a problem in the installation.
But for ERDAS Foundation 2014, the installation is complete despite this code.

Thanks again!
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

March 8, 2017 - 10:15

The best approach, as Floflobel indicated, is to use install_exe_if_needed with accept_returncodes=[0, 1, 3010].

This way, if the uninstallkey is not found after the run, the package will fail (for a good reason ;-) ).
Locked