Ejemplo n.º 1
0
        private static string ResolveFromShellLinkFile(string filename)
        {
            var shellLink = new ShellLink(filename);

            if (shellLink.Arguments.StartsWith(SteamAppResolver.SteamUrlPattern))
            {
                var resolver = new SteamAppResolver();
                return(resolver.ResolveExeFromSteamUrl(shellLink.Arguments));
            }

            var targetInfo = new FileInfo(shellLink.Target);

            if (targetInfo.Name.ToLower() == SteamAppResolver.SteamExeName)
            {
                if (shellLink.Arguments.Contains(SteamAppResolver.SteamArgumentPattern))
                {
                    var resolver = new SteamAppResolver();
                    return(resolver.ResolveExeFromSteamArguments(shellLink.Arguments));
                }
            }

            if (targetInfo.Extension.ToLower().Equals(".exe"))
            {
                return(targetInfo.Name);
            }
            return("");
        }
Ejemplo n.º 2
0
        private static string ResolveFromUrlFile(string filename)
        {
            var url = GetUrlFromInternetShortcut(filename);

            if (url.StartsWith(SteamAppResolver.SteamUrlPattern))
            {
                var resolver = new SteamAppResolver();
                return(resolver.ResolveExeFromSteamUrl(url));
            }
            return("");
        }