Opening a new instance of TC with /O from an application with other rights

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

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

Re: Opening a new instance of TC with /O from an application with other rights

Post by *petermad »

Hacker wrote: 2022-08-28, 09:39 UTC Am I right that everyone would be happy if TC would accept a new command line parameter (e.g. /O!) which would not open a new TC instance under any circumstance?

Roman
I think this is a good solution.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 4594
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Opening a new instance of TC with /O from an application with other rights

Post by *white »

Hacker wrote: 2022-08-28, 09:39 UTC Am I right that everyone would be happy if TC would accept a new command line parameter (e.g. /O!) which would not open a new TC instance under any circumstance?
You mean really any circumstances? No new instance when there wasn't any yet? And also no new instance with OnylOnce=1 and 1 elevated instance running when a new instance would be created without /O)?

(Just asking what your proposal is)
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Fla$her »

Horst.Epp wrote: 2022-08-28, 10:34 UTC So for me any additional switch is fine.
It pleases. :)
Horst.Epp wrote: 2022-08-28, 10:34 UTCbut for me its looks like the changes Christian suggested are still lead to endless discissions.
They (there were several) require clarification and improvements. Therefore, additional questions are being asked.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Hacker »

white,
You mean really any circumstances?
I assume that was what was being requested. Fla$her would be the person to answer.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Fla$her »

Hacker wrote: 2022-08-28, 11:45 UTC Fla$her would be the person to answer.
Didn't I answer? I'll try in more detail:

If TC was started with an elevation and the launch command is executed without an elevation:

1. /O without specifying paths: a new instance should not start.
2. /O is missing, but there is OnlyOnce=-1, paths are specified: the current behavior remains when the second instance is not created.
3. If a new parameter is specified (/E, for example) or an attach to /O (:! :n :no :0, etc.), then a new instance is not created.
4. If /O is specified along with the paths, then a new instance is created, as it is now. This is the author's wish.

1-3. There should be no focus on the window. It is desirable to have a pop-up window (somewhere in the lower right corner of the screen) for 2-3 seconds warning about the reason for the start ban.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Hacker »

Fla$her,
I am not sure if I understand correctly, but from what you write I assume the answer is yes, then.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Fla$her »

2Hacker
I don't understand what you mean by yes. I'm writing how I see it as a result of the discussion. And how the author sees it, I have no idea, because he does not answer my questions.
Overquoting is evil! 👎
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Hacker »

Fla$her,
Well, white asked a question, I said you would be the correct person to answer yes or no. You answered in a lengthy four-point answer, from which I tried to understand that the answer to white's question is yes. Perhaps you simply missed white's question?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Fla$her »

2Hacker
I didn't understand the meaning of his questions well, especially in the context of your. In my opinion, he was asking about something of his own that he had discussed earlier. It will be easier for the author to guided by my points, IMHO.
Overquoting is evil! 👎
User avatar
white
Power Member
Power Member
Posts: 4594
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Opening a new instance of TC with /O from an application with other rights

Post by *white »

Fla$her wrote: 2022-08-26, 01:44 UTC
white wrote: 2022-08-26, 01:03 UTCAnd this is how it was added in Windows Commander 3.50:
10 years before the appearance of UAC, as a result of which these problems with elevating rights arose. :)
I wanted to show what the purpose of the parameter is, which is relevant now.

The introduction of the UAC didn't cause the problem you describe in your first post. The option OnlyOnce=1 was introduced very early on in the development of TC (then Windows Commander). It allowed only one running copy at the time. That behavior didn't change with the arrival of administrator accounts and normal accounts and the ability to run programs as a different user. If you had set OnlyOnce to 1 and had TC running elevated (before UAC that was every program run by an administrator) and would then run TC as a normal user passing paths as parameters. Tough luck, the paths couldn't be passed to the running TC and no new instance was created. The same when you had set OnlyOnce to 0 (or 1) and used parameter /O.

The situation remained the same with the arrival of UAC. UAC only made it harder to run programs elevated.

Then came TC 7.55 which introduced the behavior we see today. The default became to create an extra instance in the scenarios described above. If you have set OnlyOnce to 1 and have TC running elevated, running TC non-elevated creates a new non-elevated instance of TC. Likewise if you set OnlyOnce to 0 and run TC non-elevated with the /O switch. Regardless of any parameters.

