Possible bug: location of default.bar file in Win7

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
osmosis
Junior Member
Junior Member
Posts: 2
Joined: 2009-12-31, 20:50 UTC

Possible bug: location of default.bar file in Win7

Post by *osmosis »

I recently installed TC on a fresh install of Win7-64 Ultimate. The installation directory was C:\Program Files\totalcmd\.
I made some configuration changes to TC and modified the Button Bar (added a button).

The config files were written to ...\roaming\ghisler\. All was well, and configuration was preserved through many reboots.

Then (for reasons unrelated to TC) I turned UAC off and rebooted. Now TC does not remember changes to Button Bar!
Making further changes to button bar creates a new DEFAULT.BAR file in the install directory (not the ...roaming... location).

Turned UAC back on and rebooted. Now Button Bar reflects the (first round of) changes - my added button is back.

Searching the registry and WINCMD.INI file does not immediately reveal how the location of the DEFAULT.BAR file is decided.

I don't know if this is a bug or my poor understanding of how user profiles are managed on Windows 7 (I am new to 7).
Thanks for any assistance.
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, osmosis.

Scenario 1:

Windows UAC is active. As a consequence only processes launched in elevated mode can write (create/modify) files in subolders of %programfiles%.
Total Commander has not been told not to store its default.bar in its default location which is %COMMANDER_PATH%. Positively said: As you have not explicitly instructed T.C. to do otherwise, T.C. still wants to write its default.bar to %COMMANDER_PATH%.
Yet, you do not launch T.C. elevated, therefore T.C. has got no write privileges on its own files. Therefore T.C. silently decides to put your default.bar into the folder where wincmd.ini has been stored, %APPDATA%\Roaming\Ghisler.

Scenario 2:

Windows UAC is inactive. As a consequence your admin account has got full access rights on %programfiles% and its subfolders. You are always running in elevated mode without having to ask for it.
T.C. still wants to write its default.bar to %COMMANDER_PATH%.
Now it can do so. Therefore it ignores any default.bar previously stored elsewhere and uses the default.bar inside %COMMANDER_PATH% again.

Solution:

Explicitly instruct T.C. to use the default.bar in %appdata%\Roaming\Ghisler e.g. This will write the fully qualified pathname to the parameter Buttonbar in the file wincmd.ini.
As a consequence, no matter whether UAC is active or inactive, T.C. will always use the default.bar file in %appdata%\roaming\ghisler.

Kind regards and Happy New Year,
Karl
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2karlchen
Very well explained!

2ghisler(author)
TC behaves quite strange here. It copies the default bar from its program dir to its ini dir. That's fine.
But TC doesn't change the path in wincmd.ini automatically although a new file is used.

Expected: The button bar path should be changed automatically.
osmosis
Junior Member
Junior Member
Posts: 2
Joined: 2009-12-31, 20:50 UTC

Post by *osmosis »

2karlchen
Thanks for your quick and thorough reply. Your suggestion about adding the buttonbar path to the .ini file worked.
Is there a way to do this from within TC? I couldn't find one, so I just manually edited the .ini file.

2Lefteous
I'm with you on the strangeness. The default.bar file does not seem to be handled as one would expect. It seems logically equivalent to the FTP config file, but is not treated the same.
I guess the reason the button bar config is broken out from the main config is to allow multiple bars, but it seems like the default bar could be handled more logically.
And I'm a little suspicious that hard-coding the button bar path into the .ini file may violate some MS rule about how the user paths/files are managed (by Win7).

2ghisler(author)
I guess this was never an issue as long as everything was kept in one place, but when config files start moving around (due to UAC or MS handling of user files) things start getting confusing.
Maybe you could give it some thought? 8)

Thanks again to all and Happy New Year!
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

osmosis, I think you may open button bar config and choose right bar file if TC loaded wrong one instead of manually editing wincmd.ini file. :wink:
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, osmosis.

MVV is right as always. :)

Inside Total Commander click on the menu item "Configuration" => "Change Button Bar". Next click on the button "[>>]" and select the button bar file which you want to load. Confirm the question whether you want to make the selected button bar file the default button bar.

Kind regards,
Karl
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Birch---

Post by *Clo »

2osmosis

:) Hello !

• Just an aside thought :
- Using the "Program Files" folder to install TC is “To make a rod for one's own back”…
Same for all other MS' chamber pots… :lol:
- As long as it's for a home PC, the restored old location X:\Totalcmd avoids a lot of such annoyances…
- Just my opinion, though.

:mrgreen: KR
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

The suggestion to load the "right" bar is also strange. The bar is already loaded. Why should I select the bar which is already in use?
This is a TC problem.
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hi, Lefteous.

Well, by explicitly selecting the default.bar file located in the folder %APPDATA%\Roaming\Ghisler, T.C. will be made to write the full path to the buttonbar parameter inside wincmd.ini.

This prevents T.C. from silently switching between the two default.bar files inside %COMMANDER_PATH% and %APPDATA%\Roaming\Ghisler depending on the UAC status (off vs. on).

It may be a T.C. internal problem, but you can work around it easily.

Karl
Post Reply