Topic: Need help for TotalCommander Plugin (dual x86&x64)  (Read 8843 times)

Need help for TotalCommander Plugin (dual x86&x64)
« on: December 15, 2014, 09:56:21 PM »

Nemo

  • Jr. Chef
  • **
  • Date Registered: Dec 2014
  • Posts: 14
I adopted TotalCommander.script from German c't-Magazine's Notfall-Windows 2011 based on WIN7PE for use in WIN81PESE.
Source file is Mr. Ghisler's combined version http://download.betanews.com/download/945901171-1/tcm851ax32_64.exe. I unpacked it to "<ProjectDir>\Workbench\Common\TC" and added my license file wincmd.key.
Everything works fine and both EXEs can be found after booting the ISO in "X:\Program Files\Totalcmd\*.exe".
Only shortcuts do not match windows' architecture. When I start x86 I want to have the x86 shortcuts to be generated and same with x64 on x64 Windows.
Excerpts from the script file:
Code: [Select]
...
[Variables]
%ProgramFolder%=Totalcmd
If,%SourceArch%,Equal,x64,Begin
  %ProgramEXE%=totalcmd64.exe
  %ProgramTitle%=Total Commander 64
  Else
  %ProgramEXE%=totalcmd.exe
  %ProgramTitle%=Total Commander 32
End

[Process]
...
If,%pCheckBox3%,Equal,True,AddToPEShell,%ProgramTitle%
If,%pCheckBox5%,Equal,True,Add_Shortcut,StartMenu,QuickLaunch
If,%pCheckBox6%,Equal,True,Add_Shortcut,Desktop
...
Now I always get x86 shortcuts; when I change the sequence under [Variables] (x86 first, x64 second) I always get x64 shortcuts.

My environment:
- WIN81SE82_Builder on Win8.11-x64 ProWMC
- ISOs tested in VMware WS

Any ideas how to fix that problem?
If more information needed drop me a line!



« Last Edit: November 20, 2015, 02:42:07 PM by Lancelot »

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #1 on: December 16, 2014, 10:05:35 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
The Variables section is only used to define variables, without process inside (if or others).
I have not looked at your plugin but you can do it like this :

Code: [Select]
[Variables]
%ProgramEXE%=totalcmd.exe
%ProgramEXEx64%=totalcmd64.exe
%ProgramTitle%=Total Commander 32
%ProgramTitlex64%=Total Commander 64

[Process]
...............
If,%SourceArch%,Equal,x64,Begin
  Set,%ProgramEXE%,%ProgramEXEx64%
  Set,%ProgramTitle%,%ProgramTitlex64%
End

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #2 on: December 17, 2014, 12:00:32 AM »

Nemo

  • Jr. Chef
  • **
  • Date Registered: Dec 2014
  • Posts: 14
Thanks for your quick reply. I changed the script according to your proposal to
Code: [Select]
[Variables]
%ProgramFolder%=Totalcmd
%ProgramEXE%=totalcmd.exe
%ProgramTitle%=Total Commander 32
%ProgramEXE64%=totalcmd64.exe
%ProgramTitle64%=Total Commander 64

[Process]
If,%SourceArch%,Equal,x64,Begin
  %ProgramEXE%=%ProgramEXE64%
  %ProgramTitle%=%ProgramTitle64%
End
If,NotExistFile,"%pFileBox1%\%ProgramEXE%",run,%ScriptFile%,Download
Echo,Processing %ProgramTitle%...
RunFromRam,True
CopyProgram,%pFileBox1%
ExtractAllFiles,"%ScriptFile%","Folder","%TargetDir%\Windows"
...
Add_Shortcut,StartMenu
If,%pCheckBox3%,Equal,True,AddToPEShell,%ProgramTitle%
If,%pCheckBox5%,Equal,True,Add_Shortcut,StartMenu,QuickLaunch
If,%pCheckBox6%,Equal,True,Add_Shortcut,Desktop
...
but unfortunately always the x86 shotcuts were generated.  :sad:
Tested with ISOs in x86, x64 and AiO (started in x64 or x86 mode) under VMware WS.
WinBuilder on win8.11-x64 ProWMC

