Version 17 Installer Leaves Multiple Copies of ShrAlias

Jun 2, 2008
391
2
Newton, MA
Try closing the TCMD window yourself while the updater is downloading the new build and see if that makes any difference.

To install build 53, I ran "option /u" and then immediately exited from Take Command, leaving ShrAlias running. The Windows Task Manager showed one copy running.

upload_2014-11-16_17-29-50.png

When the setup program asked for permission to close ShrAlias, I selected OK. The ShrAlias task disappeared from the Task Manager.

upload_2014-11-16_17-31-5.png

When the successful install message came up, there were still no ShrAlias tasks running.

upload_2014-11-16_17-31-45.png

I clicked on the "Run Take Command x64 17.0" button. By the time the registration dialog box came up, there were now two ShrAlias tasks running.

upload_2014-11-16_17-32-31.png

After Take Command started running, I executed "shralias /u" twice. After the second time, I got the "SHRALIAS unloaded" message, but a command prompt never appeared. I started a new tab and killed the original one. I could then run ShrAlias to get it running again.
 
Jun 2, 2008
391
2
Newton, MA
When the two shraliases were running, how many TCCs were running?

None that I could see on my screen. I didn't thinking of checking in the Task Manager to see if any had started before I responded to the registration pop-up. I'll try to remember to do that the next time I do an update.
 
Jun 2, 2008
391
2
Newton, MA
Then it's not an installer issue. If the installer were restarting anything, it would do it before that dialog appears.

So, what is causing ShrAlias to reload after the installer shut it down? When the installer shuts down processes that it promises to restart, how do those processes get restarted (i.e., by what)?

The two copies of ShrAlias are appearing before I have told Take Command whether I want to buy a copy, register the current copy, or just continue. Take Command has not appeared on the screen, and no tab with TCC has become visible. Indeed, my configured TCC tab can be seen starting after Take Command becomes visible, and it reports that ShrAlias is already running (indeed, running twice). So the TCC I told to run is not starting ShrAlias.
 
Jun 2, 2008
391
2
Newton, MA
Have you checked the TCStart files - you use?

That was discussed earlier in this thread. My TCStart file runs ShrAlias only if it is not already running. As Vince pointed out, if TWO or more TCC sessions started at nearly the same time, the test for ShrAlias (using the variable _shralias) might not detect its presence properly. So what I'm seeing would happen only if the startup of Take Command is running multiple copies of TCC -- all using the TCStart file -- before the Take Command window even appears on my screen.

Rex should be able to tell us if that's what happens invisibly in the background.
 

rconn

Administrator
Staff member
May 14, 2008
12,532
165
The installer only tries to restart those applications that are selected for restart. In the case of the TCMD installer, no applications are ever selected for restart. There are several that are shut down before the installer runs, namely tcc.exe, tcmd.exe, v.exe, tpipe.exe, and shralias.exe. None are restarted when the installer finishes.

