PCSX2 Documentation/Compiling on Windows

From PCSX2 Wiki
Revision as of 02:58, 9 January 2015 by Krysto (talk | contribs) (Created page with "1. Setting up the Build Environment In order to compile PCSX2 you will need to configure a working build environment based on Microsoft's Visual Studio. There are a lot of thi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

1. Setting up the Build Environment In order to compile PCSX2 you will need to configure a working build environment based on Microsoft's Visual Studio. There are a lot of things to download, so I've placed links to them at the front of the guide so you can get everything you'll need as the first step.

Downloading the Prerequisites You know the drill -- download all of these. You have your choice between Visual Studio 2008, Visual C++ 2008 Express and Visual Studio 2010 Professional, but at present Visual Studio 2010 is not an officially supported build environment so users are discouraged from electing to use it to compile PCSX2 (more detail provided below). Visual Studio 2008 Visual C++ 2008 Express Edition Visual Studio 2010 Professional (Beta 1) Windows Server 2003 R2 SDK* Only needed if you're compiling with Visual C++ 2008 Express Edition DirectX SDK (August 2009) TortoiseSVN* Recommended but not required - though you will need an SVN client OpenGL Extension Wrangler* Only needed if you're compiling plugins as well nVidia's CG Toolkit* Only needed if you're compiling plugins as well Nullsoft Install System (Optional)* Only needed if you're compiling the Installer NSIS Advanced Uninstall Header* Only needed if you're compiling the Installer Visual C++ 2008 SP1 Redistributable* Only needed if you're compiling the Installer Installing Microsoft Visual Studio At present, there are three versions of Microsoft Visual Studio that are capable of compiling PCSX2. Depending on whether or not you develop professionally, as well as other factors, you may or may not have access to a copy of Microsoft Visual Studio 2008 Standard. To ensure the widest applicable audience, this guide will cover the installation and configuration of all three of these versions. Note, however, that it is only required for you to install one of them! Installing Microsoft Visual Studio 2008 Standard Edition Insert your Visual Studio 2008 Standard CD (or download the Trial from the link above). Run setup and click next at the Welcome Screen (shown below). It's your choice as to sending information about the setup experience to Microsoft. Accept the terms of the EULA and enter your product key. The Visual Web Developer and Visual Basic features are not required in order to compile PCSX2, however, if you program in any of these languages, you may elect to install them and it will not cause any problems. Make sure to install Visual C++. I recommend keeping the default installation paths. Visual Studio will begin installing. Once setup is complete, you will be presented with the following screen. Click Finish. Now that Visual Studio is installed, your system needs a few patches in order to be current. Visiting Windows Update with Microsoft Update enabled shows the following: Install all of the updates and then Visual Studio 2008 is ready to go. Skip the Visual C++ 2008 Express and Visual Studio 2010 Professional sections and continue below with Installing SDKs. 1 2 3 4 5 6 Installing Microsoft Visual C++ 2008 Express Edition Download the Visual C++ 2008 Express Edition Installer from the link above. Run it, and click next at the Welcome Screen (shown below).

Accept the EULA. It's your choice whether or not you allow it to display online and RSS content, it doesn't make a difference to the compiling of PCSX2. You do not need Microsoft SQL Server 2008 Express Edition in order to compile PCSX2, however, if you are doing development in any other capacity that requires a local SQL Database, you may choose to install this component. I recommend keeping the default installation location. Click Next. The components will be downloaded to your computer. Once done downloading, they will then be installed. Once the installation has finished, you will see the following screen. Click Finish and the installer will close. Now that Visual C++ is installed, your system needs a few patches in order to remain current. Visiting Windows Update with Microsoft Update enabled shows the following: Download and install the updates, and then skip past Installing Visual Studio 2010 Professional and continue with the SDK installations. 1 2 3 4 5 6 7 8 Installing Microsoft Visual Studio 2010 Professional (Beta 1) NOTE: Visual Studio 2010 is not presently a supported build environment for PCSX2. The instructions and configuration information below are provided sheerly for completeness's sake as Visual Studio 2010 will ultimately be a supported build platform, and this information will be updated as it nears completion and release. It is not recommended that you attempt to build PCSX2 with Visual Studio 2010 at this time.

Download the Visual Studio 2010 Professional Web Installer from the link above. Run it, and click next at the Welcome Screen (shown below). Yes, it will have the Visual Studio Team System logo even though you downloaded Visual Studio 2010 Professional and the titlebar and actual text say so. Don't ask me. Ask Microsoft. Accept the EULA and enter your Product Key, then hit Next. The .NET Development Environment is NOT required in order to configure PCSX2, but you can choose to install it if you plan on doing .NET Development. I recommend installing Visual Studio in the default location to ensure there are no problems later on. Visual Studio's installer will begin downloading the installation components. Once it has finished downloading the components, it will begin installing them. Soon after beginning the installation, I was prompted to reboot in order to continue. After I rebooted and logged on, I got the following at system startup: The installer then launched and continued installing where it had left off. After that finishes, you should be presented with the following screen: Click finish and the installer will close. Now that Visual Studio is installed, your machine needs several more patches in order to be current. Visit Windows Update with Microsoft Update enabled and you'll be presented with the following updates The SQL Server update isn't required for PCSX2, but is recommended in general to keep your machine as up-to-date as possible. After the updates have installed, Visual Studio 2010 Professional is now installed on your computer. Go ahead on to the next step. 1 2 3 4 5 6 7 8

9	 10	 11

Installing SDKs The PCSX2 codebase makes use of several freely available SDKs that must be downloaded and installed in order to successfully compile PCSX2. If you are intending to compile the PCSX2 plugins as well, you will need additional SDKs. Each of the requisite SDKs is listed below. DirectX SDK Download the Web Installer from the link above. Run it, and click next at the Welcome Screen (shown below.) Accept the EULA as shown. You will be prompted to join the Windows Customer Experience Improvement Program. I chose not to, but the decision is yours to make. It won't impact anything you'll be doing with the software. You will then be prompted for a destination folder, I recommend choosing the default to make life easier later on. You will be prompted with a list of components. The default selection will suffice for building PCSX2, so go ahead and click Next. The DirectX SDK will then begin installing. You should then be presented with this screen. Click finish and move on to the next step. 1 2 3 4 5 6 7 OpenGL Extension Wrangler (GLEW) Download the OpenGL Extension Wrangler binaries from the website listed above. Extract the files into a directory of your choice. In this case, I have extracted them to:

  C:\Development\Add-On Libraries\GLEW\  

Secondarily, if you intend to build and use the debug version of the gsDX plugin, you will need to manually copy glew32.dll to the \bin subdirectory of your pcsx2 installation. For example, if you followed the defaults on a 32-bit system, you'd put it here:

  C:\Program Files\pcsx2\bin

Windows 2003 R2 Platform SDK (Visual C++ 2008 Express ONLY) If you are compiling using Visual C++ 2008 Express, in order to compile several of the plugins, you will need files that are not included with your version of Visual Studio by default. Download the Windows 2003 R2 Platform SDK Web Installer from the link above, and run the installer. Click Next at the Welcome Screen shown below. Accept the EULA and click Next. Choose the Typical install when prompted and click Next. I recommend leaving the installation at the default directory to ensure there are no problems in the future. The installer will then ask you to confirm that you are installing.... Then it will install. After the installation has completed, you will see the following screen. Click Finish and the installer will close. Continue to the next prerequisite. 1 2 3 4 5 6 7 nVidia's CG Toolkit Download the nVidia CG Toolkit from the link above and run the installer. Click next at the Welcome Screen as shown. Accept the EULA and click next. Accept the default installation destination and click next. The default component selection will suffice for PCSX2 compilation, however, you can add anything that is not selected if you want it and the source code examples and documentation are not required (and will shave 30-40MB off of the install). Review the confirmation screen and click Next to continue. The installer will begin the install process. You will be presented with the following screen when the installer has finished: Continue on to the next section. 1 2 3 4 5 6 7 Installing an SVN Client An SVN client is not required in order to build PCSX2, but it is strongly recommended and is the only supported way of obtaining the current revision of PCSX2 source code. In this case, we're using TortoiseSVN TortoiseSVN Visit the TortoiseSVN website listed above and go to the Downloads page. Download the latest version of TortoiseSVN and run the installer. You will be presented with the following Welcome screen. Click Next. Accept the EULA and click Next. The default components will suffice for the purposes of this installation. Click Next. Review the Confirmation Screen to ensure the information is correct, and click Next to begin the install process. You will see the current progress while TortoiseSVN is installing. Once complete, you will see this screen. Click Finish. You will be prompted to reboot your computer. Save your work and reboot, then continue to the next section. 1 2 3 4 5 6 7 2. Configuring the Build Environment Configuring the SDK Library and Include Directories Before PCSX2 will compile successfully, we need to ensure that all of the include, library, and header directories for the SDKs that we have installed are configured in our respective version of Visual Studio. Microsoft Visual Studio 2008 Standard Edition Navigate to your C:\Development\Project Source\PCSX2\ directory and double click on the pcsx2_suite_2008.sln Solution file. This will open Visual Studio 2008 and you will be presented with a screen that should look similar (it may not look exact) to the one here: To access the configuration that we need to change, we will need to open the Tools menu and select Options from it. Expand "Projects and Solutions" from the left-hand side and then select "VC++ Directories". This will bring up the dialog that allows you to modify the search paths for your VC++ solutions.

1	 2	 3

Several changes need to be made here. Under the Win32 Platform, you need to add the following to Include files:*If you installed GLEW elsewhere, reflect here

  $(DXSDK_DIR)\Include
  $(ProgramFiles)\NVIDIA Corporation\Cg\include
  C:\Development\Add-on Libraries\GLEW\include

Under the Win32 Platform, you need to add the following to Library files:*If you installed GLEW elsewhere, reflect here

  $(DXSDK_DIR)\Lib\x86
  $(ProgramFiles)\NVIDIA Corporation\Cg\lib
  C:\Development\Add-on Libraries\GLEW\lib

Under the x64 Platform, I added the following for Library files:*NVIDIA Directory only available or necessary if compiling on a 64-bit OS

  $(ProgramFiles)\NVIDIA Corporation\Cg\lib.x64
  $(DXSDK_DIR)\Lib\x64

That should finish up all of the search directory modifications required for PCSX2 to build properly. Now on to the next step! Microsoft Visual C++ 2008 Express Edition Visual C++ 2008 Express Edition has several limitations not found in either Visual Studio 2008 Standard or Visual Studio 2010 Professional. Because of this, there are special instructions specific to this build environment. To begin, make all of the same changes that you would make for Visual Studio 2008 Standard, except ignore anything relating to the x64 builds and build directories, as Visual C++ Express cannot compile x64 builds. Also note that you will get error about project folders not being supported in this version of the software every time you open the .sln file. This will not interfere with your compiling, just click OK to them all. In addition to the changes above, you will need to tell Visual C++ 2008 where to find the Microsoft Windows 2003 R2 Platform SDK we downloaded. To access the configuration that we need to change, we will need to open the Tools menu and select Options from it.

Expand "Projects and Solutions" from the left-hand side and then select "VC++ Directories". This will bring up the dialog that allows you to modify the search paths for your VC++ solutions.

1

Under the Win32 Platform, you need to add the following to Include files:

  $(ProgramFiles)\Microsoft Platform SDK for Windows Server 2003 R2\include\atl
  $(ProgramFiles)\Microsoft Platform SDK for Windows Server 2003 R2\include\mfc

Next up is to get around a limitation regarding the compiling 32-bit ATL / MFC solutions in the Express editions of VS. Open the file C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include\atl\atlbase.h in a text editor and search for the following text:

  #pragma comment(lib, "atlthunk.lib")

Comment this out, so that it reads:

  // #pragma comment(lib, "atlthunk.lib")

Save the file and exit your text editor. Once you have done this, you should be able to continue on to the next steps. Microsoft Visual Studio (Beta 1) Professional Coming soon... 3. Getting the Source Code In order to compile PCSX2, you will need to first download all of the current source code to your local machine. Depending on which branch you are downloading, the repository locations may change.

Downloading the PCSX2 Main Trunk SVN Code Make the Trunk Build Directory The first thing you will need to do is make a directory that will ultimately house your SVN Source Code for PCSX2. I have chosen the following directory:

  C:\Development\Project Source\PCSX2\

You can choose whatever directory you like, just make sure that you substitute it in any location that I have included the above directory. Configure the Trunk Directory as an SVN Directory and Download the Latest Revision Open the parent folder to your new PCSX2 directory and right click on the PCSX2 directory in the list. Since TortoiseSVN is installed, you will now see "SVN Checkout" in the drop-down list. Select it. You will be presented with an SVN Checkout configuration page, which will ask you for the "URL of Repository". Enter the following, as shown in the screenshot:

  http://pcsx2.googlecode.com/svn/trunk/

You will see information similar to the screenshot when the checkout is complete. You can verify the existence of the Source code by visiting the PCSX2 directory. You'll see something like the screenshot.

1	 2	 3	 4

Download Updated Trunk Revisions After you have configured this directory as an SVN directory, all you need to do in the future is right click on it from Explorer and select "SVN Update" from the context menu as shown in the screenshot. TortoiseSVN will then fetch the latest code and show you a log of all of the files that were updated. If you are interested in what changes have been made since your last source download, click the "Show Log" button.

1	 2

Downloading the PCSX2 Legacy GUI Branch SVN Code Make the Legacy Build Directory Just like the main Trunk SVN branch, the first thing you will need to do is make a directory that will ultimately house your SVN Source Code for the Legacy GUI branch of PCSX2. I have chosen the following directory:

  C:\Development\Project Source\PCSX2-legacy\

You can choose whatever directory you like, but as before, make sure that you substitute it in any location that I have included the above directory. Configure the Legacy Directory as an SVN Directory and Download the Latest Revision Open the parent folder to your new PCSX2-legacy directory and right click on the PCSX2-legacy directory in the list. Since TortoiseSVN is installed, you will now see "SVN Checkout" in the drop-down list. Select it. You will be presented with an SVN Checkout configuration page, which will ask you for the "URL of Repository". Enter the following as shown in the screenshot.

  http://pcsx2.googlecode.com/svn/branches/legacy_gui

You will see information similar to the screenshot when the checkout is complete.

1	 2	 3

Download Updated Legacy Revisions Downloading updates is the same as it is with any other SVN directory, but for completeness's sake, after you have configured this directory as an SVN directory, right click on it from Explorer and select "SVN Update" from the context menu as shown in the screenshot. TortoiseSVN will then fetch the latest code and show you a log of all of the files that were updated. If you are interested in what changes have been made since your last source download, click the "Show Log" button.

1	 2

4. Compiling PCSX2's Binary You've now completed all of the "leg work" required in order to compile PCSX2 on your machine. Congratulations!

Compiling Trunk SVN Builds of PCSX2 Open the PCSX2 SVN directory you have downloaded the source code in to (in this case, C:\Development\Project Source\PCSX2) and double-click on the pcsx2_suite_2008.sln Solution file. This will open Visual Studio 2008 (if it is not already open) and you will see a screen similar to this.

1

Build Target Selection (Developer, Debug, Release, SSE2, SSSE3, or SSE4 Builds) At the top of your screen, you will see a small drop down list which contains what is known as your "Build Target", as shown in the screenshot. This menu corresponds to the build of PCSX2 that you will be compiling. SSE2, SSSE3, and SSE4 refer to CPU instruction sets and only apply to the gsDX Plugin (though they compile the full solution as well). The Release Build Target does not specify an instruction set target for the gsDX compile and will not compile gsDX. It is recommended that you choose all three (SSE2, SSSE3, and SSE4) as a build target (Release is unnecessary) if preparing a release build to ensure that all users have available versions of the plugin. Once you have selected the Build Target, it is time to build the solution. You can either select the Build Menu from the top menu, and choose Build Solution, or you can hit CTRL-SHIFT-B. This is the moment of truth! If you've followed the instructions properly and configured all of the search directories for Visual Studio properly, this process should finish with 0 errors. Warnings are usually nothing to worry about, so, as long as the solution compiles with 0 errors and you have the output files, you should be good to go. Congratulations!

1	 2

Compiling Legacy GUI SVN Builds of PCSX2 Open the PCSX2-legacy SVN directory you have downloaded the source code in to (in this case, C:\Development\Project Source\PCSX2-legacy) and double-click on the pcsx2_suite_2008.sln Solution file. This will open Visual Studio 2008 (if it is not already open) and you will see a screen similar to the screenshot.

1

Build Target Selection (Developer, Debug, or Release Builds) At the top of your screen, you will see a small drop down list which contains what is known as your "Build Target", as shown in the screenshot. This menu corresponds to the build of PCSX2 that you will be compiling. SSE2, SSSE3, and SSE4 refer to CPU instruction sets and only apply to the gsDX Plugin (though they compile the full solution as well). It is recommended that you choose all three as a build target if preparing a release build to ensure that all users have available versions of the plugin. Build the branch release just like you would the main Trunk release.

1

5. Effective Build Troubleshooting Steps So, your build failed. What now? Even in the most perfect of circumstances, there is always the possibility that your build is going to fail for some reason or another. I've included a few things to try that should take care of almost all of the common compiling issues that users have. If at first you don't succeed... Re-try the build, at least once. Visual Studio is notorious for spamming errors about files being in use, access denied, or errors returned from mt.exe. If this happens to you, or frankly in pretty much any other case, make sure to retry the build at least once to ensure you have a reproducible build failure! CL.EXE Compiling Errors w/ Visual Studio 2008 Standard If you are using Visual Studio 2008 Standard and have followed this guide from start to finish and are experiencing build errors in relation to CL.EXE, a workaround is to put the VS2008 install disc in and to modify your installation of VS and add Visual C#. Note that you're not installing C# because any of PCSX2 is programmed in C#, you're installing C# because for some reason, the C++ install doesn't put the necessary version of CL.EXE in your build environment. I'm investigating why this is and will update the guide if I find a better way to solve the missing CL.EXE problem. I had this problem in two specific cases but I've been shown instances where it was unnecessary. As such, I pulled it from the main steps and added it as a possible workaround in case anyone else encounters it. It seems to only occur when running under a Virtual PC in Virtual PC 2007. Clean your Dev Environment It is good practice to clean your build environment of Visual Studio build-process temporary files and post-build remnants of the solution if you encounter errors while building. This is a quick and painless process. To begin, open the pcsx2_suite_2008.sln Solution file. Once Visual Studio has opened, select the build of PCSX2 that you are having trouble building from the Build Target dropdown (e.g., SSE2, SSSE3, SSE4, etc.) Click on the Build menu and select Clean Solution from the list. Once this has completed, run clean_msvc.cmd in the main PCSX2 SVN directory. This will clean out more unneeded data that Visual Studio leaves behind in a clean. Retry the build and see if this solves your problem. Re-download the Source It is possible (though very uncommon) for such drastic changes to be made to the source tree in SVN that you may have stale code or remnants of previous SVN revisions that have ended up sitting in your SVN directory. A quick and non-destructive way to test this is to create a new build directory and re-checkout the source from the SVN repository. After a full fresh checkout, attempt the build again. Read the Logs - Trace the Errors When all else fails, the error log and output screens can be a wealth of information. Even if you're not a developer, you can look at the error log and extrapolate what files are involved in the error you're having. Once you know that, search for the files and see if any of them are in the directories that are supposed to be configured in the search paths -- if so, go verify in your VC++ Directories setting that you have properly entered the dependency directories. Mistyping the directory names, including the wrong directory, or overlooking a directory is one of the most common causes of build failure and can be easily and quickly fixed. If that doesn't work, post about your experiences on the PCSX2 forum under the revelant topic and someone should be able to help you out. 6. Files Necessary from Build for PCSX2's Execution PCSX2 only requires a few files in order to execute. Other files are required in order for it to function as an emulator, such as the plug-in files, but in this section I am referring only to which files are required in order for PCSX2 to execute successfully without errors.

Trunk SVN Build Files The current Trunk SVN build requires the following files in order to execute:

pcsx2.exe
w32pthreads.v3.dll
gnu_gettext.dll

If you will be using a debug build of gsDX, the following additional file is necessary and must be put into your pcsx2\bin directory:

glew32.dll

Legacy GUI SVN Build Files The current Legacy GUI SVN build requires the following files in order to execute:

pcsx2.exe
w32pthreads.dll
gnu_gettext.dll

If you will be using a debug build of gsDX, the following additional file is necessary and must be put into your pcsx2\bin directory:

glew32.dll

7. Miscellaneous PCSX2 Compiling Options As with any project, the PCSX2 project has several configurable options in relation to compiling.

PCSX2 Target Build Directory One of the options is a configurable post-build event that can optionally copy the .EXE file and required .DLL files into a folder of your choice. The files are copied both as their original filename (e.g., PCSX2.EXE) and also as a revision-tagged filename for easy regression testing (e.g. PCSX2-r1750.EXE) You will need to specify the PCSX2_TARGET_COPY Environment Variable. To do this, open the Run dialog (Hit the Windows key and R at the same time) and type "sysdm.cpl" (without quotes) and hit enter. You will be presented with a screen similar to the screenshot. Switch to the Advanced Tab and you will see the something similar to the screenshot. Click on the Environment Variables button at the bottom and you will see something similar to the screenshot. Click on New under the User Variables section and enter the information as shown in the screenshot. Once you have done that and click OK, you should see something like the screenshot. Now, when you compile PCSX2, a build copy will be placed in the directory you specified! (Make sure it exists!) You will need to log off and log back in for this to take effect!

1	 2	 3	 4	 5

Stopping Unwanted Components from Compiling If you are developing a specific project and do not want to compile the other projects every time you re-build the solution, or if you just don't want to compile a specific plug-in for some reason or another, you can easily accomplish this. Open the pcsx2_suite_2008.sln Solution file and right-click on the Project you wish not to compile. Select "Unload" from the context menu. You will now see that the project is listed as "(Unavailable)", as shown in the screenshot. When you compile, this solution will be skipped. Best of all, this option is persistent, but does not write to the Solution (.sln) file, so making this change will not cause you to get warned of a Version Conflict every time you update your SVN in the future.

1	 2

8. Running PCSX2 from the Visual Studio Debugger It is possible (and quite easy) to run PCSX2 from the Visual Studio Debugger, if you feel so compelled to do so. See below for instructions on how to do it for each supported version of Visual Studio.

Visual Studio 2008 Standard + Visual C++ 2008 Express Edition Setting PCSX2 to Run from the VS2008 Debugger Setting PCSX2 to run from the debugger is simple. Open pcsx2_suite_2008.sln Solution file. Once Visual Studio 2008 / Visual C++ 2008 has opened, right click on the PCSX2 project and select Properties. Expand Configuration Properties on the left-hand side, and select the Debugging option. Configure it to match the settings in the screenshot.

1

Once you've done this, hit OK. Once you're back to the main screen, hitting F5 will cause PCSX2 to run in the debugger. Specifying Plugins on the PCSX2 Command Line for the VS2008 Debugger If you are debugging specific plugins, you can do so with the Command Arguments variable, and when that plugin is set as the Start-up Project, PCSX2 will know to load it regardless of the selected configuration or target types. See the following example screenshot which is used for debugging SPU2-X.

1

Notice that -spu $(TargetPath) is used as the parameter. This tells PCSX2 to load whichever copy of SPU2-X that was just built -- whether it be Debug, Devel, or Release. This saves a trip into the Configuration Dialog of PCSX2 to select the built plugin manually. Visual Studio 2010 Professional Setting PCSX2 to Run from the VS2010 Debugger Specifying Plugins on the PCSX2 Command Line for the VS2010 Debugger 9. Packaging PCSX2 with Nullsoft Scriptable Install System Just Because It Compiles Doesn't Mean It Works! The steps included in this guide will pretty much guarantee that you can set up an environment in which you can compile the .NSI file included in the PCSX2 source to a .exe installer, but PLEASE NOTE THE FOLLOWING: Just because you can get it to compile without erroring does not mean that the output file will be a functional installer! Just like any other piece of code, the .NSI installer needs maintenance whenever there are changes to the file and directory structure of PCSX2. The installer is not the highest priority on the list, so it is possible that the .NSI is out of date and may be including out-dated files, or may not be including new files. It may complete compilation but net an installation that crashes every time it's run due to missing or unlinked .DLLs. With that said, it is NOT recommended that you use these installers without testing them in a sandbox / virtualized environment first to ensure that they properly install! A successful .NSI file compile does NOT equate to a truly successful installer build! Installing the Nullsoft Scriptable Install System Download the installation package from the link above and run it. You will be presented with this Welcome Screen. Click Next. Accept the terms of the EULA. Select "Full Install", if it is not already checked. It is recommended that you keep the default installation directory, and click Next. The Nullsoft Scriptable Install System will install very quickly and present you with the final screenshot. Click Finish and the installer will close.

1	 2	 3	 4	 5

Lastly, you need to copy the vc_redistx86.exe that you downloaded from the prerequisites above into the following directory:

C:\Development\Project Source\PCSX2\NSIS\

If you skip this step, the NSIS compile will fail. This file must be present for any branch of PCSX2 as well, including wxGUI. Packaging PCSX2 with NULL Plugins After you install NSIS and .NSI files are associated with the Nullsoft Scriptable Installer System, you can Right-Click on .NSI files and select "Compile NSIS Script", as shown in the picture. This will compile a PCSX2 installer and include all of the null plugins. This will NOT include the additional plugins (gsDX, SPU-X, etc.)

1

Packaging PCSX2 with all Plugins In order to compile PCSX2 and include the Plugins, you must specify the INC_PLUGINS variable to makensis.exe. To do this, run the following in a command prompt (assuming default installation directories):

"C:\Program Files\NSIS\makensis.exe" "C:\Development\Project Source\PCSX2\NSIS\pcsx2_installer_script.nsi" /DINC_PLUGINS

This will compile PCSX2 and include all of the plugins in the installer file. Packaging the PCSX2 wxGUI Branch Due to a few changes in the versioning (and some not yet up-to-date code), you will need to make some changes to the pcsx2_installer_script.nsi in order to get a working installer for the wxGUI trunk. Update to the latest SVN revision and check the .NSI file at (or around) line 103. You may see the following:

   SetOutPath $INSTDIR
   File /oname=pcsx2-r${SVNREV}.exe
   ..\bin\pcsx2.exe
   File ..\bin\w32pthreads.dll
   File ..\bin\gnu_gettext.dll

Note that it is referencing w32pthreads.dll even though the wxGUI branch of PCSX2 uses an updated w32pthreads.v2.dll. Change the code to read

   SetOutPath $INSTDIR
   File /oname=pcsx2-r${SVNREV}.exe
   ..\bin\pcsx2.exe
   File ..\bin\w32pthreads.v2.dll
   File ..\bin\gnu_gettext.dll

and close the file. Note that updating the SVN after you make this change may alert you that your copy and the copy on the server do not match. This means that the NSI file has changed in the repository and you should re-download it. If you update and get an error from NSIS about being unable to find w32pthreads.dll, you'll know what to do to fix it. Once that is done, follow the same process as is outlined above for the PCSX2 Trunk SVN.