= !CocosStudio: "Cocos Framework is not installed" Error = Jan 22 2016 [[Image(htdocs:images/cocos/cocos2d-x.jpg, alt="cocos2d-x", align=center)]] === The Problem === Install Cocos (without the framework) and cocos2d-x separately. Cocos2d-x works fine independently - I can create C++ (as well as Lua and !JavaScript) projects just fine and build the C++ projects in Visual Studio 2015. Cocos Studio, unfortunately doesn't recognize that cocos2d-x is installed and won't let me create C++ projects that I can export and use in my game written in C++. In Cocos Studio, I get the error: [[span(style=color: #800000, **Cocos Framework is not installed**)]] The Preference menu item in the Edit menu looks like this: [[Image(htdocs:images/cocos/cocos-framework-is-not-installed.png, alt="cocos-framework-is-not-installed", align=center)]] When I try to create a project and then add C++ as an option later, it looks like this (no engine is recognized and C++ radio option in the Project Language section is grayed out): [[Image(htdocs:images/cocos/cocos-studio-no-engine.png, alt="cocos-studio-no-engine", align=center)]] === **Easy Solution** === On Windows (7 and 10), the [http://www.cocos2d-x.org/filedown/CocosForWinWithFramework-v2.3.3.exe Cocos for Win with framework 2.3.3 installation] works right out of the box. So, if you want to get on with your gamedev life, just install that version and you'll be golden. === **TL;DR Version** === **Note:** I had troubles with earlier Cocos Studio versions (2.3.2.3, both with and without the framwork included) and jumped through a bunch of hoops with the non-framework installation package in order to try and get things working. Also, I realized that it's better to use the non-framework installation package and install multiple framework versions separately, in order to be able to use them (side-by-side, if needed) with Cocos Studio. So, I'm documenting (a) what needs to be done to getting things working and (b) how I figured out what needed to be done. === How to get Cocos Studio to Recognize cocos2d-x === 1. Download and install [http://www.cocos2d-x.org/filedown/CocosForWin-v2.3.3.exe Cocos for Windows V2.3.3] (the one without framework) to `C:\Cocos` 1. Download and unzip [http://www.cocos2d-x.org/filedown/cocos2d-x-3.9.zip cocos2d-x-3.9.zip] to `C:\Cocos\frameworks\cocos2d-x-3.9` 1. Download [htdocs:docs/cocos/cocos-framework.reg_.txt this .REG file], change the name from `cocos-framework.reg_.txt` to `cocos-framework.reg` and run it. Alternately, you can manually create the following registry entries on Windows (64 bit): 1. `HKLM\Software\Wow6432Node\CocosFramework\InstallDir` as a REG_SZ and set it to `C:\Cocos` 1. `HKLM\Software\Wow6432Node\CocosFramework\3.9\EngineVersion` as a REG_SZ and set it to `cocos2d-x-3.9` 1. `HKLM\Software\Wow6432Node\CocosFramework\3.9\Path` as a REG_SZ and set it to `C:\Cocos\frameworks\cocos2d-x-3.9` 1. Create a file named `version` with the contents `cocos2d-x-3.9` in `C:\Cocos\frameworks\cocos2d-x-3.9` 1. If you also want to do Android development, then Android SDK, Android NDK, Ant and JDK paths should be set in the Platform section of the !Edit/Preferences menu item, else skip this step. === The Ugly === Note that none of this is documented anywhere on the cocos2d-x site or its forums. So, I'm posting this here and will include this information and a link to this post in my answer to [http://discuss.cocos2d-x.org/t/cocos-studio-cocos-framework-is-not-installed/26339 my own question] in the cocos2d-x forum. === How I Figured it out === I used 2 computers to sort this out. I removed all previous Cocos package installations completely from both - this includes both the Cocos Studio and the cocos2d-x framework. On my first computer (Windows 7), I installed Cocos Studio without the framework and extracted the framework to the appropriate sub-directory. Cocos Studio did not recognize that the framework was installed. I tried various suggestions that were provided in answers to identical questions in the forums. These included: 1. editing the `C:\Cocos\Cocos\CocosStudio2\Frameworks\FrameworkVersionList.xml` to ensure that the framework version I was using was listed there. It was already there. Note that this file doesn't even exist in the installation package that works out of the box. Total red herring. 1. editing the `C:\Cocos\frameworks\cocos2d-x-3.9\tools\console\bin\cocos2d.ini` file to correctly point to the cocos2d-x installation and the templates folders. They weren't, but fixing them made no difference. 1. removing some and then all cocos environment variables. This made no difference. 1. adding a `version` file with `cocos2d-x-3.9` in the `C:\Cocos\frameworks\cocos2d-x-3.9` directory. This is a necessary step, but it didn't work by itself. I then installed the [http://www.cocos2d-x.org/filedown/CocosForWinWithFramework-v2.3.3.exe Cocos for Windows with framework v2.3.3] on my second computer (Windows 10). Then I proceeded to compare the directory layout and files and their differences. Other than the `version` file, I didn't find anything significant. I figured as a last, desperate (since Cocos Studio is cross platform) step, I'd do a registry search on the (second) computer, the one that had package installed of Cocos Studio with the framework included. That yielded the three registry entries that were not present on the first computer. I added those entries to the first computer and Cocos Studio recognized that the cocos2d-x framework was installed. Last set of steps was to revert each of the changes I'd made one by one to determine which ones were actually needed and which ones were not. It turned out that the only change from the forum answers that was actually needed in addition to the registry change was the creation of the version file (#4 in the "How to get Cocos Studio to Recognize cocos2d-x" section above). Hope this helps anyone else looking to figure this out.