Version 17 Installer Leaves Multiple Copies of ShrAlias

Jun 2, 2008
376
2
Newton, MA
I have found that after installing updates there are multiple copies of ShrAlias running (I have seen as many as three).

-- Jay
 
Jun 2, 2008
376
2
Newton, MA
My TCSTART file starts ShrAlias only if it is not already running. There is a test of _shralias; ShrAlias is run only if the value is zero.

During the installation process, there is a screen that reports that ShrAlias is running and says that it will be turned off and then restored once the installation is complete. Something is going wrong in the process. Perhaps the installer is not shutting it down, but the value of _shralias is still 0.

Running the command ShrAlias cannot start a second copy; it reports that ShrAlias is already running.

I can try to watch more carefully at the next update.

-- Jay
 
May 20, 2008
11,437
99
Syracuse, NY, USA
If the installer couldn't stop it, it couldn't install a new file. I suspect that would generate an error message.
 

rconn

Administrator
Staff member
May 14, 2008
12,369
150
Unless you're installing in different directories every time, you cannot have multiple live copies of SHRALIAS running. Maybe a couple of zombie processes that Windows failed to shut down properly -- but that would be a question for Microsoft.

There were no changes to SHRALIAS for v17.
 
Jun 2, 2008
376
2
Newton, MA
What you say may be fine in principle, but it happened again!

I just updated to build 50. The screen came up advising me that "Some files that need to be updated are currently in use". I allow the installer to "Automatically close applications and attempt to restart them after setup is complete". Then I select the option to run TCMD at the end of the install.

TCMD starts up with TCC in tab 1. It shows the following output generated by TCSTART:

TCC 17.00.50 x64 Windows 7 [Version 6.1.7601]
TCC Build 50 Windows 7 Build 7601 Service Pack 1

Running C:\tcmd\ver17\TCSTART.btm

No need to load SHRALIAS. It is already running.​

When I then run TASKLIST, it shows two ShrAlias tasks running:

PID Program Window Name
--- -------------- ----------------
6796 ShrAlias ShrAliasWindow
4388 ShrAlias ShrAliasWindow


The copy with PID 4388 is using 204K of memory; PID 6796 is using 220K. Neither has used any CPU time. I don't know how to learn any more about them.

After I run SHRALIAS /U, only PID 4388 remains. To prevent any trouble, I run SHRALIAS /U again to kill the remaining one and then run SHRALIAS afresh to get it running again. After that, I have PID 7380 using 188K.

-- Jay
 
May 20, 2008
11,437
99
Syracuse, NY, USA
Does the installer offer to restart SHRALIAS? That doesn't seem right. I wouldn't expect SHRALIAS to find any memory mapped files to guard if it wasn't started by TCC.
 
Jun 2, 2008
376
2
Newton, MA
Here is the screen that is shown. It claims to be the "Advanced Installer".

-- Jay

upload_2014-11-10_17-2-48.png
 

Attachments

  • upload_2014-11-10_17-2-14.png
    upload_2014-11-10_17-2-14.png
    72.5 KB · Views: 98
May 20, 2008
11,437
99
Syracuse, NY, USA
As I said, it seems silly for anything but TCC to start SHRALIAS. If fact, I wouldn't expect SHRALIAS to keep running if it weren't started by TCC. Could that be the problem ... the installer restarts it and it stays running (when it shouldn't)?
 
Jun 2, 2008
376
2
Newton, MA
This is something that I have never seen happen with previous versions of Take Command.

I have an alias called "update" that calls "option /u". I have now added code to unload ShrAlias first.
 
Jun 2, 2008
376
2
Newton, MA
Well, even though I had shut down ShrAlias before updating, after updating to build 51 and launching TCMD, there were two copies of ShrAlias running. Now, I did not discover this until after opening some additional tabs, so I don't know that two copies appeared immediately.
 
May 20, 2008
11,437
99
Syracuse, NY, USA
Well, even though I had shut down ShrAlias before updating, after updating to build 51 and launching TCMD, there were two copies of ShrAlias running. Now, I did not discover this until after opening some additional tabs, so I don't know that two copies appeared immediately.
Q: Were any there after the install but before you launched anything?
 
Jun 2, 2008
376
2
Newton, MA
I don't know when they appeared. Now that I have seen this even after I at least thought that I had shut down all copies of ShrAlias before updating to the new build, I will try to remember to watch very carefully at the next update. Perhaps there had been three copies before I ran ShrAlias /u in my update alias. The installer did not report that ShrAlias was running and ask me if it should shut it down. So, if there were copies running, they were not visible to the installer. This is all very bizarre.
 
May 26, 2008
537
4
I haven't seen this problem and I update versions pretty frequently. The installer always prompts to shut down shralias, which I let it do. First launch of TCMD after installation restarts sharalias (tcstart.btm starts it if it's not already running). Never had an issue with multiple instances.
 
May 20, 2008
11,437
99
Syracuse, NY, USA
Jay, how many startup (TCC) tabs do you have defined? If one tries to start SHRALIAS too soon after another does, the second one won't be able to figure out that SHRALIAS is already running. It's quite easy to start two instances of SHRALIAS if you do it quick enough.
Code:
v:\> shralias & shralias
SHRALIAS loaded
SHRALIAS loaded