Regards, Nemo

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #3 on: December 17, 2014, 05:50:06 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
give me some time nemo, I will prepare a total commander plugin very soon  :thumbsup:

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #4 on: December 17, 2014, 09:42:08 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
I changed the script according to your proposal to
Quote
If,%SourceArch%,Equal,x64,Begin
  %ProgramEXE%=%ProgramEXE64%
  %ProgramTitle%=%ProgramTitle64%
End
Not really  :wink:  it is by trying that we learn :thumbsup:
For your next Apps, you can use "Utils\PC Packed" to prepare plugins and for syntax, look at right and left what is done and tries.
Quote
If,%SourceArch%,Equal,x64,Begin
  Set,%ProgramEXE%,%ProgramEXEx64%
  Set,%ProgramTitle%,%ProgramTitlex64%
End

You are Lucky that Lancelot will prepare a TC plugin very soon   :great:

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #5 on: December 17, 2014, 12:33:38 PM »

Nemo

  • Jr. Chef
  • **
  • Date Registered: Dec 2014
  • Posts: 14
Thanks, ChrisR, for your hint!
The one who can read has a big advantage. (Translation from "Wer lesen kann, ist klar im Vorteil".)
Regards, Nemo

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #6 on: December 17, 2014, 10:21:19 PM »

Nemo

  • Jr. Chef
  • **
  • Date Registered: Dec 2014
  • Posts: 14
Now I presented the solution of my efforts and your active support (!) in c't Magazine's forum under http://www.heise.de/forum/c-t/Kommentare/c-t-Notfall-Windows-2014/Jugend-hat-geforscht/posting-2193988/show/.
I'm looking forward to Lancelot's script.

Regards, Nemo

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #7 on: December 18, 2014, 01:09:00 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Here it is,

I didn't change title (shortcut name) since unnecessary, packed files inside to be portable plugin, provide files button to provide license, custom wincmd.ini etc... more languages can be added more easly now.
ps: provide files can also be used to update total commander by providing latest  :wink:

http://yomi.cwcodes.net/Temp/Total%20Commander.Script

@Chris,

due to Total Commander verrry high popularity, you may consider adding this plugin to SE projects,
else on Yomi  :wink: Decision up to you  :great:

@anshad,

check language selection trick inside plugin (from other plugins of JohnF ),
see how easy to add provide files button,

it is a nice example of "SinglePackage MultiArchitecture Multiexename" plugin, only 4 lines to PC Packed, job done,
..
%ProgramEXEx64%=totalcmd64.exe
..
If,%SourceArch%,Equal,x64,Set,%ProgramEXE%,%ProgramEXEx64%
..
Call,HostOSArch
If,%HostOSArch%,Equal,x64,Set,%ProgramEXE%,%ProgramEXEx64%


rest is total commander specials ....



See You
:turtle:
« Last Edit: December 18, 2014, 02:07:40 AM by Lancelot »

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #8 on: December 18, 2014, 01:29:46 PM »

Nemo

  • Jr. Chef
  • **
  • Date Registered: Dec 2014
  • Posts: 14
Hi Lancelot,
Thanks your version of TotalCommmander.script.

Unfortunately  :sad: building stops at line 60 (FileCopy,%Target_Prog%\%ProgramFolder%\wimcmd.ini,%Target_Win%)
Code: [Select]
(Total Commander) FileCopy - Failed to copy [%BaseDir%\Target\Win8.1SE\Programs\Total Commander\wimcmd.ini] to: [%BaseDir%\Target\Win8.1SE\Windows\wimcmd.ini]: Das System kann die angegebene Datei nicht finden.
Translation: "System can't find named file"; although wincmd.ini IS available under "%BaseDir%\Target\Win8.1SE\Programs\Total Commander"
WinBuilder (W81PESE_2014-10-17) started as "Administrator"
Language in script switched to German DEU
MS Defender is de-activated
Source: Win8.11-x64 ProWMC
HostOS: Win8.11-x64 ProWMC

If further details needed tell me.
Regards, Nemo

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #9 on: December 18, 2014, 01:52:26 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Thanks Nemo,

yet another winbuilder bug ...

Thanks for feedback, I workaround the trouble  :thumbsup:

Redownload See how it goes  :wink:


btw you nicely catch before going out  :tongue:

@Chris, JFX, Galapo,

