[Implemented] New environment variable needed

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

User avatar
petermad
Power Member
Power Member
Posts: 16038
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

[Implemented] New environment variable needed

Post by *petermad »

After starting testing the x64 version of TC 8.0 I have had to make a lot of changes to my setup, everywhere where I start Total Commander in a new process.

In usercmd.ini and buttonbars I have used %COMMANDER_PATH%\TOTALCMD.EXE in 100's of places. They are all obsolete with the x64 version where it has to be %COMMANDER_PATH%\TOTALCMD64.EXE

I can off course change that in my *.ini and *.bar files, but then I cannot use the same files with the 32bit version, which I cannot discharge for a long time because of missing 64bit plugins.

So I suggest that we get a new environment variable:

%COMMANDER_PROGRAM%


to replace either: %COMMANDER_PATH%\TOTALCMD.EXE and %COMMANDER_PATH%\TOTALCMD64.EXE

or to replace just: TOTALCMD.EXE and TOTALCMD64.EXE.
Last edited by petermad on 2021-05-29, 20:24 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

I think it would be better if Christian kept calling TC totalcmd.exe.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3380
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

m^2 wrote:I think it would be better if Christian kept calling TC totalcmd.exe.
No! that way you cant have 32bit and 64bit in one dir...

@pertermad: if you dont use tc 32bit anymore why not just rename tc64.exe to tc.exe?


ps: tc=totalcmd
Hoecker sie sind raus!
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Sir_SiLvA wrote:
m^2 wrote:I think it would be better if Christian kept calling TC totalcmd.exe.
No! that way you cant have 32bit and 64bit in one dir...

@pertermad: if you dont use tc 32bit anymore why not just rename tc64.exe to tc.exe?


ps: tc=totalcmd
Obviously you can. You can rename it yourself. And I would guess that if you had both in the same dir, you would write a script to automatically launch the correct one. And such script can set a variable if needed. I think that changing app name is unnecessary mess.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50625
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can just rename totalcmd64.exe to totalcmd.exe if you don't want to run the 32-bit and 64-bit versions in parallel, or better create a hard link from totalcmd.exe to totalcmd64.exe (e.g. using the tool junction.exe from www.sysinternals.com ).
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16038
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2Sir_SiLvA
@pertermad: if you dont use tc 32bit anymore why not just rename tc64.exe to tc.exe?
As i wrote:
I cannot use the same files with the 32bit version, which I cannot discharge for a long time because of missing 64bit plugins.
So yes I do use the 32bit version. I also have a Win XP machine - it is much more practical if I can use the same .ini and .bar files with both computers.

2ghisler(Author)
You can just rename totalcmd64.exe to totalcmd.exe if you don't want to run the 32-bit and 64-bit versions in parallel,
Well, I can, but what about the users that use my extended menus - they would have to be instructed to do the same - a little akward. And what about updates - will the installer automatically rename totalcmd64.exe to toltalcmd.exe when it sees that it is present (and not being the 32bit exe in the same dir).

If I rename do I also have to rename TOTALCMD64.EXE.MANIFEST ?

Anyway - renaming seems to simply be an unpractical workaround, that doesn't even take into account that the 32bit and 64bit versions can be installed in the same dir.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

I support the suggestion for new internal variable like %COMMANDER_PROGRAM% since it's much easier to replace one string in all configuration files then the adaptation of the one instance of each config file for both 32 and 64 bit Total Commander installed in same directory.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Support++

Especially if you are using a portable installation you may want to start the 32bit TC version on 32bit systems.
One additional environment variable like %COMMANDER_PROGRAM% saves you the effort to install and maintain 2 versions in different installation paths.

Regards
Holger
Make our planet great again
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Support++

Otherwise I need to maintain 2 buttons:

Code: Select all

TOTALCMD#BAR#DATA
%Commander_Path%\TOTALCMD.EXE
/S=S "%X%Z%P" "%T"
%Commander_Path%\TOTALCMD.EXE,32
sync32
%Commander_Path%
0
-1

