Ouroboros Presents! Compiling and Building the Civ5 DLL on Windows 10.

OuroborosOrder

Warlord
Joined
Apr 3, 2016
Messages
124
Location
Alabama
Ouroboros Presents!
Compiling and Building the Civ5 DLL on Windows 10.

Important Note!
This article only applies to users of Windows 10. The OS this was tested on is Windows 10 Pro, although should work on any Windows 10 platform. This may also apply to Windows 8.1 although that is unverified as of yet. See the attached DOC file for a formatted Word document copy with hyperlinks to all downloads and resources included.

After much deliberation, and testing, I have finally found the solution to the problem at hand. I have developed a method witch which you can compile and build the Civ5 DLL on Windows OS greater than 7 without significant issues.

Read on if you are interested. Note! This tutorial, or an equivalent, is required to be completed to follow my C++ tutorial series. You must have successfully compiled and built an un-modified copy of the Civ5 DLL, before moving on to my tutorial series on Learning the C++ Programming Language, and the follow up tutorials that ensue!

There is NO required knowledge of C++ for this tutorial, only text and file manipulation! Everything is explained in the following sections of this tutorial in great detail. So, if you have not done this sort of changes to the Windows OS before, do not worry because I will guide you through everything you need to do.

However, you need to thoroughly read and comprehend all of the points in the Requirements section of this tutorial before you do anything else, and make sure you qualify for this method!
 

Attachments

  • Ouroboros Presents! Compiling and Building the Civ5 DLL on Windows 10.doc
    101.5 KB · Views: 223
Requirements
Important Note!
If you are comfortable with and are willing to do all of the following, then you may proceed with the understanding that you must follow the Methodology section exactly as written and in order. If you do not know how to do any of the following do not worry, as I will describe everything in great detail for you and offer trouble shooting when I have time.

Important Note!
If you have followed all instructions listed in Methodology to the best of your ability, and have completed the Step 1: Precautionary Measures of the Methodology section, then I will also offer help with troubleshooting to the best of my ability and availability if something goes wrong during this method.

Important Note!
Read the requirements below VERY CAREFULLY and make sure you meet all of them.


Requirement 1: You must be comfortable with the following:

>> Installation and Uninstallation of Windows software packages.

>> Editing the Windows OS system registry.

>> Using a Non-Microsoft endorsed methodology.

Please be aware: That the other methodology, installing visual studio 2008 and 2010, mentioned in this article is also Non-Microsoft endorsed, especially on Windows 10. So if you attempt that instead, you need to be comfortable with what it entails.

Requirement 2: You must have the following Microsoft essentials:
You must have a genuine and verified copy and product key of Windows 10 OS. This means you did one of the following: you upgraded from 7 or 8, bought a copy of Windows 10, or bought a computer with a preinstalled copy (OEM copy). If you do not have Windows 10, but are interested in upgrading to it, you can do so for free through Microsoft until July 29, 2016. See here for details.

This offer is unprecedented and may not be extended. I highly recommend you consider this as buying a new copy of Windows can be expensive. Also, mainstream support for Windows 7 and Windows 8 has ended, they now only receive security updates and hotfixes.

The only current non-server versions of Windows OS that are in mainstream support phase are: Windows 8.1, and Windows 10. Using a version of Windows OS for development purposes, that is not in main stream support phase, is not recommended by Microsoft. This is especially true if you want to develop any kind of current software or games.

You must have a Microsoft Account so that you can sign into Windows 10 and Visual Studio. You should have one of these anyways if you are a Windows user or use other Microsoft products. Microsoft Accounts are what all End-User consumers of Windows are going to be using eventually, it is the way Microsoft is setting up their future products to work as intended with full features.

If you do not have a Microsoft Account to sign in to Windows and Microsoft applications, many features will be disabled. This does not allow for collaboration between many types of Windows 10 applications, which is a not a good state to be in for a programmer/developer. If you do not have a Microsoft Account, see here to make one for free.

Requirement 3: Prerequisite Resources
You must have a legitimate copy of Civilization 5, and all of its Expansions to mod the Civ5 DLL.

You must have a stable internet connection on which to download and install Microsoft system packages and applications. This is to prevent data corruption through interruption of downloads or through persistent packet loss. I recommend having at least a 30mb/s network speed (which is what I have). For instance, this roughly equates to you getting about 3.6 Megabytes per second download on steam installations. If you would like to measure you network speed, see this free Windows 10 app from Microsoft Research division.

You must have either, an unused DVD and a DVD Read/Write optical drive, or an empty (or one you can empty) USB drive that is at least 4 Gigabytes in size. This is for making a Windows 10 OS installation media (which is free). We will be doing this in Step 1: Precautionary Measures, of Methodology.

You also must have an external backup location available where you can store backups of your important files. Some options for this are:


>> An external hard drive. Most 1 TB externals are relatively inexpensive now and I highly recommend investing in one if you want to develop software.

>> A Google Account with the free Google Drive 15 Gigabytes of storage

>> A Microsoft Account with the free OneDrive 5 (possibly up to 15) Gigabytes of storage

>> A Dropbox Account with the free 2 Gigabytes of storage

>> A similar equivalent external backup location.

Lastly for this requirement, you must have approximately 15 GB of unused hard drive space to finish downloading and installing everything needed to develop and mod Civ5 and other games/software.

Requirement 4: Knowledge and Capability
You do not need any advanced knowledge of Windows OS. I will explain in great detail the required steps to follow this Method. This Method has been double verified, once on a heavily used Windows 10 installation, and once on a fresh Windows 10 installation.