This is very reproducable ( at least now) timing trouble of current builder at latest win-hosts  :wink:
 we had faced this time to time with other stuff (.cmd , .au3 ..),
  We workaround all such things plugins, besides this example maybe more reproducable  :wink:

:turtle:

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #10 on: December 18, 2014, 07:10:40 PM »

Nemo

  • Jr. Chef
  • **
  • Date Registered: Dec 2014
  • Posts: 14
Thanks, Lancelot!  :thumbsup:
Now it works!
Reagards, Nemo

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #11 on: December 19, 2014, 10:43:02 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
yet another winbuilder bug ...

Thanks for feedback, I workaround the trouble  :thumbsup:
I also reproduced easily the bug with Win7  :wink:
Indeed, a timeout bug between the Dircopy and the following WinCmd.ini FileCopy, the last file copied by DirCopy.
It Works fine now :thumbsup:
Busy in this year end, I will look to put Total Commander on SE server in early next year.

Just to see and for the next time, I tried also with this workaround to DirCopy, that also works
Code: [Select]
DirMake,%Target_Prog%\%ProgramFolder%
FileCopy,%ProjectTemp%\TempExtractFolder\%ProgramFolder%\%ProgramFolder%\*,%Target_Prog%\%ProgramFolder%
FileCopy,%Target_Prog%\%ProgramFolder%\wincmd.ini,%Target_Win%

ps: In a future version, when you, we have time,  we can perhaps gained a bit of space by removing  32 or 64 bits files (eg: Totalcmd/Totalcmd64), not tested.

:xmas-beer:   

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #12 on: December 19, 2014, 11:14:29 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Just to see and for the next time, I tried also with this workaround to DirCopy, that also works

Sure, I had used it a lot in verrry past  :thumbsup:
 but than noticed overall build speed down,
   since filecopy * index files first and copy one by one,
    that is the reason most plugins prepare stuff elsewhere and dircopy to target which works much faster (where possible)
     (with increasing number of plugins converted from filecopy to dircopy in past, very noticable ...)
       yes we have to use  filecopy * time to time, less usage better life  :smile:

ps: In a future version, when you, we have time,  we can perhaps gained a bit of space by removing  32 or 64 bits files (eg: Totalcmd/Totalcmd64), not tested.

I also noticed 4-5 MB, I decided not to in order to create a simple plugin (4 additions to pc packed)
If you decide to, also change program folder name  :wink:

5-6 more line additions/replacements required, something like :

%ProgramFolderx64%=%ProgramFolder%_x64
..
If,%SourceArch%,Equal,x64,Run,%ScriptFile%,PluginSetx64
..
[PluginSetx64]
Set,%ProgramFolder%,%ProgramFolderx64%
Set,%ProgramEXE%,%ProgramEXEx64%
//Set,%SetupFile%,%SetupFilex64%
//Set,%FArch%,x64


and better delete at lines before Add_Shortcut to leave launch button work  :wink:
leaving to you, to me current one is 4-5 mb bigger besides fits me  :wink:

happy Christmas  :xmas-beer:


edit:
for total commander, no need to change folder name, since total commander specially designed to work this way,
 only deleting files will be enough,
  still if you like to have different settings for x86/x64 total commander, above trick will work.
above is good coding example for changing folder name for multiarch plugins
 reason behind, see reply 4 http://theoven.org/index.php?topic=1142.msg13219#msg13219
« Last Edit: December 28, 2014, 06:31:14 AM by Lancelot »

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #13 on: December 19, 2014, 11:58:13 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
On my full build, I have Both 32 and 64 bit versions, so it's OK for me too, to have the Full TotalCommander in the same folder  :thumbsup:
And your explanations are here for those who want to reduce it for a single architecture  :thumbsup:

happy Christmas Too :xmas-beer:
« Last Edit: December 19, 2014, 11:58:28 AM by ChrisR »

Re: Need help for TotalCommander.script (dual x86&x64)
« Reply #14 on: December 19, 2014, 02:58:01 PM »

anshad

  • Chef
  • ***
  • Date Registered: Apr 2012
  • Posts: 323
Thanks Lancelot. Although i don't use "Total Commander", i  downloaded the script mainly to check and learn how you did it. Now i am spending most of my free time to learn about coding scripts. Thanks again for all the tips and helps you have given so far  :thumbsup:

 

Powered by EzPortal