If you want the old behavior you can set OnlyOnce to -1. Except that that doesn't work for the /O switch, which is the problem you reported.

All of this is not very well described in the Help. The Help about /O remained the same since it was added with Windows Commander 3.50. Only this was added to the Help about OnlyOnce to describe all of this:
Onlyonce=0 1: Start only one instance of Total Commander per user (e.g. started via RunAs)
-1: Start only one instance of Total Commander on this computer (for all users)
x>0: Same as 1, but multiple allowed per user
x<0: Same as -1, but multiple allowed on that computer (all users together)
First of all, it is good to understand that "on this/that computer" is poorly chosen. Replace that with "in the current logon session".
Also, the word "user" has been very poorly chosen to indicate "user account type" (Administrator or Standard). And actually should be described in terms of elevated/non-elevated. It never meant user.

Furthermore, it doesn't explain that only when you run TC non-elevated and a previous instance would be activated and that previous instance is elevated, and only if all already running instances are elevated, that a new instance can be created.

Example:
  1. Set OnlyOnce to 2.
  2. Run TC non-elevated.
  3. Run another instance of TC, this time elevated (this is now the last active one).
  4. Run another TC with parameter /O.
Now the elevated instance of TC is activated. If paths were also specified, those can not be passed to the elevated instance.
If you do these steps again, but replace step 2 with running TC elevated, then a new instance will be created.

It is also not explained that, if for example OnlyOnce is set to 3, the maximum number of instances is 3 to 6 depending on circumstances.
If you start 3 elevated instances first, you can add 3 non-elevated instances. (max 6)
But if you start 3 non-elevated instances first, you can add zero non-elevated instances. (max 3, non-elevated instance is activated instead)

When OnlyOnce is set to -3, then the maximum number of instances is 3 to 4.
A fourth instance is only possible when running 3 elevated instances and then running TC non-elevated with parameter /O. You know, because of the /O thing you talk about in the first post of this thread.
ghisler(Author) wrote: 2022-08-26, 07:03 UTC white words it as if I changed this deliberately to piss off people, but that isn't my intention.
Of course not. I think it is probably an unintentional side effect which you now approve of. I just don't agree with your reasoning and I am passionate in making my argument. That's all.
ghisler(Author) wrote: 2022-08-26, 07:03 UTC The main idea of /O is opening directories, if possible in an already running instance, otherwise in a new instance. It's not meant to prevent the launching of a second instance at all cost, that would need a new parameter.
/O is meant to activate the previous instance that was last active. That's how the program works. That's how it is described by you in command line syntax, help text and texts in history files.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Fla$her »

2white
I agree that more details are needed in the help.
But instead of cluttering up the topic with our thoughts, let's get at least some positive result from the author, otherwise two RC versions have been released, and there are still no additives.

2ghisler(Author)
Please do something already! You can call it premeditated behavior, but this behavior creates big problems. Please correct them. For me, this is perceived exactly as a bug, regardless of what goal you were pursuing (we just found out about it now).
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Opening a new instance of TC with /O from an application with other rights

Post by *ghisler(Author) »

Sorry, TC versions are meant for bugfixes only, no new functions.
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Hacker »

ghisler(Author) wrote:TC versions
*RC versions

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Fla$her »

ghisler(Author) wrote: 2022-08-31, 07:04 UTC Sorry, RC versions are meant for bugfixes only, no new functions.
OK. Start by disallow a new instance with /O without paths. This is definitely a bug.
Overquoting is evil! 👎
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Opening a new instance of TC with /O from an application with other rights

Post by *Fla$her »

ghisler(Author) wrote: 2022-08-25, 09:10 UTC A new parameter would be the best solution for this case.
ghisler(Author) wrote:TC 10.52 RC1: Command line parameters: option /O now supports a parameter, e.g. /O0 to never open a new instance in any case
Thanks! Immediately added to the settings. :)

Letter с is omitted:
Command line parameters wrote:number Same as value of OnlyOnсe= in wincmd.ini (positive or negative value)
Overquoting is evil! 👎
Post Reply