Uninstall process

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
gvdbe.fr
Messages: 2
Registration: February 22, 2018 - 7:02 PM

February 22, 2018 - 7:21 PM

wapt-get 1.3.13.0

Good evening,
I created a package that copies an .exe file to a directory without requiring any special permissions, and then creates a registry key.

I had included all the uninstallation steps in the "def uninstall()" procedure, but I'm getting a "file not found" error.

When commenting out my actions in "def uninstall", I was surprised and only realized later that simply defining the 'uninstall' procedure without any actions deletes the .exe file and the registry key, and attempts to delete the directory.
I'm surprised the package knows all these actions! I wondered if there might be a package cache. Purging with wapt-get clean and update doesn't change anything. Purging the package from the repository doesn't help either.

Problem in both my package variants, with or without action in the "def uninstall", I still get an alert which causes the uninstallation process to fail, which is still incomplete, the deletion of the directory, and apparently the uninstall cannot do it.

Removing diskspace ...
2018-02-22 19:07:34,961 WARNING error: (2, 'GetFileVersionInfo:GetFileVersionInfoSize', 'The system cannot find the file specified.')
2018-02-22 19:07:34,964 WARNING error: (2, 'GetFileVersionInfo:GetFileVersionInfoSize', 'The system cannot find the file specified.')
2018-02-22 19:07:34,967 WARNING error: (2, 'GetFileVersionInfo:GetFileVersionInfoSize', 'The system cannot find the file specified.')
2018-02-22 19:07:34,969 CRITICAL Error running uninstall script: [Errno 2] No such file or directory: 'DiskSpace.exe'
=== Removed packages ===
diskspace
=== Error removing packages ===
diskspace

Here's what I have in my uninstall:
def uninstall():
print('uninstalling GRDF-DiskSpace')
# killalltasks('DiskSpace.exe')
# registry_delete(HKEY_LOCAL_MACHINE, r'software\Microsoft\Windows\CurrentVersion\Run','DiskSpace')
# time.sleep(5)
# if isdir(DiskSpacePath):
# remove_tree(DiskSpacePath,ignore_errors=True)

Does anyone have any ideas?
gvdbe.fr
Messages: 2
Registration: February 22, 2018 - 7:02 PM

February 23, 2018 - 5:15 PM

Actually, I found the problem. It's the makepath functions that are causing the issue...
like: makepath('C:\MyDirectory','DiskSpace')
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

February 23, 2018 - 5:29 PM

In Python (and other languages) the '\' in a string allows you to encode line breaks '\n' for example.

To prevent Python from interpreting backslashes, you need to add a 'r' prefix (raw strings)
If there are accented characters, you generally need to specify a Unicode string (prefix 'u')

Code: Select all

makepath(ur'C:\MonRépertoire','DiskSpace')
Tranquil IT
Locked