Re: Opening a new instance of TC with /O from an application with other rights
Posted: 2022-08-24, 16:32 UTC
Sorry, if you don't tell me what I misunderstood, I have no idea what I did wrong.
Forum - Public Discussion and Support
https://www.ghisler.ch/board/
Do you understand that in the first post there is not a word about sending messages?ghisler(Author) wrote: 2022-08-24, 06:49 UTC /O does not override the problem that elevated programs cannot receive messages from programs running with normal user rights. This is a Microsoft security measure, and I do not want to bypass it.
Fla$her wrote: 2022-08-14, 07:53 UTC As a last resort, I prefer a window that gives the right to choose to launch a separate instance. Or even ignore the launch as such.
But you don't explain why the second instance of the program opens when there is already one running with elevated rights.ghisler(Author) wrote: 2022-08-24, 10:34 UTCSo the switch is meant to pass parameters to an already running instance (if that exists). Otherwise it works just like without the switch.
Exactly. They are opposites. While /N is to force extra instances, /O is to force no extra instances are created.Fla$her wrote: 2022-08-24, 17:41 UTC But you don't explain why the second instance of the program opens when there is already one running with elevated rights.
There is a clear gradation between /O and /N.
(Help text is outdated btw)Help - Command line parameters wrote:
/O If Total Commander is already running, activate it and pass the path(s) in the command line to that instance (overrides the settings in the configuration dialog to have multiple windows) /N Opens in any case a new Total Commander window (overrides the settings in the configuration dialog to allow only one copy of Total Commander at a time)
Do you know that it's really possible? You can send search results from a listbox of a separate search (Alt+Shift+F7) to any TC instance you want.Fla$her wrote: 2022-08-24, 17:41 UTC Do you understand that in the first post there is not a word about sending messages?
Confirmed. Words "configuration dialog" are still linked to "Configuration - Display" rather than to "Configuration - Operation".
And it says "allow only one copy of Total Commander" while in TC version 7.55 the meaning of the option changed allowing 1 copy per user.
In TC 7.50a with OnlyOnce=1, parameter /O does not create an extra instance when there is an elevated TC running.HISTORY.TXT wrote:31.01.10 Added: Wincmd.ini [Configuration] OnlyOnce now supports values >1 and <-1 to limit the number of copies to x (>0 means per user, <0 means per system)
31.01.10 Added: Wincmd.ini [Configuration] OnlyOnce=-1 allows one copy for TC for all users as in previous TC versions
31.01.10 Added: Wincmd.ini [Configuration] OnlyOnce=1 now allows one copy of TC per user (e.g. when started via RunAs), not one copy for all users as in older versions
Disabling the opening of the second instance, in your opinion, is a security violation? Serious?Horst.Epp wrote: 2022-08-24, 20:20 UTC This can be corrected but following the original request would still be a security violation.
Good. You can specify /S= in addition to /N. Not the point.
That prior to version 7.55 the behavior was as you and I expect. /O never forced a new instance when it wouldn't without the parameter. But the behavior changed in version 7.55 and it is unclear whether this was intentional or an unforeseen side effect.
It would be better if this was a side effect that should be fixed with the next release.white wrote: 2022-08-25, 07:55 UTCand it is unclear whether this was intentional or an unforeseen side effect.
No. The first post describes the situation when the program does this when drive connecting, and not the user himself. And it is completely unprofitable and harmful for the user to run a second instance for the reasons described earlier. Accordingly, there is an important need to save one instance. Opening a directory at any cost is not a priority over preserving instance uniqueness.ghisler(Author) wrote: 2022-08-25, 08:32 UTCBut the user does want to open these new directories! So the logical consequence is to open a new copy of TC with these paths.
But then it no longer does it's main purpose, but does the same as passing new paths with no /O parameter and should behave the same way. Otherwise it would act like the /N parameter in this situation and that's contrary to its purpose.ghisler(Author) wrote: 2022-08-25, 08:32 UTC So the logical consequence is to open a new copy of TC with these paths.
Or make it that /O doesn't force an extra instance in this situation except when the parameter /N is also used.Fla$her wrote: 2022-08-25, 08:49 UTC Therefore, please make that the second instance is strictly not opened with the /O parameter. For example, by adding the parameter: /O:N
ОК, you can add a new one. Or you can add an Onlyonce value that will not be overridden.ghisler(Author) wrote: 2022-08-25, 09:10 UTC A new parameter would be the best solution for this case. I don't want to modify the /O parameter, which just overrides OnlyOnce (as if it was set to 1).
Do you mean override factor itself? Yes/No (1/0) ?ghisler(Author) wrote: 2022-08-25, 09:10 UTCMaybe I could use /O:numeric_value so the user can directly choose the OnlyOnce override value.