I am creating a program, which may or may not run inside a Citrix instance. The program needs to detect this, because it needs to behave in a different way on Citrix. How can it be detected in a reliable way? So far, my best guess was to check whether the computer has a C-drive.
I assume you want to know whether your application runs in a XenApp (aka Presentation Server / Metaframe) session?
Checking for the existence of drive C: is not the right way to do it. Historically, the drives letters on Citrix terminal servers were often remapped, e.g. from C: to M:. But this is not "en vogue" any more.
Please see my earlier answer for the correct way to determine the session type.
If instead you want to determine if XenApp/Presentation Server is installed, look up the corresponding registry values as described in Citrix Knowledgebase article CTX107570.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With