This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Varying location of default.bar
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed Printable version
View previous topic :: View next topic  
Author Message
DrShark
Power Member
Power Member


Joined: 03 Nov 2006
Posts: 1092
Location: Kyiv, 68/262

PostPosted: Tue May 15, 2018 11:23 am    Post subject: Reply with quote

Dalai wrote:
No application should ever write to VirtualStore directory by itself! The VirtualStore directory is automatically used by Windows...
MVV wrote:
VirtualStore is a special system folder that is used for redirecting write operations to protected locations for old programs that don't support elevation, and subsequent read operations use files from this folder first. TC does support elevation so its write operations are not redirected but failed.
OK, then the second part of this my post and further comments on it are a bit offtopic here, but at least it's clear now that it's OK to expect from TC (which supports elevation) to write the settings (including bar files) to same location on both not elevated and elevated launch, with AppData\Roaming\GHISLER\ as a best choice for this.
_________________
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
Back to top
View user's profile Send private message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6000
Location: Meiningen (Südthüringen)

PostPosted: Tue May 15, 2018 12:45 pm    Post subject: Reply with quote

As long as it's still possible to use a single buttonbar file for all users, I don't mind if TC's behavior is changed. This detail is important, because you actually can remove users from the administrators group, so TC runs as different user when elevating it on such systems. This also applies to systems where UAC is disabled (like all of mine).

Grüße
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Wed May 16, 2018 4:36 am    Post subject: Reply with quote

Sorry, I prefer not to change it. It may break too many installations.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Thu May 17, 2018 8:18 am    Post subject: Reply with quote

Bad news: all existing TC installations are already broken. Why?

1) UserA launches TC in elevated mode and edits button bar - changes are saved to c:\Program Files\Total Commander\default.bar
2) UserB launches TC in elevated mode and edits button bar - changes are saved to c:\Program Files\Total Commander\default.bar
3) UserA launches TC in elevated mode once again and it has other button bar settings than he saved.

As we can see, using one file for multiple users in a multi-user environment can lead to troubles...


Good news: This can be fixed easily, without breaking any existing installation. How?

TC should always (= even when launched in elevated mode) try to load button bar configuration from c:\Users\X\AppData\Roaming\GHISLER\*.bar.

* IF EXISTING in c:\Users\X\AppData\Roaming\GHISLER\*.bar - it should be used.

* IF NOT EXISTING:
- if existing in c:\Program Files\Total Commander\*.bar, should be copied to c:\Users\X\AppData\Roaming\GHISLER\*.bar and used from there.
- if not existing in c:\Program Files\Total Commander\*.bar, should be created and initialized with default settings in c:\Users\X\AppData\Roaming\GHISLER\*.bar.

Regards
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6000
Location: Meiningen (Südthüringen)

PostPosted: Thu May 17, 2018 8:48 am    Post subject: Reply with quote

2MarcinW
This would break (almost) all of my TC installations. I use a single default.bar for all users in %COMMANDER_PATH% (located in %ProgramFiles%\Total Commander), which is not writable for users (but for admins, of course). I expect TC to edit %COMMANDER_PATH%\default.bar when editing the button bar when TC is running as admin, in case I want to add another default button for all users. Your suggestion would change that and TC would edit %AppData%\Ghisler\default.bar instead. I would need to add a Buttonbar= setting in the wincmd.ini, hoping that TC's behavior with this setting present is not changed.

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
DrShark
Power Member
Power Member


Joined: 03 Nov 2006
Posts: 1092
Location: Kyiv, 68/262

PostPosted: Thu May 17, 2018 9:02 am    Post subject: Reply with quote

MarcinW wrote:
* IF NOT EXISTING:
- if existing in c:\Program Files\Total Commander\*.bar, should be copied to c:\Users\X\AppData\Roaming\GHISLER\*.bar and used from there.
It's not that simple: the *.bar files may have buttons with absolute paths to subbars in c:\Program Files\Total Commander\, so simple copying will break that buttons.

A possible solution is to set c:\Users\X\AppData\Roaming\GHISLER\ for *.bar by the installer only for clean installations (when user didn't choose the update and the installer didn't find own files on standard install), maybe the installer can even write that path to a ButtonBar key of wincmd.ini to make it compatible with older versions, so in case user will decide to downgrade, older TC will use that path to a button bar too, but it's possible that some compatibility issues will still exist even in that case.
_________________
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
Back to top
View user's profile Send private message
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7668
Location: Valsted, Denmark

PostPosted: Thu May 17, 2018 9:23 am    Post subject: Reply with quote

Quote:
...should be created and initialized with default settings

There is no default settings inside totalcmd.exe / totalcmdx64.exe - default.bar as it comes with the installer holds the default settings.
_________________
#524
Danish Total Commander Translator
TC 9.12 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b2 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Thu May 17, 2018 10:01 am    Post subject: Reply with quote

@Dalai: please don't confuse so-called administrator rights (when launching elevated TC) with Administrator account (when you log in with Administrator user name).

When launching elevated TC, you are still the same user (although with higher rights), so you still should have your configuration files placed in your user's directory - not in the global Total Commander directory.


But my idea would of course break your specific configuration. So maybe such a solution:

* IF EXISTING in c:\Users\X\AppData\Roaming\GHISLER\*.bar - it should be used.

* IF NOT EXISTING there, then c:\Program Files\Total Commander\*.bar should be used as long as it is only read; in case of writing, it should be copied to c:\Users\X\AppData\Roaming\GHISLER\*.bar, modified there, an used from there starting from this moment.

As long, as the user doesn't modify bars, it uses global settings. After modifying, it disconnects from global settings and starts using its custom settings.

Pros: button bars may be still administered globally - admin launches TC, modifies button bar (so it's copied from c:\Program Files\Total Commander\*.bar to c:\Users\Admin\AppData\Roaming\GHISLER\*.bar) and then copies modified files back to c:\Program Files\Total Commander\*.bar (please note that this must be done intentionally - it's not possible to overwrite someone's else configuration just by launching TC in elevated mode, as it is now).

Cons: When some user modified his button bar configuration, he will not benefit from global button bar configuration changes. But IMO it's still better than the current situation, when one user can modify other user's configuration, just by launching TC in elevated mode.

Regards
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6000
Location: Meiningen (Südthüringen)

PostPosted: Thu May 17, 2018 10:32 am    Post subject: Reply with quote

MarcinW wrote:
@Dalai: please don't confuse so-called administrator rights (when launching elevated TC) with Administrator account (when you log in with Administrator user name).

I don't confuse them. UAC is disabled on all system installed by me, because I use strict user separation, especially in a company environment. So, when running TC (or any other application) as administrator, it is using a different user account. In this context, I don't use "Run As Administrator" but "Run As Different User" instead.

Quote:
But IMO it's still better than the current situation, when one user can modify other user's configuration, just by launching TC in elevated mode.

Well, I'm wondering how many installations with more than one administrative account are out there where these users don't talk to each other, notifying each other of changes they made to the TC button bar... But, I guess my imagination is too limited Wink.

One thing should be obvious though: There is no simple solution to the seemingly unlimited configuration variety out there. "One size fits all" doesn't work, although some people try time and time again - especially Microsoft Evil or Very Mad...

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Fri May 18, 2018 4:30 am    Post subject: Reply with quote

Sorry, as I wrote, I prefer not to change this. It would break too many installations.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Behaviour which will not be changed All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group