Changeset 174

Show
Ignore:
Timestamp:
04/08/08 22:54:17 (9 months ago)
Author:
yidabu
Message:

added windowsMediaPlayerPath

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/sys/win32/SpecPath.d

    r161 r174  
    189189 
    190190    +/ 
    191     char[] iePath() 
    192     { 
    193         char[] result; 
     191    char[] InternetExplorerPath() 
     192    { 
     193        char[] result = r"C:\Program Files\Internet Explorer\IEXPLORE.EXE"; 
     194        if(FilePath(result).exists) return result; 
     195         
     196        result = r"D:\Program Files\Internet Explorer\IEXPLORE.EXE"; 
     197        if(FilePath(result).exists) return result; 
     198 
    194199        scope httpkey = RegistryKey.classesRoot.openSubKey(r"HTTP\shell\open\command"); 
    195200        if(httpkey !is null) 
     
    198203        } 
    199204         
     205        // too tedious 20080409 yidabu 
     206        /* 
    200207        if(!result) 
    201208        { 
     
    216223            }     
    217224        }         
    218          
     225        */ 
    219226        if( result && result[0] == '\"' ) 
    220227        { 
     
    223230            result = result[0..i]; 
    224231        } 
    225         result = ( result.length && FilePath(result).exists ) ? result : null; 
    226          
    227         return result; 
     232         
     233        return (result.length && FilePath(result).exists) ? result : null; 
    228234    } 
    229235    //iePath 
    230236     
     237    /** 
     238         
     239     
     240    */ 
     241    char[] windowsMediaPlayerPath() 
     242    { 
     243        char[] result;         
     244        result = r"C:\Program Files\Windows Media Player\wmplayer.exe"; 
     245        if( FilePath(result).exists ) return result; 
     246             
     247        result = r"D:\Program Files\Windows Media Player\wmplayer.exe"; 
     248        if( FilePath(result).exists ) return result; 
     249             
     250        auto key = dwin.sys.win32.Registry.RegistryKey.localMachine.openSubKey(r"SOFTWARE\Microsoft\MediaPlayer\"); 
     251        if(key !is null) 
     252            if( auto dir = key.getValue!(char[])("Installation Directory") ) 
     253                return dir ~ r"\wmplayer.exe"; 
     254             
     255        return null; 
     256    }     
    231257     
    232258    char[] shellPath(char[] name)