#853 Unsafe uninstall deletion

version 3.0.19
open
nobody
5
2012-02-13
2012-02-13
Anonymous
No

Hi,

I had issues running Privoxy out of the box on Windows 7 using the default Program Files (x86) folder. So I decided to install it in My Documents. Unfortunately, I forgot to put Privoxy as the last directoy in the installation path, so I ended up using something like C:\Users\Username\My Documents. A few minutes after, I realized the files where in the latter directory, so I ran the uninstall file and... everything is gone, no way to recover anything :( Now I just hope I haven't lost so much...

I know it was my mistake to install Privoxy in the wrong directory but still I don't think it should assume to delete the whole installation directory (at least not without checking that the directory is empty), but rather just it's internal files and directories (some kind of whitelist deleting?).

Discussion

  • Fabian Keil
    Fabian Keil
    2012-02-13

    Thanks a lot for the report. I'm sorry for your loss.

    The described behavior seems surprising and non-intuitive to me, too.

    I don't know what best-practices for a deinstaller on Windows are, but on FreeBSD deinstalling a package is not supposed to remove any files or directories unless they have been created by the package in question and their content hasn't been modified later on.

    This means that for example a modified Privoxy config file and the log file should survive the deinstallation.

    I do not know how much work implementing something similar for the Windows packages would be, but it probably isn't trivial. Preventing the installation into an already existing directory might be a workaround.

    Lee, can you comment on this?

    If the current behavior has to be kept, the installer and the documentation should probably at least warn about it.

     
  • Adam Piggott
    Adam Piggott
    2012-02-21

    <a href="http://www.handyrecovery.com/handyrecovery-fw.exe">Handy Recovery</a> may help you get back the deleted files. Make sure you download it, and install, to a USB stick or drive other than C:.

     
  • Lee
    Lee
    2012-05-25

    Yes, the current uninstall behavior is extremely poor - no checks at all, just:
    RMDir /r "$SMPROGRAMS\Privoxy"
    RMDir /r "$INSTDIR"

    Unfortunately, this is probably going to be one of those http://cygwin.com/acronyms/#PTC situations. The NSIS script language is a real pain to figure out.

    Sorry.

    > Preventing the
    > installation into an already existing directory might be a workaround.

    I doubt it - windows users want to be able to install over an existing installation. There was at least one person who contributed patches for the installer to get the behavior they desired..

    Lee

     
  • Adam Piggott
    Adam Piggott
    2012-05-25

    You may be able to recover the lost files using http://www.handyrecovery.com/handyrecovery-fw.exe

    Make sure you install it to a different physical device e.g. USB stick or secondary hard disk.

     
  • Fabian Keil
    Fabian Keil
    2012-05-25

    How about replacing the 'RMDir /r "$INSTDIR"' call with something equally primitive but less dangerous like:

    Delete "$INSTDIR\privoxy.exe"
    Delete "$INSTDIR\config.txt"
    Delete "$INSTDIR\default.action"
    Delete "$INSTDIR\user.action"
    Delete "$INSTDIR\default.filter"
    Delete "$INSTDIR\trust.txt"
    Delete "$INSTDIR\AUTHORS.txt"
    Delete "$INSTDIR\LICENSE.txt"
    Delete "$INSTDIR\README.txt"
    Delete "$INSTDIR\privoxy_uninstall.exe"
    Delete "$INSTDIR\logfile.txt"
    [...]
    RMDir /r "$INSTDIR\doc\user-manual"
    RMDir /r "$INSTDIR\doc\faq"
    RMDir "$INSTDIR\doc"
    RMDir "$INSTDIR"