Page 1 of 1

Uninstalling an old version of Java

Published: June 12, 2017 - 11:50 AM
by Dylan
Good morning,

It doesn't seem complicated, and with Simon's help I was able to uninstall older versions of Thunderbird.

I'm using WAPT-fixup with these lines of code

Code: Select all

def install():
    prefixpkg = control.package.split('-',1)[0]
    java8 = WAPT.is_installed('%s-java8'% prefixpkg)
    if java8 and Version(java8.version) == Version('8.121-24'):
        WAPT.remove(java8.package)
        WAPT.install('%s-java8'% prefixpkg)
My goal is to uninstall only version 8.121. When I run the debugger, I get a NameError: global name 'Version' in not defined. I conclude that, as far as it's concerned, the version is not defined.

Any idea what the problem is?

Re: Uninstalling an old version of Java

Published: June 12, 2017 - 3:26 PM
by agauvrit
The class Version which is used to compare software version numbers has recently moved to a different file in WAPT, during execution there are no problems, but during debugging it gets stuck.

Which version of the agent are you using?

The version class is now located in the waptutils file (C:\wapt\waptutils.py)

Try importing the library like this:

Code: Select all

from waptutils import *

Re: Uninstalling an old version of Java

Published: June 12, 2017 - 4:46 PM
by Dylan
Good morning,

Thank you for the reply.
The agent and console are in version 1.3.12.13.

No, unfortunately, it's not just the debugging that's stuck; the uninstallation doesn't work either.

I don't know where I should insert this line of code

Code: Select all

from waptutils import *
Is it in the setup.py file?

For your information, I don't have a C:\WAPT\waptutils.py file, but I do have a C:\WAPT\waptdevutils.py file, and it contains quite a bit of information. I'm trying to modify the file and adding the following line of code:

Code: Select all

from waptutils import *
.... ;)

Update: Well, it was a bad idea to try and mess with C:\WAPT\waptdevutils.py, so I put it back to how it was originally.
I'm no further ahead; I still can't uninstall the old versions of Java 8.121 :roll:

Re: Uninstalling an old version of Java

Published: June 21, 2017 - 00:26
by sfonteneau
Sorry, I'm really struggling to resolve the issue.

Could you try version 1.3.12.15?