Page 1 of 1

Indicate the validity of an installation

Published: March 6, 2017 - 4:00 PM
by raikyn
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?

Re: Indicating the validity of an installation

Published: March 6, 2017 - 4:30 PM
by sfonteneau
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

Re: Indicating the validity of an installation

Published: March 7, 2017 - 8:53 AM
by raikyn
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.

Re: Indicating the validity of an installation

Published: March 7, 2017 - 11:01
by Floflobel
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,

Re: Indicating the validity of an installation

Published: March 7, 2017 - 6:01 PM
by sfonteneau
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

Re: Indicating the validity of an installation

Published: March 8, 2017 - 09:59
by raikyn
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!

Re: Indicating the validity of an installation

Published: March 8, 2017 - 10:15
by sfonteneau
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 ;-) ).