You will need to be able to read, comprehend, and execute exactly detailed instructions under the Methodology section of this tutorial. In order to do this, you will also need to know the basics of Windows 10 OS. This includes but is not limited to:

>> Knowing how to extract files from a zipped folder.

>> Knowing how to use file explorer to open the required folder directories.

>> Knowing how to use the Windows 10 search bar, also known as the Cortana search bar, for files and applications on your system.

>> Knowing how to monitor and follow an installation of an application.

Also, you will need to be able and willing to write down or record any errors that may occur during any installations or other steps of the Method for trouble shooting purposes, if you want my help in troubleshooting problems.

Lastly for this requirement, you will need one of the following:

>> Paper on which to write down instructions from this tutorial.

>> A printer in order to print a physical copy of the instructions from this tutorial.

>> A mobile device, tablet, or secondary computer which you can view the instructions from this tutorial on.

Requirement 5: You must own the computer system
You must own the computer system and associated Windows 10 OS copy that you will be working on! If you are a child under the age of 18 using a parent’s or school’s computer do not follow this Method, in fact please stop reading immediately and go do your homework (sorry kids).

If you are using a borrowed computer, school computer, work computer, or for whatever reason you are not actually the owner of the computer… also stop reading immediately and be ashamed that you would even consider doing something like this to whoever actually owns the computer.

Requirement 6: By following this tutorial, you agree to the following
That you understand inherent risks to your Operating System, Files, Applications, or Hardware (not sure why this would occur but hey it’s a disclaimer!), however unlikely they may be. While following this or the other Method for compiling the DLL mentioned in this tutorial on a Windows OS version later than Windows 7 there is inherent risk.

You also must understand that Microsoft did not build inherent support for Windows OS later than Windows 7 to run old versions of Visual Studio, old versions of Windows SDKs, old versions of .NET Framework, or compile with old versions of Visual Studio toolsets.

Let me be clear: If you are running a Windows OS version later than Windows 7 and attempt this method or any other method for Compiling and Building the DLL, you acknowledge that there is some risk involved. You also understand that this is because you are doing something your Windows OS version does not support and was not intended to do!

Lastly, you must agree that you should not hold me personally responsibility for any problems, issues, errors, corruptions, or other unforeseeable maladies that may occur in terms of your computer system, OS, software, or hardware. Because, I have made abundantly clear that there are potential risks involved. You should be aware that there are really risks involved with ANY modding of Civ5 or ANY other type of game which your Computer or OS is too new for or was not built to inherently support.

If you still want to hold me responsible for such things that’s fine I suppose, but I will not feel bad about or take responsibility for anything bad that may happen to you or your computer. Nor will I help you try to fix your issues, if you come aggressively blaming me for your own misfortune.


IF YOU DO NOT MEET ALL OF THESE REQUIREMENTS, AND STILL ATTEMPT THIS METHOD, YOU DO SO AT YOUR OWN RISK!
 
Results
Important Note!
This section describes the benefits and results I have received from following the described method in this tutorial.

Point 1: I now have a fully featured version of Visual Studio Community, for which to modify the DLL. There are other methods of obtaining this (which I had been previously using), but for reasons discussed in the Reasoning section, I very much prefer this method for developing DLL mods on Windows 10 OS.

Point 2: I have achieved this method through ONLY the use of publicly listed official download sources from Microsoft websites. This means there are no 3rd party downloads of Microsoft applications, software, or system packages.

These can pose a serious risk to the user, because they are unverified sources which can be hijacked by nefarious software or other entities. There is also the possibility that such 3rd party downloads could contain corrupted files, in which case you are installing an unverified corrupted version of a Microsoft package, which should be self-explanatory.

Point 3: This also means there are no downloads from go.microsoft.com links or downloads.microsoft.com links required. These are used for internally and externally shortening links to Microsoft products by Microsoft employees. This means Microsoft employees link product pages directly to end-users for a specific purpose, or to each other internally as references, or to quickly update Microsoft MSDN articles. These links available for the Visual Studio Express 2008 and 2010 are ONLY temporarily available and are hidden from the general public because they have been removed entirely from all Microsoft websites. Microsoft only supports deprecated software such as very old versions of Visual Studio Express for a few years, after which they typically stop offering access to them.

This is in direct contrast to the long term support and availability Microsoft offers for packages that are required by numerous other applications to run properly. This includes for example Windows SDKs, .NET Framework packages, and Visual C++ Redistributables. It does not include old versions of Visual Studio as these are meant primarily as software development environments NOT as primary software dependencies.

To summarize unofficial links to unsupported or deprecated Microsoft products should not be used if at all possible because

1. They will not be available indefinitely. There for using them in unnecessary instances creates a dependency that will eventually be removed entirely. This is not acceptable for software development or any type of programming really.

2. They pose risk to the user if they click the wrong link which is disguised as a go.microsoft.com or a download.microsoft.com link. If you Google information about this, you will find many occurrences of people who have had their browsers and OS hijacked by viruses and malware from disguised links.

3. These links are hidden for a reason and are not meant to be used by the general public, especially those that are links to deprecated and unsupported products. The likelihood that a Microsoft employee will direct you to one of these hidden download links for deprecated software is small.

This method makes available the ability to modify older games with Modding support on Windows 10 OS, without many of the problems you may encounter.

There is no longer a need for me to have either/both of Visual Studio 2008 and 2010 Express installed as is done in the other method for compiling the DLL. See applicable concerns about and issues that may be encountered by installing these old versions of Visual Studio on Windows 10, in the Reasoning section.
 
Reasoning
There are potential issues that you may encounter in using the other method for compiling and building the Civ5 DLL on Windows 10 OS.

1. There is the potential inability to effectively compile and build some other types of C++ projects without significant workarounds (already experienced this one on another application I am creating). Specifically, it may interfere with the development of Windows UWP and/or MFC applications.

2. Another issue that may occur is incorrect system registry values or corrupted system files. This is even more likely if you have installed these types of applications or packages in the incorrect order, or have overwritten existed installations by mistake or simply because you did not know what you were doing. If this is the case it could prevent other applications from running correctly, or running at all on newer versions of Windows OS.

3. There is the potential risk that you may have to reinstall various pieces of software, or games because visual studio 2008 and 2010 come with older versions of .NET Framework (3.5 and 4 respectively) and Windows 10 has a built in version of .NET Framework that is newer (.NET Framework 4.6).

4. Windows 10 will also actively block older versions of .NET Framework installations, which may and probably does extend to Visual Studio copies of these packages. This means their installations are invalid, error inducing, or incomplete.

These SDK versions of .NET Framework can and MUST be installed to develop for visual studio v90 platform applications as they are bundled together. However, if they are not installed in a managed and specific way, it can cause serious errors with your file systems, system crashes (Blue Screens), or Installation crashes.

5. Versions of Windows OS newer than Windows 7 were not MEANT to have some of these older versions of generic .NET packages installed on them and are not supported officially. While Windows 10 does include versions of .NET 1, 2, and 3.5 for legacy applications, they are updated versions of these frameworks specific to each OS version.

On Windows 7 you could install or uninstall .NET frameworks (though it was not recommended to do so) as you pleased. On Windows 10, this has changed drastically because versions of .NET 4 that run on Windows 7 are deprecated by the versions of .NET 4 and newer that are built into Windows 10.

In fact, the first time I installed the Visual Studio 2008 Express on Windows 10, this installation failed and I had to uninstall it and quite a few other things before attempting another re-installation which thankfully worked at the time.

Others are not so lucky; this poor guy took 6 months to figure out how to install older versions of Visual Studio on Windows 8.1, still with issues and the need for several workarounds. Or even on Windows 7 Ultimate; this guy's particular setup did not like installation of Visual Studio 2008 either. There are numerous examples of installations being blocked or failing on Windows 10, 8.1, and some on Windows 7 (Ultimate it looks like) and causing major issues for their users, on the internet.
There are other potential issues with installing Visual Studio 2008 and 2010 Express versions on Windows OS versions newer than Windows 7. But, for the sake of brevity, I will not list them here.
 
Methodology
Important Note! The following section describes the method I am currently using with great success to mod the Civ5 DLL. If you are running Windows 10, this does apply. Windows 8.1 is a grey area I am not sure about. Windows 7 already has a reliable, yet unofficial method for compiling the Civ5 DLL.

Please know, that there are many tutorials already on CivFanatics on how to do this, all of which were written by very competent programmers, modders, and superusers like myself that definitely know what they are doing in this area. See this thread in particular, which is linked as a requirement for Whoward69’s reputable DLL tutorial series. If you are interested in this other method or if you are running Windows 7 look at this other method first.

You can also do a simple Google search on this topic with CivFanatics as the search site. Type in something like “Compiling the Civ5 DLL site:http://forums.civfanatics.com” in the Google search engine.

The following are the steps for implementing my methodology.

Step 1: Precautionary Measures​

Do basic routine maintenance on your System, Hardware, and OS. Make sure you have all of your drivers installed at the latest release. Perform Windows Updates and make sure you have all the latest Windows packages for your copy of Windows. Disk Defragmentation and Disk Cleanup Utility are recommended, and really should be done on a regular basis anyways.

I also recommend you also install Notepad++ a free alternative text editor to Notepad. It is what I use for editing basic types of files outside of development environments. It comes with syntax highlighting for a large range of programming (Like C++) and markup languages (like XML). It also supports formatting of text that Notepad does not, as well as a variety of other features. I also use it in this tutorial so if you see me mention Notepad++ and you have chosen not to install it, then you will have to do edits in Notepad or a text editor of your choice.

Next, download the Windows 10 Media Creation Tool and run it. Choose the option to create a USB flash drive installer OR if you are using the DVD mentioned earlier, create the system ISO disk image option and then burn it to disk. Make sure you have a physical copy of your Windows 10 (or upgraded Windows 7 or 8.1 Key if you upgraded to Windows 10) available and written down, in case you need to reinstall or repair Windows.

If you have to, for whatever reason, do a System Repair Installation or a complete System Re-Installation, then you can use this media and product tool by booting into it when they bios load screen flashes. You would hit the bios boot menu key… for me it’s F12, and then select your connected USB or DVD media to perform a repair or installation.

Learn more about how to do this correctly, by selecting the “Using the media creation tool” and then “Perform a clean installation using a USB or DVD” option listed on the Windows 10 Media Creation Tool link mentioned before.

You may want to make a system restore point and a system repair disc as well (if you have the available resources to do so). This is recommended as you can use the system repair disc to troubleshoot and restore your computer to a previous state at the boot menu (by selecting the disk), without having to do a complete system Re-Installation. This is only viable in some instances, and so I am not requiring it to continue. The above link has more details on this, but it is not difficult.