v:\> tasklist | grep -i shra
  5504  ShrAlias  ShrAliasWindow
  4516  ShrAlias  ShrAliasWindow
Also, for the same reason:
Code:
v:\> shralias &  echo %_shralias
SHRALIAS loaded
0
 
May 20, 2008
11,437
99
Syracuse, NY, USA
And I suppose that could also happen with only one TCC if TCSTART.BTM caused a transient/pipe instance of TCC to be started.
 
Jun 2, 2008
376
2
Newton, MA
TCMD starts only one TCC tab, which launches ShrAlias if it is not already running. Also, I never had this problem before version 17, and my configuration has not changed in any substantive way. As I wrote earlier, I will try to remember to watch things very carefully with future updates.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,469
88
Albuquerque, NM
prospero.unm.edu
Jay, how many startup (TCC) tabs do you have defined? If one tries to start SHRALIAS too soon after another does, the second one won't be able to figure out that SHRALIAS is already running. It's quite easy to start two instances of SHRALIAS if you do it quick enough.

Hmmm.... Perhaps Take Command should have an option to automatically start SHRALIAS before any tab windows?
 
May 26, 2008
537
4
Maybe you could do your SHRALIAS check/load only if %_TCTABACTIVE = 1. If you are starting multiple TCC tabs on TCMD startup, only the first (active) tab would do the work.
 
May 26, 2008
537
4
I'm thinking something like this for tccstart.btm. (It would need to be adjusted if you ever run TCC outside of TCMD though.)

Code:
@echo off

if %_pipe == 1 .or. %_transient == 1 quit

iff %_shralias == 0 .and. %_tctabactive == 1 then
  shralias

  history /r    "%@path[%@full[%0]]cmdhist.txt"
  dirhistory /r "%@path[%@full[%0]]dirhist.txt"
  alias /r      "%@path[%@full[%0]]aliases.txt"
  function /r   "%@path[%@full[%0]]functions.txt"

  alias desk:=%@shfolder[0]
  alias docs:=%@shfolder[5]
  alias drop:=%USERPROFILE%\Dropbox
endiff

...
...
 
May 20, 2008
11,437
99
Syracuse, NY, USA
TCMD starts only one TCC tab, which launches ShrAlias if it is not already running. Also, I never had this problem before version 17, and my configuration has not changed in any substantive way. As I wrote earlier, I will try to remember to watch things very carefully with future updates.
It's a matter of timing, so it being one way in one version and another way in another version is not a conclusive argument that something's wrong. IIRC, the check for a running SHRALIAS is a check for the existence of a window; if the check is made too soon, the window won't exist. Jay, does your TCSTARY cause any transient or pipe instances of TCC to be started? If so, check for that in TCSTART as in Rod's example.

A better solution ... put all that loading of the lists and starting SHRALIAS in its own BTM and put it in the startup folder or run it at logon via a task. That'd avoid unnecessary stuff every time you start TCC. I have a BTM hat runs at logon and does several things that need to be done only once. Among them is:
Code:
cdd %SHRALIAS_SAVE_PATH
do c in /L history dirhistory alias function ( %c /r %c.sav )
shralias
delay 2
 
Jun 2, 2008
376
2
Newton, MA
My TCSTART file does check at the beginning to see if it is running in a transient or pipe, and it skips right out in those cases. I don't think this is a timing issue on my system. ShrAlias gets started only when the first tab of TCMD opens during boot up of my computer.
 
May 20, 2008
11,437
99
Syracuse, NY, USA
I think there's only two ways to get more than one SHRALIAS running at the same time.
1. call SHRALIAS.EXE directly (which I doubt is being done)
2. call the internal SHRALIAS more than once in rapid succession
 
Jun 2, 2008
376
2
Newton, MA
When updating just now to build 52, I used the Task Manager to keep track of the ShrAlias copies running. I purposely left it running in TCC before I issued the command "option /u". When I got to the point in the installation process where I was asked about automatically closing it and then restarting, the installer shut it down.

Later when I clicked on the option to run Take Command now, at the point when the registration prompt came up, two copies of ShrAlias started running, as shown in the following screen capture.

upload_2014-11-13_6-23-7.png

After clicking "Continue", TCMD started and ran TCC in one tab. It showed the following:

TCC 17.00.52 x64 Windows 7 [Version 6.1.7601]
TCC Build 52 Windows 7 Build 7601 Service Pack 1

Running C:\tcmd\ver17\TCSTART.btm

No need to load SHRALIAS. It is already running.

TCSTART saw that ShrAlias was already running and did not try to load it again. Unloading it went as follows:

TCC(17.00.52): C:\Users\Jay\DOCUME~1\mydrop~1>shralias /u
SHRALIAS unloaded

TCC(17.00.52): C:\Users\Jay\DOCUME~1\mydrop~1>shralias /u
SHRALIAS unloaded

TCC(17.00.52): C:\Users\Jay\DOCUME~1\mydrop~1>shralias /u
SHRALIAS not loaded

