This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251943

Summary: Cannot uninstall an application as a different user
Product: installer Reporter: cezariusz <cezariusz>
Component: NBIAssignee: Libor Fischmeistr <lfischmeistr>
Status: VERIFIED WONTFIX    
Severity: normal CC: abdelmajid, cezariusz, markiewb
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description cezariusz 2015-04-20 08:32:06 UTC
When you try to uninstall NetBeans or any other NB platform based application while you are logged as a different user than performed the installation, you get an error like this:

The specified target component - nb-base/8.0.1.0.201408251540 
was not found in the registry. The installer
 can continue as if the target component was specified.
Click yes to continue, No to exit the installer.

The message is misleading, because:
1. That's not a registry (Windows Registry) problem.
2. The installer actually cannot continue, because it will do nothing.

The main problem (IMHO) is the Installer Working Directory, which is in %USERPROFILE%\.nbi folder. That's plain crazy, who came up with an idea to keep system-wide installation information in a private user directory? I don't know any other software which does the same, do you? Usually the uninstall information is stored in:
* Windows system registry (HKEY_LOCAL_MACHINE)
* Program files directory (together with the installed program)
* Windows folder (that applies mainly to MSI, so it's not a case here)

It's quite common to have several administrators (mainly on server machines), and security guidelines tell, that each of them should logon to his own account. That's not a problem to any other software besides NetBeans.

To summarize: on Windows machines the Installer Registry should be moved to a common directory, other than user profile subdirectory, preferably to the same directory, where the software has been installed (for example "c:\Program Files\NetBeans\nbi"). Installation and uninstallation require administrator rights anyway, so permissions shouldn't be a problem.
Comment 1 cezariusz 2015-04-20 09:23:31 UTC
*** Bug 247316 has been marked as a duplicate of this bug. ***
Comment 2 Libor Fischmeistr 2015-04-20 11:21:29 UTC
Hello, thanks for report.

The behaviour as you described is expected. When you run uninstaller as different user then you used to install NB, installer cannot find NBI registry which are place in the use home. You can simply workaround this by using --userhome <path to .nbi folder> option when launching the uninstaller.
Comment 3 cezariusz 2015-04-20 11:55:18 UTC
I'm sorry but I cannot agree.
First of all, an administrator should never ever be forced to look into another administrator's profile directory.
Second - how can one know about this option and what value to provide there. This option is not even mentioned in the error message. And it would be way easier if the installer gave the option to browse for the missing file or directory.
Third, please give me one reason to keep the Installer Registry in a user profile subdirectory instead of program directory. Why do it differently than everyone else?
Me and my colleagues faced this problem many times. We didn't report it, because we thought that something was indeed corrupted by a poorly implemented installer and we deleted it by hand. Google the Internet to see how many people had the same problem.
Comment 4 cezariusz 2015-04-20 12:32:39 UTC
One more thing: in the Windows registry, the "UninstallString" points to the program directory, in my case it's "E:\NetBeans 8.0.1\uninstall.exe". So:
1. If "uninstall.exe" is in the program directory, why not to put Installer Registry there as well
2. If uninstall.exe supports the "--userhome" parameter, why don't you simply add this parameter with the correct value to the registry?
Comment 5 cezariusz 2015-04-20 13:10:07 UTC
For the future reference, the correct name of the parameter is --userdir. The --userhome parameter is silently ignored. It took me a while to discover this (after digging the sources).

1. uninstall.exe --userhome c:\Users\Administrator - no effect
2. uninstall.exe --userhome c:\Users\Administrator\ - no effect
3. uninstall.exe --userhome c:\Users\Administrator\.nbi - no effect
4. uninstall.exe --userdir c:\Users\Administrator - no effect
5. uninstall.exe --userdir c:\Users\Administrator\ - no effect
6. uninstall.exe --userdir c:\Users\Administrator\.nbi - finally!
Comment 6 Libor Fischmeistr 2015-04-21 08:16:57 UTC
I understand what you mean, and consider it very reasonable. But now it works for long time and there is no plan to change the behaviour in near future.

I'm very sorry for that --userhome / --userdir mistake.

Lets keep this issue as enhancement.
Comment 7 cezariusz 2015-04-22 09:35:01 UTC
What do you think about adding the --userdir parameter to the "UninstallString" entry in the Windows registry, as a workaround? It should be always added automatically by the installer.
Comment 8 dannyx 2015-10-14 14:09:09 UTC
You need to run:

uninstall.exe --userdir X:\Users\{installationUser}\.nbi

{installationUser} is the first installation user, not necessarily "Administrator"

Good luck

Danny
Comment 9 cezariusz 2015-10-14 14:16:04 UTC
I know, see comment #5 point 6. But it should work automatically. Do you expect users to know about this option?
Comment 10 Seeder21 2016-03-04 19:53:09 UTC
In my case, I went to the directory stated, but there is no uninstall.exe there.

Any other suggestions?

"(In reply to dannyx from comment #8)
> You need to run:
> 
> uninstall.exe --userdir X:\Users\{installationUser}\.nbi
> 
> {installationUser} is the first installation user, not necessarily
> "Administrator"
> 
> Good luck
> 
> Danny