MacroQuest2:Compiling

From MacroQuest Wiki

Difficulty Rating
Compiling
Usage Intermediate
Level of Understanding Intermediate
Computer Savvy Intermediate
Logic Intermediate

Contents

Overview

MacroQuest2 does not come pre-compiled, which means that you need to compile it in order to use it.

The process is as follows:

  1. Install the compiler
  2. Download the source
  3. Create the MQ2Auth0.h
  4. Compile the source
  5. Run MQ2

Install Compiler

The only supported compilers are Visual C++ 6.0, Visual C++ 2003 and Visual C++ 2005. Support for VC6 is being phased out, and VC2005 can be used completely free, so follow the latter instructions if at all possible.

Visual C++ 6.0

After installation of Visual C++ 6.0, install Service Pack 6 from here.

Visual C++ 2003

No additional service packs are needed if you have Visual C++ 2003 installed.

Visual C++ 2005 Express

  1. Download the Setup program here and install it.
  2. Download SDK files and install them:
    1. If you are using XP or Vista 32-bit, download the Microsoft Platform SDK from here.
    2. If you are using Vista 64-bit download the Windows SDK here.
  3. Open Visual Studio 2005 Express.
  4. From the Tools drop down menu, select Options...
  5. Expand the "Projects and Solutions" tree and select "VC++ Directories"
  6. In the right window from the "Show Directories for" drop down menu select the following items and add the paths below:
    1. Executable files:
      • C:\Program Files\Microsoft Platform SDK\Bin for 32-bit
      • C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin for 64-bit
    2. Include files:
      • C:\Program Files\Microsoft Platform SDK\include for 32-bit
      • C:\Program Files\Microsoft SDKs\Windows\v6.1\Include for 64-bit
    3. Library files:
      • C:\Program Files\Microsoft Platform SDK\lib for 32-bit
      • C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib for 64-bit
  7. Make sure the directories you just entered are at the top of the list. If not, use the Up or Down arrows to put them in the correct order.
  8. If you installed using default directories, navigate to C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults and edit corewin_express.vsprops:
    • Change AdditionalDependencies="kernel32.lib" to AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"
  9. Navigate to C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\ and edit AppSettings.htm, commenting out lines 441-444 like this:
// WIN_APP.disabled = true;
// WIN_APP_LABEL.disabled = true;
// DLL_APP.disabled = true;
// DLL_APP_LABEL.disabled = true;

Download the Source

  1. Download the latest MacroQuest2 source files from here.
  2. Unzip the source files to a directory of your choice, making sure that subdirectories are retained.

Create MQ2Auth0.h

MQ2Auth is a form of protection to restrict the distribution of pre-compiled binaries. You need to run MQ2Auth.exe before compiling, to tell MQ2 that you are authorized to run it on your PC.

Compiling for yourself

Open the folder you extracted the source files to and run MQ2Auth.exe. This will create the MQ2Auth0.h file the MQ2Main directory.

Compiling for friends

If you are compiling for someone else, you must get their MQ2Auth0.h file and add the contents of their file to your MQ2Auth0.h file.

You can ask them to download the MQ2 source, extract just the MQ2Auth.exe file and run it. It will create the MQ2Auth0.h file in the same folder it is run. They should then send that file to you.

You can add comments to the end of each line if required, for example:

MQ2AUTH(KkIRzfsLfkcViSKKbFCLPrxJssu); // Person1
MQ2AUTH(ZRCmvQxmFDmZulHeCBwHsoGxisc); // Person1 
MQ2AUTH(VH_ThwYG_KbCWRVAWDzTayIPCRS); // Person2
MQ2AUTH(EaQEdgNNAcQWCxYVYVVzARBDERw); // Person2 
MQ2AUTH(pXfpGxHTMSHw_CSFTnuEFAbqZhr); // Person3 
MQ2AUTH(GLpOCyCpmkxIWqkuXpEOgTTQihF); // Person3 
MQ2AUTH(LFlYfuraYsIHoUBpElTCllRZwET); // Person4 
MQ2AUTH(_tboUtEhOFwvsfUKaSJEqo_NqEk); // Person4

Compile the Source

Visual C++ 6.0

  1. Browse to the folder you extracted the source to and open macroquest2.dsw
  2. Select Build -> Set Active Config and select MQ2main. Click OK
  3. Select Build -> Build MQ2main.dll
  4. Select Build -> Batch Build. Make sure everything in the batch build window that says release has a check next to it
  5. Click the Build button

Visual C++ 2003

  1. Browse to the folder you extracted the source to and open MacroQuest2.sln
  2. If asked to update the code for the current version of .NET, do so
  3. Go to Build -> Configuration Manager
  4. Select Release, and place a check in each dll you want compiled
  5. Go to Build --> Build Solution

Visual C++ 2005 Express

  1. Browse to the folder you extracted the source to and open MacroQuest2.sln
  2. If asked to update the code for the current version of .NET, do so
  3. Go to Build -> Configuration Manager
  4. Select Release, and place a check in each dll you want compiled
  5. In the Solution Explorer, right-click on MQ2Main and choose "Set as Startup Project"
  6. With MQ2Main selected in the Solution Explorer, go to Build -> Build MQ2Main
  7. Go to Build -> Batch Build, click "Select All" and then "Build"

Compiling from the command line

  1. Open a command prompt (Start->Run->cmd)
  2. Find the bat file that sets the environment for your VC installation. This will be vcX\bin\vcvars32.bat for most installation, where X is 98, 7, 8, or 9 depending on which version you have.
  3. Run that bat file from the cmd window by typing in the path to it.
  4. In the cmd window, cd <path to MQ2 extracted source>
  5. In the cmd window, nmake clean all
    • If you get a "Cannot determine compiler version." error, type "set COMPILER=8" in the cmd window.
    • Note: to add plugins, add them to the extra.mak file in the following format:
DIRECTORIES= MQ2Clickies mq2eqbc mq2fps mq2moveutils

Run MQ2

Once compiled, the relevant files will be placed in the \Release subdirectory. Run MacroQuest2.exe.

Troubleshooting

See here for Help and Troubleshooting of the compile process.

Compiling using free visual c++ 2008 *vista and xp*

1. download vc++ 2008 express edition here

     http://www.microsoft.com/express/download/

2. run vcsetup to the location you have saved it to and install. The install after done asks to restart!

3. go to masterquest2.com and go to download on the left side and get the newest source release (patch days require new sources)

4. create a folder (name does not matter) and extract that source u downloaded into it.

5. right click the folder and click properties and un check the read only.

6. open up the folder and serch for m2qauth.exe and run it, a small black box will come up for a sec and go away.

7. search for macroquest2 visual studio solution and open that.

8. click finish to convert the files and show the log when done.

9. when the window comes up u will see a box on the left that has mq2main right click that and scroll down to "set as start up project" it should now be displayed in bold

10. right click mq2 main again and click build at the top should say 1 succeeded when process is complete.

11. go up to the top and click Build then scroll down to batch build and when that window comes up click select all (will check all the plugins to build). once completed depending on the amount of plugins it will show xx sucessful xx failed xx up to date

12. now u can close out of vc++ 2008, goto the folder you made and search for Release folder in there u will see macros that you have or can add to, and a file called macroquest2 run that by double clicking (***if u use vista you gotta run as administrator by right clicking***)

ENJOY and Thanks to all the guys that helped me and for all those who put time and effort into making mq2 what it is /hug Insert non-formatted text here