Skip to content

Instantly share code, notes, and snippets.

@mohsin
Last active February 6, 2021 19:36
Show Gist options
  • Save mohsin/688826df7424dfaefe2f8399dffc4b86 to your computer and use it in GitHub Desktop.
Save mohsin/688826df7424dfaefe2f8399dffc4b86 to your computer and use it in GitHub Desktop.
Fixing Dota 2 desktop icon shortcut issue

I installed Dota on my new M1 chipped Mac and came across the same issue. Fortunately, I'm a developer so I figured out what's going on. Simply right-click on the shortcut and open the Contents/MacOS folder. There should be a file that you can open using a text editor.

Replace that with this:

#!/bin/zsh
/Applications/Steam.app/Contents/MacOS/steam_osx steam://run/570

Now close that. What this tells it is that open the steam app in the Applications folder and then run dota. Next, you have to add an Info.plist in the base directory i.e. the directory which contains MacOS and Resource folder. Create a file with that name or copy-paste the one from the Steam app by doing the same right-click Show Package Contents. Now you have to merely edit the values (preferably using XCode coz it's easier) otherwise, just open a text editor and edit it (hint--the key is followed by the value). So simply set the following keys:

Executable file -> run.sh

Bundle Name -> Dota 2

Icon file -> Dota.icns

If you are a developer and want a reference of the minimal required values to make this work then check out the Structure of a macOS Application Bundle on Apple's developer site.

Otherwise, just close it and you can practically run the game now.

But it's not over yet. Remember we added a Dota.icns key? So we need to get an icon for the app so it stops showing the broken icon. Just pick any from here: https://iconarchive.com/tag/dota-icns

Or make your own by searching on how you can create an icns from png file. And once you're done, rename it to Dota.icns (case-sensitive) and drop it into the Resources folder. Remember, you need to launch it once for MacOS to render the icon over it. And that's pretty much it. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment