[TC10.51rc2] uninstall doesn't remove ini files

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

  • Uninstall TC and choose to remove the ini files.
  • When TC was installed using tc1051x32_64_rc2.exe or tc1051x64_rc2.exe, an attempt is made to remove c:\windows\wincmd.ini (ini's are located in the appdata folder..)
When TC was installed using tc1051x32_rc2.exe, it works fine.

(bug also present in 64bit and combined installers of earlier versions)
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

While testing I had left over registry keys in:
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Ghisler\Total Commander]
"IniFileName"="%APPDATA%\\GHISLER\\wincmd.ini"
"FtpIniName"="%APPDATA%\\GHISLER\\wcx_ftp.ini"
"InstallDir"="C:\\Program Files\\Total Commander"

That's why 32bit succeeded and the others didn't. So normally there wouldn't be a problem.

If you have InstallDir, FtpIniName and IniFileName setting in HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Ghisler\Total Commander.
But no HKEY_LOCAL_MACHINE\SOFTWARE\Ghisler key and no HKEY_CURRENT_USER\Software\Ghisler key.
Then if you install TC, only HKEY_CURRENT_USER\Software\Ghisler\Total Commander\InstallDir is added to registry.
When using TC 64bit, it uses %APPDATA%\GHISLER\wincmd.ini probably because the Windows dir is write-protected.

If you then uninstall TC, when TC was installed with the 32bit installer the uninstaller will remove the ini mentioned in registry under the WOW6432Node key.
When TC was installed with the other installers the uninstaller will try to remove c:\windows\wincmd.ini.

So when the IniFileName setting is missing in registry and the Windows dir write-protected, TC uses ini in %APPDATA%\GHISLER.
But when the IniFileName setting is missing in registry and the Windows dir write-protected, the uninstaller does not remove the ini in %APPDATA%\GHISLER.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *ghisler(Author) »

Thanks for the analysis. What do you think would be the best way to handle this? Should the installers write to both HKEY_LOCAL_MACHINE locations? Or should the uninstaller look in both HKEY_LOCAL_MACHINE locations?
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

When doing a clean install with an Administrator account (TC not installed before), I get these registry entries with all 3 installers:
(I chose all the suggested options, just hit Enter all the time)
HKEY_CURRENT_USER\Software\Ghisler\Total Commander
IniFileName REG_SZ %APPDATA%\GHISLER\wincmd.ini
FtpIniName REG_SZ %APPDATA%\GHISLER\wcx_ftp.ini
InstallDir REG_SZ C:\Program Files\totalcmd


HKEY_LOCAL_MACHINE\Software\Ghisler\Total Commander
IniFileName REG_SZ %APPDATA%\GHISLER\wincmd.ini
FtpIniName REG_SZ %APPDATA%\GHISLER\wcx_ftp.ini
InstallDir REG_SZ C:\Program Files\totalcmd


HKEY_LOCAL_MACHINE\Software\WOW6432Node\Ghisler\Total Commander
IniFileName REG_SZ %APPDATA%\GHISLER\wincmd.ini
FtpIniName REG_SZ %APPDATA%\GHISLER\wcx_ftp.ini
InstallDir REG_SZ C:\Program Files\totalcmd
When doing an install with an Administrator account and these registry entries partially exist, the missing parts should be added in my opinion.
(normal install, again only hitting Enter all the time)
Normal install should repair the registry.

Most importantly, the ini settings in HKEY_CURRENT_USER should be set. Here is a situation where things go wrong in my opinion:

Suppose user A, user B, user C, and user D all use the same computer.
User A installs TC (with or without administrator rights)
User B installs TC with administrator rights.
User C installs TC (with or without administrator rights)
User D installs TC with administrator rights and changes the location for the ini file to the My Documents folder for all users.

User C complains that suddenly all his settings are gone. User A and user B say nothing has changed for them.
(It's because when user C installed TC, the installer didn't set the ini settings in HKEY_CURRENT_USER)

When doing a clean install (TC not installed before) and doing an automatic install, then no ini settings are written at all to the registry. Not in the HKEY_LOCAL_MACHINE locations and not in HKEY_CURRENT_USER. So the same problem can arise here too.
Was this done on purpose?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *ghisler(Author) »

Most importantly, the ini settings in HKEY_CURRENT_USER should be set.
I agree, I will add that. Currently the keys are only written when the location has changed, or the user has checked the option "Set this location for all users on this system". So if there is only a setting in HKEY_LOCAL_MACHINE (from a different user) and the user doesn't change the location, then the key in HKEY_CURRENT_USER will not be written.

The keys under HKEY_LOCAL_MACHINE will only be written (in addition to that in HKEY_CURRENT_USER) when the option "Set this location for all users on this system" is checked in "Change ini file location".
When doing a clean install (TC not installed before) and doing an automatic install, then no ini settings are written at all to the registry.
The ini settings will not be written in interactive mode either when you either
1. Skip the "Change ini file location" page
or
2. Don't change anything on the "Change ini file location" page

This tells TC to look for the ini files in the default location.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *ghisler(Author) »

Here is a preview version of the installer for the upcoming Total Commander RC3. It will copy the IniFileName and FtpIniName values from HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER if the values exist in HKEY_LOCAL_MACHINE and do not exist in HKEY_CURRENT_USER yet.

Download:
https://www.totalcommander.ch/beta/install1051rc3.zip

To test this with the RC2 files, run the program like this:
install.exe c:\path\tc1051x32_rc2.exe
install.exe c:\path\tc1051x32_64_rc2.exe
install64.exe c:\path\tc1051x64_rc2.exe