Code: Select all

TOTALCMD#BAR#DATA
%Commander_Path%\TOTALCMD64.EXE
/S=S "%X%Z%P" "%T"
%Commander_Path%\TOTALCMD64.EXE,32
sync64
%Commander_Path%
0
-1
User avatar
tbeu
Power Member
Power Member
Posts: 1354
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Post by *tbeu »

2Sir_SiLvA
Sir_SiLvA wrote:No! that way you cant have 32bit and 64bit in one dir...
I would not recommend to install 32 and 64 bit version in same directory. Keep it separate and you can keep the old name TOTALCMD.EXE.

2Peter_Mad
Can you fix title typo in environtment
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

All we need is 64-bit version of Autorun.wdx. It is possible to define desired envvar using this plugin. Currently the only way is to start both TC versions via a batch that will set corresponding envvar.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3380
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

Please God no!
the names as they are now with a 64 are the best solution.
Apart from Autorun.wdx wich is a old Plugin that never worked correctly...
Hoecker sie sind raus!
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Sir_SiLvA wrote:the names as they are now with a 64 are the best solution.
It doesn't magically solve everything, but instead brings new problems, although I admit that's because not everyone adopted the same approach with appending "64". Did you see related thread about OpenSSL dlls? How would you solve that?

I don't think you really need both TCs in same directory, correct me if I'm wrong. What is needed are shared settings. And it should be possible even with separate TCs. Things like button bar files can be put somewhere where they can be referenced using environment variables. Plugins should store their settings in same directory where TC ini files are. A lot of them don't, but if their authors find time to produce 64-bit versions, they could fix this too.

The only real problem I see, and I must admit it's not a small one, is that it requires user to make some configuration changes, possibly a lot of them, which is of course bad. But it should be one-time thing. And maybe some nice tool to help with that could be made?
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3380
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

I dont think a new Variable wasting Virtual Space solves anything as in the long run
- If Chris doesnt come up with a clever way -
you will need 2 Ini-Files (one for 32/64 Bit each) as 64Bit needs 64Bit-Plugins
shared things like Gui, Copy-Etc-Options can be shared with RedirectSection
So id prefer if for sections like Plugins there would be an Option called
RedirectSection64 (only read by TC64 ofc and overriding RedirectSection)

i dont get it how someone can waste so much space with
In usercmd.ini and buttonbars I have used %COMMANDER_PATH%\TOTALCMD.EXE in 100's of places
but im surly the only one that doesnt understand that nonesense...
But to solve that Problem as Pointed out its easier to use 2 seperate directories for 32/64Bit TC with using RedirectSection...
(wich would solve also the openssl-nonesense...)

that could look ie
TotalCommand
-> TC32Bit
-> TC64Bit
-> Inis
-> PlugIns

me, I prefer 32 & 64 bit in one folder and a 64 at all 64Bit files to easily see wich are 64Bit and wich are not cause compared to 16Bit 32Bit wont die out that fast...
Hoecker sie sind raus!
User avatar
HolgerK
Power Member
Power Member
Posts: 5411
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

So id prefer if for sections like Plugins there would be an Option called
RedirectSection64 (only read by TC64 ofc and overriding RedirectSection)
Just a thought:

Code: Select all

pluginbasedir=%COMMANDER_PATH%\plugins%PROCESSOR_ARCHITECTURE%
[PackerPlugins]
RedirectSection=%COMMANDER_PATH%\wincmd_Plugins%PROCESSOR_ARCHITECTURE%.ini
[ListerPlugins]
RedirectSection=%COMMANDER_PATH%\wincmd_Plugins%PROCESSOR_ARCHITECTURE%.ini
[FileSystemPlugins]
RedirectSection=%COMMANDER_PATH%\wincmd_Plugins%PROCESSOR_ARCHITECTURE%.ini
[ContentPlugins]
RedirectSection=%COMMANDER_PATH%\wincmd_Plugins%PROCESSOR_ARCHITECTURE%.ini
Regards
Holger
Post Reply