Fix uninstall CodeBlocks

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
Answer
Olivier Schmitt
Messages: 44
Registration: Oct 22, 2024 - 1:25 p.m.

April 28, 2026 - 1:11 PM

Good morning,

In https://wapt.tranquil.it/store/fr/tis-codeblocks
It is stated:

Code: Select all

def install():
    bin_name = glob.glob("codeblocks-*mingw-setup.exe")[0]

    if isdir(app_path):
        uninstall()
....

Code: Select all

def uninstall():
    run(f'"{makepath(app_path, "uninstall.exe")}" /S')
It seems there was a probable bug in the previous version which did not put uninstall.exe in the directory.

Can you replace the function? def uninstall(): by this one:

Code: Select all

def uninstall():
    uninstall_bin = makepath(app_path, "uninstall.exe")
    if isfile(uninstall_bin):
        run(f'"{uninstall_bin}" /S')
    if isdir(app_path):
        remove_tree(app_path)
(To be tested)

It is also possible to add:

Code: Select all

    impacted_process_list = control.impacted_process.split(",")
    killalltasks(impacted_process_list)
regarding the process specified in control: Code::Blocks (since codeblocks.exe)

This is to delete the folder and avoid the error:

Code: Select all

 erreurs dans les paquets [[PackageRequest(package='tis-codeblocks',version=(Version('25.3.0.0'), 7),architectures=['x64'],locales=['fr'],maturities=['PROD'],tags=['windows'],min_os_version=Version('10.0.26100'),max_os_version=Version('10.0.26100')), PackageEntry('tis-codeblocks','25.3-7' maturity='PROD',target_os='windows'), 'Traceback (most recent call last):\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 5689, in install\n    result = self.install_wapt(p.localpath,\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4609, in install_wapt\n    raise e\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4514, in install_wapt\n    exitstatus = setup.install()\n  File "C:\\Program Files (x86)\\wapt\\private\\tmp\\wapt5rr5rgkd\\setup.py", line 10, in install\n  File "C:\\Program Files (x86)\\wapt\\private\\tmp\\wapt5rr5rgkd\\setup.py", line 24, in uninstall\n  File "C:\\Program Files (x86)\\wapt\\common.py", line 4169, in run\n    return ensure_unicode(run(*arg, pidlist=self.pidlist,**args))\n  File "C:\\Program Files (x86)\\wapt\\waptutils.py", line 2318, in run\n    raise CalledProcessErrorOutput(proc.returncode, cmd, \'\'.join(output))\nwaptutils.CalledProcessErrorOutput: Command \'"C:\\\\Program Files\\\\CodeBlocks\\\\uninstall.exe" /S\' returned non-zero exit status 1.\nOutput:\'"C:\\Program Files\\CodeBlocks\\uninstall.exe"\' n\'est pas reconnu en tant que commande interne\r\nou externe, un programme exécutable ou un fichier de commandes.\r\n\n']]
italbot
Messages: 61
Registration: Sep 26, 2023 - 3:50 p.m.

April 28, 2026 - 2:07 PM

Hello,

Thank you for bringing this to our attention, I'm looking into it.

Sincerely,

Ingrid
Tranquil IT
italbot
Messages: 61
Registration: Sep 26, 2023 - 3:50 p.m.

April 30, 2026 - 12:17

Hello,

I just made the change, and at the same time I fixed an issue with retrieving the binary in update_package().

Have a good day.

Best regards,

Ingrid
Tranquil IT
Olivier Schmitt
Messages: 44
Registration: Oct 22, 2024 - 1:25 p.m.

May 4, 2026 - 4:17 PM

THANKS!
Answer