Please let me know what you think.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

Your link doesn't work. I assumed you meant install1051rc3.zip and downloaded that. I will test it soon.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *ghisler(Author) »

Sorry, the name was indeed wrong. I have corrected the link.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

ghisler(Author) wrote: 2022-08-21, 09:54 UTC Here is a preview version of the installer for the upcoming Total Commander RC3. It will copy the IniFileName and FtpIniName values from HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER if the values exist in HKEY_LOCAL_MACHINE and do not exist in HKEY_CURRENT_USER yet.
First tests look OK.

But still when doing a clean install (TC not installed before) and doing an automatic install (/A), then no ini settings are written at all to the registry.

Here is how I do my testing:
  • Under a different user (administrator), I run Command Prompt as Administrator.
  • I make sure that the default install folders "c:\totalcmd" and "c:\Program Files\Totalcmd" don't exist.
  • I run a batch file that deletes the TC registry entries in HKCU and HKLM (including WOW6432Node), removes the "%appdata%\GHISLER" folder and deletes all possible Start menu and Desktop shortcuts.
As I mentioned before, if I use the interactive installer then all registry entries are added on first install. But if I use /A then only the install dir entries are added. The installer handles adding the install dir to the registry quite well in most circumstances. It should do so too with the ini settings.

Here is how I think it should work:
The settings in HKLM give the default locations for when the the settings in HKCU do not exist.
The string in the installer:
107="Set this location for all users on this system"
Should be something like this:
107="Make this the default for all users on this system"
Whenever settings in HKCU are missing, the installer or TC falls back on HKLM for the default location. The installer or TC should then always write the location it uses to HKCU. Otherwise things may happen what I described before, people may suddenly lose their settings in TC.

Similarly for 32-bit and 64-bit specific registry entries. If the 32-bit installer doesn't find the 32-bit registry settings, but does find the 64-bit registry settings and uses that, it should then store these settings in the 32-bit registry settings.

If you fallback on something or use something as a default because something is missing, always repair what was missing.

In my opinion update and repair should also fix missing registry entries.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *ghisler(Author) »

But still when doing a clean install (TC not installed before) and doing an automatic install (/A), then no ini settings are written at all to the registry.
Yes, it means that Total Commander should use the default location. It does copy the values from HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER now when you make a clean install for that user, but other users have installed it before with the option "Set this location for all users on this system".
Should be something like this:
107="Make this the default for all users on this system"
It would be a bit more precise because HKEY_CURRENT_USER values of other users aren't overwritten, but the difference is too small to justify a multiple month wait for all new translations.
If the 32-bit installer doesn't find the 32-bit registry settings, but does find the 64-bit registry settings and uses that, it should then store these settings in the 32-bit registry settings.
I don't think that this is necessary.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

ghisler(Author) wrote: 2022-08-22, 06:40 UTC
But still when doing a clean install (TC not installed before) and doing an automatic install (/A), then no ini settings are written at all to the registry.
Yes, it means that Total Commander should use the default location. It does copy the values from HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER now when you make a clean install for that user, but other users have installed it before with the option "Set this location for all users on this system".
What I meant was with "clean install (TC not installed before)" that TC was not installed by any user. As I mentioned, my batch file removes all registry entries and I make sure default install folders don't exist. Then an interactive install adds the registry entries correctly, while an automatic install doesn't.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *ghisler(Author) »

No, an interactive install doesn't add the ini location registry entries either, unless you change anything on the "Set ini file location" page. You probably checked "set for all users" there.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

ghisler(Author) wrote: 2022-08-22, 06:40 UTC
But still when doing a clean install (TC not installed before) and doing an automatic install (/A), then no ini settings are written at all to the registry.
Yes, it means that Total Commander should use the default location.
And that default location can be changed by other users causing the user to lose his settings. Remember that the settings are not written to HKCU either. At least settings should always be written to HKCU.
ghisler(Author) wrote: 2022-08-22, 07:27 UTC No, an interactive install doesn't add the ini location registry entries either..
Yes it does :) . As it should in my opinion.
ghisler(Author) wrote: 2022-08-22, 07:27 UTC .. unless you change anything on the "Set ini file location" page. You probably checked "set for all users" there.
As I said before, I just hit Enter all the time so I don't get to the "Set ini file location" page.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *ghisler(Author) »

I have tested it in the debugger now:
1. You are right, the interactive installer writes the ini file locations to registry because "set for all users" is the default now.
2. The non interactive installer (parameter /A) didn't set the ini file locations because it looked for a key iniloc in [auto] section, and if it wasn't set, turned off the saving of the ini location. I have removed that now.

Please try the new installer beta.

Download:
https://www.totalcommander.ch/beta/install1051rc3_2.zip
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC10.51rc2] uninstall doesn't remove ini files

Post by *white »

ghisler(Author) wrote: 2022-08-23, 07:38 UTC 2. The non interactive installer (parameter /A) didn't set the ini file locations because it looked for a key iniloc in [auto] section, and if it wasn't set, turned off the saving of the ini location. I have removed that now.
Tested OK with the 3 installers.
ghisler(Author) wrote: 2022-08-21, 09:54 UTC To test this with the RC2 files, run the program like this:
install.exe c:\path\tc1051x32_rc2.exe
Is there a way I can test the install dir parameter?

Edit:
Found out already. Last parameter is either install path or installation data. If you want to specify both, you need to use the /Z parameter for the installation data.
Correct?
Last edited by white on 2022-08-23, 20:39 UTC, edited 1 time in total.
Reason: Found the answer to my question
Post Reply