[SOLVED] Winrar remove not working

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
Locked
sebastien4444
Messages: 22
Registration: Sep 14, 2023 - 08:53

June 3, 2024 - 12:06

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
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

June 3, 2024 - 12:37

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.
sebastien4444
Messages: 22
Registration: Sep 14, 2023 - 08:53

June 3, 2024 - 1:38 PM

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 :?
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

June 3, 2024 - 1:42 PM

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?
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

June 3, 2024 - 1:56 PM

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.
sebastien4444
Messages: 22
Registration: Sep 14, 2023 - 08:53

June 3, 2024 - 2:39 PM

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. :)
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

June 4, 2024 - 10:28

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 ;)
Locked