Page 1 of 1

[SOLVED] Winrar remove not working

Published: June 3, 2024 - 12:06 PM
by sebastien4444
Good morning,

In order to test the creation of packages, I wanted to do a test with a software that seems quite simple in terms of installation: WinRar.
Following the package creation procedure in the YouTube video "Creating, configuring and deploying an exe package with WAPT", I therefore went through "Generating a package template" in the WAPT console.

When editing the setup.py file, I retrieved the uninstallation key via a command prompt:

Code: Select all

C:\Users\seb>wapt-get list-registry winrar
Using config file: E:\wapt\wapt-get.ini
UninstallKey                           Software                                                              Version             Uninstallstring
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WinRAR archiver                        WinRAR 7.01 (64-bit)                                                  7.01.0              C:\Program Files\WinRAR\uninstall.exe
I then entered this information into the install() function, resulting in the following setup.py file:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    # Declaring local variables

    # Installing the software
    print("Installing: winrar-x64-701fr.exe")
    install_exe_if_needed('winrar-x64-701fr.exe',
        silentflags='/S',
        key='WinRAR archiver',
        min_version='7.1.0'
    )
    create_desktop_shortcut(r'WinRaR',target=r'C:\Program Files\WinRAR\WinRAR.exe')
When I run WAPT:install in the PyScripter project, Winrar installs correctly on my host machine BUT no shortcut is added to my current user's desktop.

When I run WAPT:remove, it doesn't uninstall WinRAR from my host, and I don't understand why :roll:
Below are the console outputs following the run of install and then remove:

Code: Select all

*** Remote Interpreter Reinitialized ***
Command Line : install "C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt\WAPT\.."
Using config file: E:\wapt\wapt-get.ini
Installing WAPT files C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt
Installing: winrar-x64-701fr.exe
Installing: winrar-x64-701fr.exe (7.1.0)

Results :

 === install packages ===
  C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt | pilote-winrar (7.1.0-0)
>>> 
*** Remote Interpreter Reinitialized ***
Command Line : remove "C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt\WAPT\.."
Using config file: E:\wapt\wapt-get.ini
Removing C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt\WAPT\.. ...
=== Removed packages ===
  pilote-winrar

Re: Winrar remove not working

Published: June 3, 2024 - 12:37
by sfonteneau
sebastien4444 wrote: June 3, 2024 - 12:06 When I launch a Run of WAPT:install in the PyScripter project, Winrar installs correctly on my host machine BUT no shortcut is added to my current user's desktop.
Not sure if WinRAR creates a shortcut?
sebastien4444 wrote: June 3, 2024 - 12:06
When I run WAPT:remove, it doesn't uninstall WinRAR from my host, and I don't understand why :roll:
Below are the console outputs following the run of install and then remove:

Code: Select all

*** Remote Interpreter Reinitialized ***
Command Line : install "C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt\WAPT\.."
Using config file: E:\wapt\wapt-get.ini
Installing WAPT files C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt
Installing: winrar-x64-701fr.exe
Installing: winrar-x64-701fr.exe (7.1.0)

Results :

 === install packages ===
  C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt | pilote-winrar (7.1.0-0)
>>> 
*** Remote Interpreter Reinitialized ***
Command Line : remove "C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt\WAPT\.."
Using config file: E:\wapt\wapt-get.ini
Removing C:\waptdev\pilote-winrar_7.1.0_Windows_PROD-wapt\WAPT\.. ...
=== Removed packages ===
  pilote-winrar
Based on the output, I assume the installation was not restarted after the key was added?

Note: Restarting the installation after adding the key is mandatory.

Re: Winrar remove not working

Published: June 3, 2024 - 1:38 PM
by sebastien4444
sfonteneau wrote: June 3, 2024 - 12:37 Not sure if WinRAR creates a shortcut?
But shouldn't adding this line to the install() function force the addition of a shortcut?

Code: Select all

create_desktop_shortcut(r'WinRaR',target=r'C:\Program Files\WinRAR\WinRAR.exe')
sfonteneau wrote: June 3, 2024 - 12:37 Based on the output, I assume the installation wasn't restarted after adding the key?

Note: restarting an installation after adding the key is mandatory.
I followed the steps in the YouTube tutorial correctly and therefore restarted the installation after adding the key.

I even ended up manually uninstalling WinRAR and reinstalling it using Run install, but it's still the same; running Run remove doesn't uninstall the software :?

Re: Winrar remove not working

Published: June 3, 2024 - 1:42 PM
by sfonteneau
Yes, indeed, `create_desktop_shortcut` should create the shortcut; I hadn't noticed it.


And the uninstallation should work if you restart the installation correctly; I don't see any errors.

Do you see a message like "Exe setup %s already installed. Skipping" when you restart the installation?

Re: Winrar remove not working

Published: June 3, 2024 - 1:56 PM
by sfonteneau
I just relaunched WinRAR on LUTI (the online version check wasn't working properly).

I can confirm that the package works; it installs and uninstalls.

Your case is interesting; I don't see where the problem lies.

Re: Winrar remove not working

Published: June 3, 2024 - 2:39 PM
by sebastien4444
Well, in the end I think the problem isn't with WAPT but rather with the environment I was working in.

I was doing these tests from a server where I had installed the console, and I was getting this behavior.

I finally installed the console on a test laptop, and there were no problems with my install/uninstall tests (tested with WinRAR and Thunderbird).
So the problem must be with the server environment I was initially using.
And on that server, I don't get the ".... already installed. Skipping" message when I reinstall a package that's already installed.

Sorry for wasting your time. :)

Re: Winrar remove not working

Published: June 4, 2024 - 10:28 AM
by sfonteneau
sebastien4444 wrote: June 3, 2024 - 2:39 PM Sorry for wasting your time :)
Ultimately, this allowed us to correct our WinRAR check in Luti, which wasn't working properly, so no time was wasted ;)