Пример #1
0
 /// <summary>
 /// Returns the path to the Registry Key associated with the given <paramref name="regKey"/> for the correct OS Bitness.
 /// </summary>
 public static string GetKeyPath(FF7RegKey regKey)
 {
     return(GetKeyPath(regKey, use32BitKey: !Environment.Is64BitOperatingSystem));
 }
Пример #2
0
        /// <summary>
        /// Returns the path to the Registry Key associated with the given <paramref name="regKey"/>.
        /// The returned path can be for 32-bit or 64-bit OS depending on <paramref name="use32BitKey"/>
        /// </summary>
        public static string GetKeyPath(FF7RegKey regKey, bool use32BitKey)
        {
            if (regKey == FF7RegKey.SteamKeyPath)
            {
                if (use32BitKey)
                {
                    return(SteamKeyPath32Bit);
                }
                else
                {
                    return(SteamKeyPath64Bit);
                }
            }

            if (regKey == FF7RegKey.RereleaseKeyPath)
            {
                if (use32BitKey)
                {
                    return(RereleaseKeyPath32Bit);
                }
                else
                {
                    return(RereleaseKeyPath64Bit);
                }
            }

            if (regKey == FF7RegKey.FF7AppKeyPath)
            {
                if (use32BitKey)
                {
                    return(FF7AppKeyPath32Bit);
                }
                else
                {
                    return(FF7AppKeyPath64Bit);
                }
            }

            if (regKey == FF7RegKey.SquareSoftKeyPath)
            {
                if (use32BitKey)
                {
                    return(SquareSoftKeyPath32Bit);
                }
                else
                {
                    return(SquareSoftKeyPath64Bit);
                }
            }

            if (regKey == FF7RegKey.VirtualStoreKeyPath)
            {
                if (use32BitKey)
                {
                    return(VirtualStoreKeyPath32Bit);
                }
                else
                {
                    return(VirtualStoreKeyPath64Bit);
                }
            }

            return("");
        }
Пример #3
0
 public static object GetValue(FF7RegKey key, string valueName, object defaultVal = null)
 {
     return(GetValue(GetKeyPath(key), valueName, defaultVal));
 }