Lastly, in the event you do have to perform any type of system recovery measure, you need to backup all of your important data such as any kind of pictures, documents, games, or even mod assets like 3d models you’ve made that you may want to keep.

To do this you need to have a viable external location. This is the requirement that mentioned having an external hard drive or cloud storage account to back up your important files to.

After you have taken the proper precautionary measures you may proceed to Step 2.
 
Step 2: Essential Microsoft Downloads
Important Note!
I highly recommend making individual folders for each of the following files, applications, or sets of redistributables as they are all named very similar things and MUST be installed in the correct order later. You could also rename the files themselves instead. In any case, DO NOT give out any copies of Microsoft redistributable packages or SDKs as it is illegal to do so without prior authorization to do so from Microsoft.

Download all of the following Microsoft products at the following official Microsoft Links, spoiler tags below the downloads describe what they are:

Microsoft Windows SDK for Windows 7 and .Net 3.5 Framework SP1 (ISO)
Spoiler :

This is a disk image for and offline installer of the Windows 7.0 SDK.
You will be prompted to choose from the following after clicking download:

GRMSDK_EN_DVD.iso
This is for (x86) also known as 32-bit CPU/OS architecture.
GRMSDKIAI_EN_DVD.iso
Ignore this option as you should not be running a computer with Itanium architecture and trying to mod or develop software.
GRMSDKX_EN_DVD.iso
This is for (x64) also known as 64-bit CPU/OS architecture

You can find what your computer’s architecture is by typing “System Information” in the Windows 10 search and clicking the related app. It is the feature listing next to “System Type” and it should be either x86 or x64


Microsoft Windows SDK for Windows 7 and .Net 4 Framework (ISO)
Spoiler :
This is a disk image for and offline installer of the Windows 7.1 SDK.
You will be prompted to choose from the following after clicking download:
GRMSDK_EN_DVD.iso
This is for (x86) also known as 32-bit CPU/OS architecture.
GRMSDKIAI_EN_DVD.iso
Ignore this option as you should not be running a computer with Itanium architecture and trying to mod or develop software.
GRMSDKX_EN_DVD.iso
This is for (x64) also known as 64-bit CPU/OS architecture
You can find what your computer’s architecture is by typing “System Information” in the Windows 10 search and clicking the related app. It is the feature listing next to “System Type” and it should be either x86 or x64


Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1
Spoiler :
This is a patch for the Windows 7.1 SDK which restores some essential compilers.


Microsoft Visual Studio 2012 Express
Spoiler :
Essential for having the entire Visual Studio toolset.
This is still readily available from Microsoft and is compatible with newer versions of Windows.

Microsoft Windows Software Development Kit - Windows 8.100.26936.0
Spoiler :
This is Windows 8.1 SDK


Microsoft Windows Software Development Kit - Windows 10.0.10586.212
Spoiler :
This is Windows 10 SDK


Microsoft Visual Studio 2015 Community with Update 2

Spoiler :
The development environment we will compile/build with.


Microsoft Visual C++ 2005 Redistributable (x86)

Spoiler :
Need this for x86 AND x64 architecture


Microsoft Visual C++ 2005 Redistributable (x64)
Spoiler :
Need this for x64 but NOT x86 architecture


Microsoft Visual C++ 2008 Redistributable (x86)
Spoiler :
Need this for x86 AND x64 architecture


Microsoft Visual C++ 2008 Redistributable (x64)
Spoiler :
Need this for x64 but NOT x86 architecture


Microsoft Visual C++ 2010 Redistributable (x86)
Spoiler :
Need this for x86 AND x64 architecture


Microsoft Visual C++ 2010 Redistributable (x64)
Spoiler :
Need this for x64 but NOT x86 architecture


Microsoft Visual C++ 2010 Shell (Isolated) Redistributable Package

Spoiler :
Need this for x86 AND x64 architecture


Please comment and let me know if any of the links are incorrect, broken, or you have trouble downloading them for whatever reason!

When you have all these downloaded, you can proceed to Step 3.
 
Step 3: Uninstallations
Important Note!
Before you begin Step 3 onward please have at least 2 hours to complete all of the following in order without lengthy interruptions. Stopping this process in the middle could potentially leave security holes or cause issues with further attempts to install. Getting your System back into normal working order is something that needs to be done in one sitting I’m afraid. This process may take less time depending on your computer hardware.

Hit “Windows Key + I” and then select “System” and then select “Apps & Features”. Search for all of the following listed Apps that are installed on your system in the “Type an App name…” box. Then to uninstall them, Left Click the App in question and select Uninstall and then approve any Windows permission verification that occurs.

I have attempted to put all of, as accurately as possible, the application names that were listed in my Apps & Features window that I uninstalled when I performed this step.

If you don’t see it in the list by copy pasting these names do a generic search to make sure it is not installed before skipping it. For example, search “Visual Studio” to bring up any versions of Visual Studio you may have installed.

Some or many of these may not be installed depending on your currently OS state. If they are not listed in the Apps & Features when you do the search and you have double checked, skip that step – you can’t uninstall what you don’t have.

Lastly, uninstall any and all of the following applications in the Apps & Features panel in the order they are listed.

Uninstall all of the following versions of Visual Studio (if they are installed):
>> Visual Studio 2015 Community with Update 2

>> Visual Studio 2015 Community * Any other version

>> Visual Studio 2013 *Any Version

>> Visual Studio 2012 *Any Version

>> Visual Studio 2010 *Any Version

>> Visual Studio 2008 *Any Version