If the installer were doing this, then all of the other apps (tcc, tcmd) would also end up with multiple instances after an installation. The updater sometimes creates batch files that it runs; I suppose it's possible it's invoking your TCC (depending on what you've set for COMSPEC) which is then starting SHRALIAS. You could easily prevent that by not starting SHRALIAS unless you're in a TCMD tab window.

TCMD will start the TCC tabs, *possibly* before the main TCC window appears -- it all depends on your video driver & system timing. Certainly nothing in TCMD would try to prevent Windows from running child processes before the video driver paints the window.

Try putting something like a MSGBOX in your TCSTART file to see if you're invoking it multiple times.
 
May 20, 2008
12,035
127
Syracuse, NY, USA
Someone just recently discovered BAT files used by the installer. It's quite possible two could be started in rapid succession. Jay, is .BAT associated with TCC on your system?
 
Apr 2, 2011
1,584
14
55
North Carolina, USA
That was discussed earlier in this thread. My TCStart file runs ShrAlias only if it is not already running. As Vince pointed out, if TWO or more TCC sessions started at nearly the same time, the test for ShrAlias (using the variable _shralias) might not detect its presence properly. So what I'm seeing would happen only if the startup of Take Command is running multiple copies of TCC -- all using the TCStart file -- before the Take Command window even appears on my screen.

Rex should be able to tell us if that's what happens invisibly in the background.

What about adding a delay of a few seconds then - right after ShrAlias is started?
 
Apr 2, 2011
1,584
14
55
North Carolina, USA
Someone just recently discovered BAT files used by the installer. It's quite possible two could be started in rapid succession. Jay, is .BAT associated with TCC on your system?

Looking at the contents of the BTM files - I believe they are used just to remove the file contents of the %appdata%\Roaming\JP Software folder tree.
 
Jun 2, 2008
391
2
Newton, MA
The installer only tries to restart those applications that are selected for restart. In the case of the TCMD installer, no applications are ever selected for restart. There are several that are shut down before the installer runs, namely tcc.exe, tcmd.exe, v.exe, tpipe.exe, and shralias.exe. None are restarted when the installer finishes.

I'm puzzled. The installer asks for permission to shut down ShrAlias, and it says that it will attempt to restart it. Certainly something is restarting it -- and in my case two copies of it. Where is that restart happening, and how does whatever it is know that it should do that?

I have added a command to TCStart to add an entry to a log file every time TCC starts. The next time I do an update, I'll check the log file to see if TCStart was run any times other than when my single TCC tab is started. I'll also try to look for TCC tasks running before Take Command comes up on my desktop.

As far as I know, .BAT files are not associated with TCC. If I run my ASSOC script (which invokes both assoc and ftype), here is what I see:

TCC(17.00.53): C:\>assoc bat & assoc btm

1. (ASSOC) Extension "BAT" is associated with file type "batfile".

2. (FTYPE) File type "batfile" is associated with the following command line:

"%1" %*

The extension BTM has no association defined.

If I run a BAT file from Windows explorer, it does not run in TCC (in my test file, I included a DELAY command that was ignored).
 

rconn

Administrator
Staff member
May 14, 2008
12,532
165
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.

As you said in a previous message, you get the same result when SHRALIAS isn't running when the installer runs. It's not installer related.

The installer has a list of apps to close, and another (sometimes including some of the first list) of apps to restart. TCMD stops some apps, but it never restarts ANY apps, other than optionally TCMD (when you click the button on the final installer dialog.)

You should be able to prove this to your satisfaction by starting the install, and then shutting down SHRALIAS and TCMD, and exiting the installer without starting TCMD. If SHRALIAS still starts up, then something in the updater is doing it. If it doesn't, but appears when you run TCMD manually, then TCC / TCSTART is doing it.
 
Jun 2, 2008
391
2
Newton, MA
As you said in a previous message, you get the same result when SHRALIAS isn't running when the installer runs. It's not installer related.

That is not quite the correct story. When I said that, I pointed out that I had not made certain that there were not several copies of ShrAlias running before I ran "shralias /u" to unload one copy. My suspicion remained that the problem was related to the installer's shutting down ShrAlias and then trying to restart it.

So, for my update to build 54, I was very careful to make sure that no copies of ShrAlias were running when I started. I then entered the command "OPTION /U" and immediately shut down TCC and TCMD. I then verified that no TCC, TCMD, or ShrAlias tasks were running.

Soon the Windows Task Manager displayed a "tcmdx64.exe *32". There were still no tcc or shralias tasks. I answered all of the prompts to start the update. A second copy of "tcmdx64.exe *32" appeared.

upload_2014-11-18_21-22-35.png

By the time the pop-up with the "Run Take Command" button appeared, only one copy of "tcmdx64.exe *32" remained.

upload_2014-11-18_21-21-54.png

After I clicked on the "Run" button, four (!) copies of TCC started running along with TCMD.

upload_2014-11-18_21-21-10.png

Once the TCMD window appeared and my TCC tab came up, there was only one TCC task (a new one) and one TCMD task (the original one).

upload_2014-11-18_21-23-51.png

My TCStart launched ShrAlias, since no copies had been running.

Contents of my boot log before the install were:

Started TCC 17.00.53 in TCMD tab: 11/17/14 00:52:27
Started TCC 17.00.53 in TCMD tab: 11/18/14 13:37:07

My boot log after the installation shows a new entry only for the copy of TCC in my TCMD tab:

Started TCC 17.00.53 in TCMD tab: 11/17/14 00:52:27
Started TCC 17.00.53 in TCMD tab: 11/18/14 13:37:07

Started TCC 17.00.54 in TCMD tab: 11/18/14 20:53:46

So the four transient copies of TCC that appeared during the installation did not run my TCStart script (or quit because of the transient/pipe test at the beginning).

So, assuming that Rex did not change something in the install setup, the problem of multiple copies of ShrAlias is related to the installer's shutting down a running ShrAlias task and later trying to restart it. When the next build comes out, I'll follow the update very closely again, but will leave the single copy of ShrAlias running when I start the install.
 
May 20, 2008
12,035
127
Syracuse, NY, USA
When I updated to build 54, I left SHRALIAS running (with my TCSTART starting it conditionally, as Jay's). At the end I said (like Jay) start TCMD. When all was said and done, I had onle one SHRALIAS running.

HOWEVER! ... During the upgrade, I had this in my TCSTART. It uses plugins which I have confidence in.
Code:
ECHO %_T9  %@MODULE[%_PPID] >> v:\tccrecord.txt[%_PPID]
After the update, that file contained this.
Code:
20:30:40.335  G:\TC17\tcmd.exe
20:30:40.679  C:\Windows\System32\cmd.exe
20:30:40.928  C:\Windows\System32\cmd.exe
20:30:40.991  C:\Windows\System32\cmd.exe
20:30:41.115  C:\Windows\System32\cmd.exe
20:30:41.427  C:\Windows\System32\cmd.exe
20:30:41.490  C:\Windows\System32\cmd.exe
I don't understand how that happens since those BATs left in %TEMP don't use EXTPROC (and .BAT has the Windows default association) unless there were others that were deleted.

In any case, there were certainly many TCC's started in a short period of time!
 
Last edited:
May 20, 2008
12,035
127
Syracuse, NY, USA
I was trying to keep it simple. My TCSTART actually recorded _PPID also. Those 6 TCC's started by CMD in less than a second were actually started by 3 distinct instances of CMD.
Code:
20:30:40.679  2976 C:\Windows\System32\cmd.exe
20:30:40.928  6636 C:\Windows\System32\cmd.exe
20:30:40.991  1796 C:\Windows\System32\cmd.exe
20:30:41.115  2976 C:\Windows\System32\cmd.exe
20:30:41.427  6636 C:\Windows\System32\cmd.exe
20:30:41.490  1796 C:\Windows\System32\cmd.exe
If I had to guess, I'd say updater.exe uses system() (recently pooh-poohed and declared obsolete) to start TCC.
 

Similar threads