That got rid of the two copies. Starting a second TCC tab produced the following, as expected:

TCC 17.00.52 x64 Windows 7 [Version 6.1.7601]
TCC Build 52 Windows 7 Build 7601 Service Pack 1

Running C:\tcmd\ver17\TCSTART.btm

Loading SHRALIAS
SHRALIAS loaded

set /r c:\tcmd\ver17\env.cfg
alias /r c:\tcmd\ver17\diralias.cfg
alias /r c:\tcmd\ver17\alias.cfg
function /r c:\tcmd\ver17\function.cfg
 

Attachments

  • upload_2014-11-13_6-24-1.png
    upload_2014-11-13_6-24-1.png
    25.5 KB · Views: 86
May 20, 2008
11,437
99
Syracuse, NY, USA
Good detective work, Jay. That's pretty definitive. Rex will probably figure out what's happening.

Curious ... did you notice if TWO TCCs were started (to handle the registration dialog, before TCMD)?
 
Jun 2, 2008
376
2
Newton, MA
Curious ... did you notice if TWO TCCs were started (to handle the registration dialog, before TCMD)?

I did not notice any TCC sessions sessions before TCMD opened and my one tab loaded. If Rex is running TCC sessions to finish the install, they should do something to avoid using the user's INI file and certainly the TCSTART script. I also don't know why more than one instance of TCC would be used (but, then again, I don't really have much of an idea about what happens during the installation).
 
Jun 2, 2008
376
2
Newton, MA
TCC is not used at all during installation. (Nor is TCMD, IDE, or SHRALIAS.)

So what is happening in the installer to kill and then reload ShrAlias? All I'm doing is running the installer. ShrAlias was gone before I clicked the button to start Take Command, and the two copies appeared before the registration screen came up.

Is there anything else you want me to look at during the update process (e.g., whether any TCC sessions are still running). TCMD is certainly closing, but I don't know what exactly what the installer is doing to shut it (and any TCC tabs) down.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica New version of installer? Support 10
D Version 28 LIBRARY changes have side effects Support 1
Dmitry L. Kobyakov How to? How to remove the record of the old version of the Take Command? Support 9
D Documentation WebHelp lands at version 26 Support 4
fishman@panix.com HELP!! I just updated to Version 28 and as usual I cannot make extended directory search work. Support 2
T Take Command 28: Lua reports version 5.4.0 (5.4.3 expected) Support 0
S Issues with version v26.02.42 x64 Support 0
Joe Caverly Documentation COMMANDS in Version 27 help Support 8
C version help Support 3
R Inconsistency in @version's use of quotes Support 2
thorntonpg What is the latest version of everything Support 1
S Windows Server version not being detected correctly in TCMD 26RC2 Support 9
D Which is the latest version for Windows XP? Support 2
gentzel "Check for Updates" appears to be checking for old version Support 2
D Fixed @VERSION does not increment pre-fixed version numbers. Support 1
nikbackm TCMD 25 - Unregister older TCMD version Support 2
Stefan Hassel Installation file TC 24.02 Build 47 is actually version 25.00.1 Support 10
Joe Caverly What version and Windows OS are you using? Support 3
Dmitry L. Kobyakov From old version: had the setup's error been corrected? Support 6
R How to? Compare executables' version/build # including 123.456.789.01 Support 10
RChrismon How to? Copy TCMD.INI to New Version Support 7
vefatica Windows 10 version number? Support 6
H @ceiling @floor @int not working version 21.01.63 Support 9
B Everything version in Take Command build 39? Support 3
G Version 20.11 installed on Windows 10 problems Support 9
M ANSI is used to show files instead of OEM in version 17 to 19 ! Support 5
E How to? Create a portable version of TCMD to use on other computers w/o installation Support 4
C 21b47 version[] Support 4
fishman@panix.com Version 21.23 fails to install Support 4
E Fixed View command broken in version 21.0 build 22 Support 9
rconn News Take Command + TCC + TCC-RT Version 21 Public Beta (RC1) Support 0
R How to? Not have RT version show on start Support 3
Roedy WAD Version number Support 1
Craig Fitzgerald problem with executable extensons with TCC version 19.10.51 x64 Support 3
Jesse Heines How to? Everything Tool Not Working After Version 20 Installation Support 8
T Portable instructions for version 19 Support 7
cgunhouse Version 19.00.23 Crashes Support 16
vefatica Updater says wrong version Support 1
Sande Nissen TCC/LE version? Support 6
Mordachai Upgrades - can I skip version(s)? Support 2
D Version 18 changed the naming convention of TC's folder Support 5
D Started suggestions, not in this version (yet?) Support 1
fishman@panix.com How about updating the version shown when you upload a new one? Support 4
Joe Caverly PLUGINs and Version 17.0 Support 4
C Is 17.00.55 same as release version? Support 3
M How to? Start the version of Take Command that I want... Support 7
B Help file problem with version 16 Support 2
T "Checking for a newer version" doesn't complete Support 18
Dan Glynhampton Fixed @version "force" flag not working, and unable to set separator Support 3
J Required version for Windows 8.1? Support 2

Similar threads