Uninstall all of the following Microsoft Windows SDKs (if they are installed):
>> Microsoft Windows SDK for Windows 7 (7.0)

>> Microsoft Windows SDK for Windows 7 (7.1)

>> Microsoft Windows Software Development Kit - Windows 8.100.26936.0

>> Microsoft Windows Software Development Kit - Windows 10.0.10586.212

>> Microsoft Windows Software Development Kit - Windows 10.0.26624

Uninstall all of the following Microsoft .Net Framework Packages (if they are installed):
>> Microsoft .Net Framework 4 Targeting Pack
>> Microsoft .Net Framework 4 Multi-Targeting Pack

>> Microsoft .Net Framework 4 Targeting Pack(ENU)

>> Microsoft .Net Framework 4.5.1 Targeting Pack

>> Microsoft .Net Framework 4.5.1 Multi-Targeting Pack

>> Microsoft .Net Framework 4.5.1 Targeting Pack (ENU)

>> Microsoft .Net Framework 4.5.2 Targeting Pack

>> Microsoft .Net Framework 4.5.2 Multi-Targeting Pack

>> Microsoft .Net Framework 4.5.2 Targeting Pack (ENU)

>> Microsoft .Net Framework 4.6 Targeting Pack

>> Microsoft .Net Framework 4.6 Multi-Targeting Pack

>> Microsoft .Net Framework 4.6 Targeting Pack (ENU)

>> Microsoft .Net Framework 4.6.1 Targeting Pack

>> Microsoft .Net Framework 4.6.1 Multi-Targeting Pack

>> Microsoft .Net Framework 4.6.1 Targeting Pack (ENU)

Uninstall all of the following Microsoft SDK or Visual Studio peripheral components (if they are installed):
>> Application Verifier

>> Application Insight Tools Visual Studio 2015

>> Windows SDK AddOn

>> Debugging Tools for Windows (x86)

>> Debugging Tools for Windows (x64)

>> Windows Performance Toolkit

>> Microsoft Help Viewer 1.0

>> Microsoft Help Viewer 2.2

>> Entity Framework 6.1.3 Tools for Visual Studio 2015 Update 1

Uninstall all of the following Microsoft Visual C++ Redistributables (if they are installed):
>> Microsoft Visual C++ 2005 x86 Redistributable

>> Microsoft Visual C++ 2005 x64 Redistributable

>> Microsoft Visual C++ 2008 x86 Redistributable

>> Microsoft Visual C++ 2008 x64 Redistributable

>> Microsoft Visual C++ 2010 x86 Redistributable

>> Microsoft Visual C++ 2010 x64 Redistributable

>> Microsoft Visual C++ 2012 x86 Redistributable

>> Microsoft Visual C++ 2012 x64 Redistributable

>> Microsoft Visual C++ 2013 x86 Redistributable

>> Microsoft Visual C++ 2013 x64 Redistributable

>> Microsoft Visual C++ 2015 x86 Redistributable

>> Microsoft Visual C++ 2015 x64 Redistributable

>> Microsoft Visual C++ 2010 Shell (Isolated) Redistributable

Uninstall all of the following toolsets (if they are installed):
>> Microsoft Visual C++ Compilers 2010 Standard - enu - x86

>> Microsoft Visual C++ Compilers 2010 Standard - enu - x64

>> Microsoft Build Tools 2013

>> Microsoft Build Tools 2015

Now Restart Your Computer and move on to Step 4!
 
Step 4: Install Microsoft Windows 7.0 SDK with .Net 3.5 Framework
Important Note!
Before you do this or any of the other installations required: It is a very good idea to disable your antivirus if you have one enabled. Antivirus software is notorious for blocking or interfering with the download, installation, or online installation of many things. Don’t forget to Re-enable it after you are finished!

Open File Explorer, and navigate to your Windows SDK 7.0 GRMDSK ISO that you downloaded for your architecture. Mount the GRMDSK ISO. Double click “setup.exe” inside the main ISO directory to begin the installation. During the installation you will be asked what SDK features you want to install.

Check everything except the following:
>> Application Verifier

>>Debugging Tools for Windows

>> Redistributable Components

After this installation is completed, Right Click the GMDSK ISO in the File Explorer navigation panel and select Eject to un-mount the image and proceed to Step 4.
 
Step 5: Special Preparations for installing
Microsoft Windows 7.1 SDK with .Net 4 Framework

Windows 10 does not play nicely with the Windows 7.1 SDK, because of the .NET 4 Framework included with it. However, we NEED this SDK to install via the normal installer inside the ISO main directory, otherwise it will NOT install correctly and completely.

As mentioned earlier, Windows 10 has a newer built in version of .NET (4.6) and does not like anyone trying to put old .NET packages on it. In order to install this on Windows 10 from the primary installer, we have to first trick the OS into thinking we do not have .NET 4.6 installed currently.

Previously in my original iteration of the C++ tutorial series I am writing, I advocated installing the Windows 7.1 SDK from the installer inside the Setup directory… however this will not work as expected on Windows 10. If you were following my original tutorial and did install this in the previously mentioned fashion, do make sure that the Windows 7.1 SDK is completely uninstalled from Apps & Features panel first.

To work around Windows 10’s stubbornness follow these instructions in the exact order they are written:

Instruction 1: Type “cmd” in the Windows 10 search bar and Right Click the Command Prompt application to bring down the context menu. Select “Run as Administrator” to open an elevated command prompt interface. From here we will only do one thing, and that is to enable the Windows Elevated Administrator Account. The PASSWORD reference in the command below is whatever password you want to give the account. I highly recommend you give this a password and that you write it down somewhere you will not lose it.

Do not use the Elevated Administrator Account as a general use account. In fact we will disable it after we are done with our work around, because it can pose a security threat to leave permanently enabled.

Enter the following command in the prompt to turn on the Elevated Administrator Account:

net user administrator PASSWORD /active:yes

Then Type “exit” in the command prompt and hit enter to close it. Log out of your own user account completely and select the newly available account marked mysteriously as just “Administrator” (rather innocent eh?)

Instruction 2: After the account finishes “setting up everything for you” (how comical in this respect), press the key combination “Windows Key + R” to open the Run command dialogue. In the Run dialogue type “regedit” and hit enter.

Welcome friends to the wonderful world of Registry editing! I’m being facetious of course, editing the Windows OS registry is considered as the Nuclear Option by sane people. You might be wondering what this magical place you have stumbled upon is… No it’s not Narnia folks, it’s a Windows OS system built in database that holds all of the important values for system files, applications, and pretty much anything that is important on your computer. Why then would we want to edit the registry if it’s so important?

I do not normally advocate editing the registry if you can help it. This tends to lead to bad things if you don’t know what you looking for, or doing in there. That said, we will only be modifying 4 values in the vast expanse of the registry to get what we need accomplished.

Because it is a limited one time use of Regedit, and because I have already thoroughly investigated what these values are used for, and we know roughly what to expect from editing them – it is not something I am going to oppose in this specific instance. And do not worry, we will set these values back to their original states after we are finished with our workaround.

Do not get me wrong, there are other very good circumstances where limited use of Regedit, such as getting rid of stubborn deleted application file references causing issues on your PC, may be warranted. But, we will not be covering that here.

Btw, these folder looking things you see are not actual directories on your system, they are called Keys and they are labels for sets of specific values for many different types of important things on your OS.

Instruction 3: Now, open the nested keys in the following order:
HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> NET Framework Setup -> NDP -> v4 (NOT the “v4.0” key “v4” they are different)

Instruction 4: Next select the Client Sub-Key. No need to open it just select, although it will not hurt you if you do. On the right panel of the Regedit window there should be a bunch of specific labeled entries with corresponding values in the Datacolumn. If you have done any XML modding for Civ5 this is a similar principle to modifying database entries… only this is far more important so be careful what you change!

Instruction 5:
Locate the value for the InstallPath entry and Right Click it. Then select the Modify... option from the dropdown context menu. In the dialogue that appears, copy the number sequence after the "v" in the last part of the value. Don't include the "v" when you copy this value! At the time of writing this tutorial, the value copied should be 4.0.30319.

Instruction 6:
Hit close and minimize Regedit. Right Click in the desktop, and create a new text document Name it something identifiable like "temp registry values". Open the text document and then type, "new value: " and then paste the value you copied next to it. This is so you don’t get the two values mixed up later. New value indicates the value we are going to change the Version entry in the related registry Keys to.

Instruction 7: Un-minimize Regedit, and then under the Client Key find the Version entry value. At the time of writing this tutorial, the value in this field should be 4.6.01038. Right Click the value. Select the Modify... option from the context menu. Then copy the contents of the box completely this time. Hit close, and Minimize Regedit. Enter a new line as "original value: " and then paste the value you copied next to it. This will indicate the value we must change the Version entries in the related registry keys back to. Again this is to avoid confusion between the values.


Instruction 8: Un-minimize Regedit and right click the actual Client key in the navigation panel. Select Permissions option and click the Advanced button in the dialogue that pops up. In the Permissions entries: box, double click the Administrators entry or hit the Edit button while it’s selected. In the new dialogue that has opened, find the check box Full Control and check it on. Press the ok button.

Instruction 9: At the top of the previous dialogue under the title bar there is the label Owner and next to it is most likely TrustedInstaller set as the current Owner of the key. This means it has priority over everyone else. Click the Change blue link next to the name of the Owner.

In the new dialogue, in the box marked Enter the object name to select:. Type: Administrator and hit ok. The Owner should now say Administrator. Hit ok button on both dialogues.

Instruction 10: Now we are ready to edit the value! Minimize Regedit, and copy the entry for the "new value" line you made. Un-minimize Regedit, and Right Click the Version entry under the Client Sub-Key. Select the Modify... option. In the dialogue, paste your copied value, and hit ok to save changes.

If it gives you an error at this point, you have missed something or done something incorrectly.

Instruction 11: Now repeat the previous steps exactly for the Full Sub-Key in v4 that is below the Client Sub-Key (not nested in it below it)! Leave this Path open, don't collapse the keys! Regedit will save your place and keep them open for you even after exit, cause It’s friendly like that…

Instruction 12: We have one more set of values to find and edit to make this work! Like before open the nested keys in the following order:

HKEY_LOCAL_MACHINE -> SOFTWARE -> WOW6432Node -> Microsoft -> NET Framework Setup -> NDP -> v4 (NOT the “v4.0” key “v4" they are different).

This all very familiar or is it just me?! Now repeat the steps to edit the keys with the same names as we did earlier. Remember we changed the keys Client and Full under the path:

HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> NET Framework Setup -> NDP -> v4

Do exactly the same thing for those keys named Client and Full here. The values you are changing to and from should be the same in both places! So you don’t have to copy paste a separate set! Unless they are for whatever reason different…

After you have completed making your edits, exit Regedit without making any additional changes. Sign Out of the Elevated Administrator Account completely. Don’t just switch users, hit Sign Out.​

Now on to Step 6!​
 
Step 5: Install Microsoft Windows 7.1 SDK with .Net 4 Framework
Now, Sign In to your User account. Open your "GRMDSK" ISO image you downloaded for your architecture earlier. That is the Windows SDK 7.1 version! Run the “setup.exe” in the main directory of this ISO.

During this Installation, make sure you have everything checked for the install features except the following:

>> Application Verifier

>> Debugging Tools

Then finish the installation. If this finishes without error, which it most likely will unless you did something wrong or there is an unforeseen problem, then you are in good shape to finish as this was the hardest part of the tutorial. Yay! Lastly, Eject the ISO from the System like you did before.
 
Step 6: Special Preparations, Cleanup
Now we have to do some cleanup after ourselves… you can’t just go around tricking Windows into doing whatever you like forever with no consequences!

Sign Out of your account, and Sign In to the Elevated Administrator Account once again. Open Regedit. Now go back through the 4 Keys we modified before and set everything back the way it was…

For each key we changed do the following:

1. Copy-paste the value we placed after “Original Value” in your text file into the Version entry we edited.

2. That should be a value of “4.6.01038”, at the time of writing this tutorial.

3. Second Right Click the key and go to Permissions -> Advanced

4. Then select Administrators entry in the Permission Entries box and hit Edit

5. Check the Full Control check box to off (i.e. it is empty), and hit ok.

6. Lastly select the Change link next to the Owner field at the top of the dialogue.

7. In the Enter object name to select: box, type:

NT Service\TrustedInstaller

Then hit ok, and exit out of the dialogues.

8. Move onto the next key until you’ve changed back all 4 of the keys to their original state.

Remember the Keys we modified are:

>> HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> NET Framework Setup -> NDP -> v4 -> Client

>> HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> NET Framework Setup -> NDP -> v4 -> Full

>> HKEY_LOCAL_MACHINE -> SOFTWARE -> WOW6432Node -> Microsoft -> NET Framework Setup -> NDP -> v4 -> Client

>> HKEY_LOCAL_MACHINE -> SOFTWARE ->WOW6432Node -> Microsoft -> NET Framework Setup -> NDP -> v4 -> Full

Finally, collapse all the Keys and exit Regedit. Everything is back the way we found it in the registry. Sign Out of the Elevated Administrator Account and into your user account.

Open the Elevated Command Prompt (right click in the search box results -> Run as administrator) and type:

net user administrator /active:no

Then hit enter. This disables the Elevated Administrator Account. Re-enable it if you ever need it again in the same fashion as before. It’s not a good idea to leave it enabled all the time though!

Now Everything is tidied up! Move on to Step 7!
 
Step 7: Reinstallations
Install all of the following in the exact order listed, otherwise you may have issues. Details for each installation are in spoiler tags:

Install Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1
Spoiler :
This is a fix for the v100 compilers that may have been removed in 7.1 SDK installation.


Install Microsoft Visual Studio 2012 Express
Spoiler :
Standard install here, just run it and complete the installation.


Install Microsoft Windows Software Development Kit - Windows 8.100.26936.0
Spoiler :
This is Windows 8.1 SDK. Make sure all the features options are checked for installation. Other than that nothing special to do here, just finish the installation.


Install Microsoft Windows Software Development Kit - Windows 10.0.10586.212
Spoiler :
This is Windows 10 SDK. Make sure all the features options are checked for installation. Other than that nothing special to do here, just finish the installation.


Install Microsoft Visual Studio 2015 Community with Update 2
Spoiler :
Here we will do some customization of the Install…
Select the Custom option, when it asks you how you want to configure your installation! Under “Programming Languages” features, select everything that is tied to C++. At the bottom, if you are going to be following my C++ tutorial series after this, install the Git features under “Common Tools”.

Uncheck everything else unless you’re interested in developing with other languages or for other platforms. It will go faster if you do and you can add features at any time by rerunning the Visual Studio Installer! Finish the installation.


Install Microsoft Visual C++ 2010 Shell (Isolated) Redistributable Package
Spoiler :
Required for ModBuddy and various other Steam Games/Software to install correctly and run. Nothing special here, just install it…


If the following are NOT installed, then install them, otherwise skip installing them… do not overwrite any packages!
Install Microsoft Visual C++ 2005 Redistributable (x86)

Install Microsoft Visual C++ 2005 Redistributable (x64)

Install Microsoft Visual C++ 2008 Redistributable (x86)

Install Microsoft Visual C++ 2008 Redistributable (x64)

Install Microsoft Visual C++ 2010 Redistributable (x86)

Install Microsoft Visual C++ 2010 Redistributable (x64)

One more very important thing!
In the Windows 10 Search Bar, type: Edit the system environment variables[/B]. Then click the Environment Variables… button.

Under the System Variables box, find the “Path” Environment Variable (not the one under the user variables, the one under system). Select it and hit the Edit button. A list will pop up in a dialogue window.

This is a list of important directories Windows points programs (such as Visual Studio 2015 Community) to when they need to link to other applications and resources. Click New, and enter:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE

Click ok and close out the System Dialogue.

After everything is finished Restart your Computer!
 
Step 8: Building the unmodified CvGameCoreSource
Open File Explorer and navigate to

C:\Program Files(x86)\Steam\steamapps\common\ Sid Meier’s Civilization V SDK \

Now copy the “CvGameCoreSource” folder from this directory into your choice of a Workspace folder. It is important not to work directly from the SDK directory, as this is your untouched copy to pull from!

Next, open the “CvGameCoreSource” folder you just copied. Open the “CvGameCoreDLL” folder in this directory. Do a search for “CvGameCoreDLL.rc”. Right Click “CvGameCoreDLL.rc” and select Edit in Notepad++ (or your choice of text editor) from the drop down menu.

On line 10 of this file change:

#include "afxres.h"

to

#include "windows.h"

Then save and Close the file.
Next, open the “CvGameCoreSource” folder you just copied. Open the “CvGameCoreDLL_Expansion1” folder in this directory. Do a search for “CvGameCoreDLL.rc”. Right Click “CvGameCoreDLL.rc” and select Edit in Notepad++ (or your choice of text editor) from the drop down menu.

On line 10 of this file change:

#include "afxres.h"

to

#include "windows.h"

Then save and Close the file.
Next, open the “CvGameCoreSource” folder you just copied. Open the “CvGameCoreDLL_Expansion2” folder in this directory. Do a search for “CvGameCoreDLL.rc”. Right Click “CvGameCoreDLL.rc” and select Edit in Notepad++ (or your choice of text editor) from the drop down menu.

On line 10 of this file change:

#include "afxres.h"

to

#include "windows.h"

Then save and Close the file.

After Visual Studio 2015 Community starts up, it will ask you if you want to do a one-way conversion on this solution… click “Cancel”, we are not interested in upgrading…

When the solution loads, let Visual Studio 2015 Community finish parsing the files down on the blue bar at the bottom before you try to build or do anything… otherwise it might get annoyed and complain at you with errors.
Right Click the “CvGameCoreDLL” project in the Solution View panel, and select “Properties”. Under “Configuration Properties/General” tab, edit the box with the label “Target Name” next to it, enter the value: CvGameCoreDLLFinal Release, then click Apply. Now open the “Linker/General” tab, edit the box with the label “Output File” next to it. Enter the value: $(OutDir)CvGameCoreDLLFinal Release.dll, and click Apply.

Right Click the “CvGameCoreDLL_Expansion1” project in the Solution View panel, and select “Properties”. Under “Configuration Properties/General” tab, edit the box with the label “Target Name” next to it, enter the value: CvGameCore_Expansion1, then click Apply. Now open the “Linker/General” tab, edit the box with the label “Output File” next to it. Enter the value: $(OutDir)CvGameCore_Expansion1.dll, and click Apply.

Right Click the “CvGameCoreDLL_Expansion2” project in the Solution View panel, and select “Properties”. Under “Configuration Properties/General” tab, edit the box with the label “Target Name” next to it, enter the value: CvGameCore_Expansion2, then click Apply. Now open the “Linker/General” tab, edit the box with the label “Output File” next to it. Enter the value: $(OutDir)CvGameCore_Expansion2.dll, and click Apply.

Make sure there are no Typos, or Errors in any of these fields… as it can lead to annoying unintelligible error messages from the Visual Studio compiler. For instance, if you have a space between $(OutDir) and CvGameCore_Expansion2.dll, like I did the other day… then you could possibly not notice and spend an hour wondering why the stupid thing won’t compile when you’ve done this the exact same way a billion times.

Now go to the Menu-Bar in the main window, and select Build -> Build Solution. The compiler will now make your DLL for you.

If everything was done properly and there are no unforeseen problems, it should compile and build as expected and you’ll be left with a nice brand new shiny DLL, that you can put in your mod!
 
Step 9: Happy Modding Fellas!

This is the end of this tutorial on Compiling and Building the Civ5 DLL on Windows 10.

All posts have been filled in for the tutorial sections, so feel free to ask questions, or leave comments below this post!

Hope this helps some people! :)

