Page 1 sur 1

[RESOLU] Add uninstall to kicad 7 and 8

Posté : 20 févr. 2025 - 13:52
par OlivierSchmitt
Hello dear,

I just wanted to suggest these additions:
https://wapt.tranquil.it/store/fr/tis-kicad7

Code : Tout sélectionner

def uninstall():
    softs_to_uninstall = installed_softwares('kicad 7.')
    for soft in softs_to_uninstall:
        print("Uninstall kicad vers:" + soft['version'])
        run(WAPT.uninstall_cmd(soft['key']))
Or maybe adapted with key='KiCad ' + str(Version(control.get_software_version(),2)) because you use this in install()?

Same for kicad8:
https://wapt.tranquil.it/store/fr/tis-kicad8

Code : Tout sélectionner

def uninstall():
    softs_to_uninstall = installed_softwares('kicad 8.')
    for soft in softs_to_uninstall:
        print("Uninstall kicad vers:" + soft['version'])
        run(WAPT.uninstall_cmd(soft['key']))
Or maybe adapted with key='KiCad ' + str(Version(control.get_software_version(),2)) because you use this in install()?


Many thanks in advance.

Re: Add uninstall to kicad 7 and 8

Posté : 21 févr. 2025 - 11:15
par jlepiquet
Hi Olivier,

The uninstallkey should already take care of the different version. So there shouldn't be needed to add def uninstall() function.

Do you have some problems with uninstalling kicad with different version?

Joffrey

Re: Add uninstall to kicad 7 and 8

Posté : 26 févr. 2025 - 19:22
par OlivierSchmitt
Sorry, I just think that if there was no uninstall function, we had no way to uninstall...
Thanks for your reply.

Re: Add uninstall to kicad 7 and 8

Posté : 27 févr. 2025 - 09:22
par dcardon
Hi Oliver,

thanks for the feedback. Indeed if one uses the install_exe_if_needed of install_msi_if_needed functions, it picks-up the uninstall key from the registry database to call the exe/msi uninstall command line when uninstalling the package.

If the uninstall key in the original exe/msi is wrong (it happens), you have to override the key as a parameter when calling the install_*_if_needed.

And if the uninstall of the exe/msi is itself basically broken, then in this case you indeed have to write the uninstall function by yourself :-)

Cheers,

Denis