Unexpected error when uninstalling QBZR

Bug #385550 reported by Arno van Rensburg
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Critical
Alexander Belchenko

Bug Description

Platform: Windows Vista
Version: QBZR 1.10

By accident I specified the install directory of QBZR 1.10 to be C:\Program Files. This installed the QBZR files in my Program Files directory (not creating a sub directory). Instead of selecting the files one by one and deleting them, I decided to click on uninstall.exe. This resulted in an unexpected error.

Should the uninstall script not only remove the files that were installed?

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 385550] [NEW] Unexpected error when uninstalling QBZR

Arno van Rensburg пишет:
> Public bug reported:
>
>
> Platform: Windows Vista
> Version: QBZR 1.10

There is no QBzr 1.10 version. The last released version is 0.10.

>
> By accident I specified the install directory of QBZR 1.10 to be
> C:\Program Files. This installed the QBZR files in my Program Files
> directory (not creating a sub directory). Instead of selecting the files
> one by one and deleting them, I decided to click on uninstall.exe. This
> resulted in an unexpected error.
>
> Should the uninstall script not only remove the files that were
> installed?

I suspect you have to run uninstall.exe "As Administrator" on Vista.

Revision history for this message
Arno van Rensburg (arnovanrensburg) wrote :

Sorry, I meant 0.10 of course.

I was running it "As administrator". The uninstall script wiped my program files directory. I expected it to only remove the files installed by the installer.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 385550] Re: Unexpected error when uninstalling QBZR

Arno van Rensburg пишет:
> Sorry, I meant 0.10 of course.
>
> I was running it "As administrator". The uninstall script wiped my
> program files directory. I expected it to only remove the files
> installed by the installer.

Excuse me? Do you say that our uninstall.exe command removed entire
Program Files for you? I'm shocked to hear this.
Of course it's not intended behavior. But I really don't have any
explanation *now* for this disaster.

Revision history for this message
Arno van Rensburg (arnovanrensburg) wrote :

It is quite easy to duplicate (without losing your program files directory)

1. Create a random directory (say C:\Temp)
2. Copy some files you are willing to loose into that directory
3. Copy the uninstall.exe file into that directory, and run it.

The C:\Temp directory and its contents will be wiped.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Arno van Rensburg пишет:
> It is quite easy to duplicate (without losing your program files
> directory)
>
> 1. Create a random directory (say C:\Temp)
> 2. Copy some files you are willing to loose into that directory
> 3. Copy the uninstall.exe file into that directory, and run it.
>
> The C:\Temp directory and its contents will be wiped.

So, this is actually mistake in our installer script (for NSIS installer
compiler). Look at qbzr/installer/qbzr-setup.nsi, in the end of this
file you'll found these section:

; Uninstall
Section Uninstall

   RMDir /r "$INSTDIR"

   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
   DeleteRegKey HKLM "Software\QBzr\${PRODUCT_NAME}"

SectionEnd

It seems like directive 'RMDir /r "$INSTDIR"' force deletion of entire
directory where qbzr was installed.

So problem detected. This was good news.

The bad news: I'm not very familiar with NSIS installer scripts format.
I'm using Inno Setup installer for my own needs. I know how to
reimplement current NSIS instaler approach with Inno Setup, and make
sure we never delete more than needed. I'll do that for next release.

Sorry again for disaster with your Program Files folder :-(

Changed in qbzr:
importance: Undecided → Critical
milestone: none → 0.11.0
status: New → Confirmed
Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

Maybe we need to force the installer to create a directory called "qbzr" no matter what the user specifies. i.e If "C:\program files\" was specified the installer will create the qbzr directory ("C:\program files\qbzr") and copy the files into it.
Doing this might mean we don't need to keep track of each file for the uninstall process and leave it as is so that it would only wipe the directory that the installer CREATED. (Simple uninstall and simple install process)

Two problems I see with this:
1) One might copy files in that directory and loose them after an uninstall.
2) One might specify "somedirectory\Bazaar\plugins\qbzr" and then it would create a structure: "somedirectory\Bazaar\plugins\qbzr\qbzr"

Both these problems are probably not too serious.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Craig Hewetson пишет:
> Doing this might mean we don't need to keep track of each file for the uninstall process and leave it as is so that it would only wipe the directory that the installer CREATED. (Simple uninstall and simple install process)

Craig, I know for sure that Inno Setup is able to handle this automagically.

> Two problems I see with this:
> 1) One might copy files in that directory and loose them after an uninstall.

This is not very big problem.

> 2) One might specify "somedirectory\Bazaar\plugins\qbzr" and then it would create a structure: "somedirectory\Bazaar\plugins\qbzr\qbzr"

But this one is *the* problem.

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

This may help:
http://nsis.sourceforge.net/Uninstall_only_installed_files

I'm not at a Windows machine, so I can't test it.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Gary van der Merwe пишет:
> This may help:
> http://nsis.sourceforge.net/Uninstall_only_installed_files
>
> I'm not at a Windows machine, so I can't test it.

Thanks for the link. But... (cough-cough) this is a monster!
Inno Setup is really sometimes just works and don't require such hacks. :-/

Revision history for this message
Alexander Belchenko (bialix) wrote :

I've implemented Inno Setup based script to build installers for 0.11 and further versions. All old installers remain the same with this bug hidden inside. Beware and don't install QBzr in wrong folder anymore!

Changed in qbzr:
assignee: nobody → Alexander Belchenko (bialix)
status: Confirmed → Fix Committed
Changed in qbzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.