Skip to content

Retry tray app initialization upon failure - #26

Merged
ehrenfeu merged 15 commits into
imcf:develfrom
rohangirishrao:tray-retry-init
Aug 19, 2026
Merged

ehrenfeu merged 15 commits into
imcf:develfrom
rohangirishrao:tray-retry-init

Conversation

@rohangirishrao

@rohangirishrao rohangirishrao commented Aug 10, 2026

Copy link
Copy Markdown

Issue #25: any failure while reading the config files or finding necessary paths would lead to the exit of the initialization of the tray app. This behaviour was noticed on production machines with the TmpTransferDir not being found on user login, and the subsequent exit of the tray app.

This PR touches only ATxTray/AutoTxTray.cs, so the deployment is limited just to AtxTray.exe.

🐛 Additions:

  • TryInitialize(): extracted from the constructor, and made into its own method. Tries to read config, deserialize and create the file system watcher. Returns true if it was successful, false otherwise.
  • InitializeWithRetries(): repeats the attempt up to MaxInitAttempts, with a pause between attempts (SecondsBetweenAttempts)
  • New flag _initialized, replacing _status. If this is false, the start up is exited gracefully.
  • d3a65c7: attempt to create the AtxTray.log file in the baseDir\var\ directory; previously this was a relative path related to the executable, but this doesn't help due to the following caveat:

Note: logs for AtxTray cannot be written by user accounts, as writing to C:\ is disabled for these. Will need a workaround here to monitor the changes, as this bug cannot be reliably reproduced - I had it happen once during testing, but this is not quite enough.

Testing

This version was build using Visual Studio, and AtxTray.exe was deployed on machines running AutoTx. A fake, broken configuration file was written with wrong paths, where the Tray app retried initialization multiple times. On a different run, the path was corrected manually during retries, after which the app was able to initialize correctly.

Comment thread ATxTray/AutoTxTray.cs
Comment thread ATxTray/AutoTxTray.cs Outdated
@ehrenfeu ehrenfeu changed the title Retry AtxTray app initialization instead of giving up on first failure (Issue #25) Retry tray app initialization upon failure Aug 18, 2026
Tray app failed to start after not finding the correct path. We retry
this process a certain number of times, giving it enough time to find
the UNC paths.
This is so that it can be called multiple times from
`InitialiazeMultipleTimes`. Main lines were taken over directly from
v3.1.0 constructor `AtxTray`.
Also add some explanatory comments.
This is a workaround for `Log.Error(string, Exception)`being obsolete.
Previously, the log file was written to baseDir\var, but is not writable
in user context.
@ehrenfeu
ehrenfeu merged commit 976da5b into imcf:devel Aug 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AtxTray app does not initialize on User login

2 participants