Page 1 of 1

Uninstallation that contains a KeyboardInterrupt

Published: June 15, 2023 - 09:28
by AlbanUCA63
Hello everyone,

We're running Ubuntu 2.4 with an enterprise license.

I'm having trouble uninstalling a program.
It sends a Ctrl+C error during uninstallation... which isn't a problem when done manually.
But when we put all that into a `def uninstall()` function, we get a `KeyboardInterrupt` error.

How can we accept the error, like with `accept_returncodes=[ ]`?

Thanks,

Alban

Re: Uninstallation that contains a Keyboard Interrupt

Published: June 15, 2023 - 09:52
by AlbanUCA63
Hello again...
Sorry, I found another solution for that package...
It worked with `msiexec /X{}`, but I had to add `/passive` otherwise nothing happened. :/

However, while it's not urgent right now, I'd still like to know how to accept a Keyboard Interrupt! :)
You never know!

Alban

Re: Uninstallation that contains a KeyboardInterrupt

Published: June 16, 2023 - 11:01
by dcardon
Hello Alban,

I think you can try trapping the exception in the uninstall function, but it's not very elegant :-)

Code: Select all

def uninstall():
    try:
        run('monpodoware.exe)
    except KeyboardInterrupt:
        print('ignoring ctrl-c during uninstall')
Sincerely,

Denis