Note: I realize the above is not yet formatted, I will be formatting it at some point later today because it is hard to read like this.... in the meantime the .DOC attached to the first post has been updated with the new version of the tutorial and is formatted!
 
I have begun reformatting these posts. Will have them all beautified within the next hour or so. I will also be posting a new tutorial thread for Chapter 1 of my remade tutorial series on learning C++, in this subforum.

Stay tuned! :)
 
Initial updates to the formatting of all the tutorial sections is completed. :)

Further updates or revisions may occur.

Also! I am currently working on a separate thread for a similiar method using the Windows 7 SDKs on Windows 7, 8, and 8.1, as I have found my installation keys for Windows 7 home premium on my laptop, and my Windows 8.1 key I was using for my desktop before I bought my copy of Windows 10. This will also allow me to test for bugs and differences in behaviors across OS versions in my tutorials and mods. Yay more methods more testing!

I will be posting the thread in the next couple of days, once the details are ironed out!

Also for those of you who were following the beginning of my C++ tutorial, be looking for the reboot of the series as it will be posted soon. I will have the entire first Chapter on the Basics of C++ posted in 2 to 3 days. No hard to read images this time! Although there may be fancy title graphics and some associated pictures... I like pictures... >_>

Leave comments, questions below this post. I will attempt to respond as soon as possible depending on my schedule. Side note: my interaction with the forums will probably be limited for the next day and a half as I will be out of town.

Have fun everybody, and good luck in your endeavors! ;)
 
You are a technical expertise, excellent people, although I can't understand these complicated code. Sincerely wish you good luck, welcome to have the opportunity to travel around China. (I never use my computer to the Internet, kindness and citizen of the earth, all countries have:))
 
Top Bottom