Page 1 of 1

Uninstall process

Published: February 22, 2018 - 7:21 PM
by gvdbe.fr
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?

Re: Uninstall process

Published: February 23, 2018 - 5:15 PM
by gvdbe.fr
Actually, I found the problem. It's the makepath functions that are causing the issue...
like: makepath('C:\MyDirectory','DiskSpace')

Re: Uninstall process

Published: February 23, 2018 - 5:29 PM
by htouvet
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')