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.
            Asked
            
        
        
            Active
            
        
            Viewed 4,911 times
        
    3
            
            
        - 
                    Removed virtualenv tag, which seems to be Python-specific. – Alan Plum Jan 31 '11 at 01:37
 
2 Answers
3
            
            
        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.
        Community
        
- 1
 - 1
 
        Helge Klein
        
- 8,829
 - 8
 - 51
 - 71
 
1
            bool(os.environ.get('citrix_version'))
I think this is the best way to detect in python.
        Vamsi Nerella
        
- 770
 - 6
 - 8