Exemplo n.º 1
0
        /// <summary>
        /// Resets the shortcut's properties to the SteamShortcutManager default settings.
        /// </summary>
        /// <returns>True if successful; otherwise, false.</returns>
        public bool ResetProxyShortcut()
        {
            if (AppId == 0)
            {
                return(false);
            }

            Logger.Info($"Resetting shortcut properties [{AppId}].");
            ClientShortcuts.SetShortcutAppName(AppId, DefaultShortcut.NAME);
            ClientShortcuts.SetShortcutExe(AppId, DefaultShortcut.EXE);
            ClientShortcuts.SetShortcutStartDir(AppId, DefaultShortcut.START_DIR);
            ClientShortcuts.ClearShortcutUserTags(AppId);
            ClientShortcuts.AddShortcutUserTag(AppId, DefaultShortcut.TAG);
            ClientShortcuts.SetShortcutHidden(AppId, true);
            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a hidden Steam shortcut with the name '<see cref="DefaultShortcut.NAME"/>' and an exe path of '<see cref="DefaultShortcut.EXE"/>'.
        /// </summary>
        /// <returns>The AppID of the newly created shortcut.</returns>
        private static UInt32 CreateDefaultShortcut()
        {
            UInt32 appId = ClientShortcuts.AddShortcut(DefaultShortcut.NAME, DefaultShortcut.EXE, "", "", "");

            if (appId == 0)
            {
                const string errorMsg = "An unexpected problem occurred while trying to create a default SteamLauncher shortcut.";
                Logger.Error(errorMsg);
                throw new InvalidOperationException(errorMsg);
            }

            ClientShortcuts.AddShortcutUserTag(appId, DefaultShortcut.TAG);
            ClientShortcuts.SetShortcutHidden(appId, true);
            ClientShortcuts.SetAllowOverlay(appId, true);
            ClientShortcuts.SetAllowDesktopConfig(appId, true);

            return(appId);
        }