Register the tray's real path at startup - #815
Merged
Merged
Conversation
Startup.Add guessed %USERPROFILE%\.dotnet\tools\DiffEngineTray.exe. That is only right for a default global install: a --tool-path install, a DOTNET_CLI_HOME that moves the tools directory, or simply running a local build all registered a path with nothing at it. The tray then never started at login, while the Options checkbox - which reads the settings file, not the registry - went on saying it would. Environment.ProcessPath is where this executable actually is. The value is also quoted now, since a Run entry is a command line and an unquoted path containing a space is read as a program name followed by arguments. I also tried pointing the Options checkbox at Startup.Exists, so it reports what the registry says rather than what the settings file wants. That makes the form's rendering depend on the registry of whatever machine runs the tests, and it broke two OptionsForm snapshots here for that reason - so it is not in this commit. With the path itself correct the two agree in the ordinary case, and making a snapshot test read machine state to fix a display nit is a bad trade.
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Startup.Add guessed %USERPROFILE%.dotnet\tools\DiffEngineTray.exe. That is only
right for a default global install: a --tool-path install, a DOTNET_CLI_HOME
that moves the tools directory, or simply running a local build all registered a
path with nothing at it. The tray then never started at login, while the Options
checkbox - which reads the settings file, not the registry - went on saying it
would.
Environment.ProcessPath is where this executable actually is. The value is also
quoted now, since a Run entry is a command line and an unquoted path containing
a space is read as a program name followed by arguments.
I also tried pointing the Options checkbox at Startup.Exists, so it reports what
the registry says rather than what the settings file wants. That makes the
form's rendering depend on the registry of whatever machine runs the tests, and
it broke two OptionsForm snapshots here for that reason - so it is not in this
commit. With the path itself correct the two agree in the ordinary case, and
making a snapshot test read machine state to fix a display nit is a bad trade.