Neverwinter Nights 2 Wine Installation

(document version: 2.0)

Here's what I did to get Neverwinter Nights 2 installed and running on my computer. This is mostly a clarification of the info found in the comments section of the WineHQ AppDB, so…. love to those commenters!

I have been able to install and play the game with varying degrees of success since wine v0.9.38. The latest version I have used is 0.9.51 on Gentoo Linux.

Ingredients

  • devenum.dll, dxdiagn.dll, and d3dx9_30.dll
    Get the latest DirectX 9 Redistributable package from FileForum and extract them with cabextract (instructions below).
  • imm32.dll
    Find this on an existing Windows install or extract it from a Windows XP CD with cabextract (instructions below, too).

Gathering your DLL Files

DirectX Files

Copy the DirectX Redist package to a temp directory and extract its contents like so:

cabextract directx_nov2007_redist.exe

This will spit out a bunch of .cab files (and a few other files). You'll next want to get the needed DLLs from that mess:

cabextract -F devenum.dll *.cab
cabextract -F dxdiagn.dll *.cab
cabextract -F d3dx9_30.dll *.cab

Copy these files by name to a safe location. There are other DLL files in the directory, so you don't want to copy *.dll or anything like that.

imm32.dll

You could get a copy of imm32.dll from an existing Windows XP computer, or you could break out an XP CD and get a copy from there, like so (assuming your CDs mount to /mnt/cdrom):

cabextract /mnt/cdrom/i386/IMM32.DL_

This should put imm32.dll in your current directory. Put it in your safe location with the DirectX DLLs.

What about microsoft.vc80.crt.zip?

Oh yeah, unzip it into your safe location with the DirectX DLLs and imm32.dll. We'll use all that stuff a little later.

Preparing the .wine directory

Remove Existing .wine directory

NWN2 should be installed into its own, separate wine environment. This means you should rename or delete any existing .wine directory you might have. Don't worry, later on, I'll show you how to move the NWN2 install somewhere safe, while still being able to play it.

Create and Configure a New .wine Directory

Run winecfg and configure the following settings:

  • Applications tab: Change the Windows version to Windows XP
  • Libraries tab: Add overrides for devenum.dll and dxdiagn.dll
  • Graphics tab: Flag “Emulate a virtual desktop” and set Desktop size to 1024 x 768 (or something appropriate).
    • NOTE: This is probably optional and a matter of personal preference. I have a problem where Xfce4's toolbars appear on top of full screen programs, so I just play in a window. YMMV.
  • Audio tab: Click OK on the message that pops up, then click the Apply button.
  • Click the OK button to exit winecfg

Configure Registry Settings

Run regedit (yes, just type it in your xterm or whatnot) and add the following key and string values:

[HKEY_CURRENT_USER\Software\Wine\Direct3D]
OffscreenRenderingMode = fbo
PixelShaderMode = enabled
UseGLSL = enabled
VideoMemorySize = 256

Copy devenum.dll and dxdiagn.dll

Now, cp (don't mv, you'll need them again) devenum.dll and dxdiagn.dll to ~/.wine/drive_c/windows/system32/.

The Tender Act of Installing

Put in your NWN2 DVD, change to its directory, and start the installation with the command:

wine setup.exe

Perform the installation normally.

NOTES ON THIS STEP:

  • If you are having trouble entering your CD key, click in the box that says “Please enter your CD key below”, then click in the first key entry box and start typing.
  • Installing .NET will fail. That's OK. Just follow along with the installer until it does, then continue.
  • You may get errors about DirectX not being installed correctly. That's OK, too.
  • I didn't try installing Xfire. Why complicate things?

Not So Fast Mister...

… we're not done yet.

Remember that safe location that you copied the DirectX DLLs, imm32.dll, and the contents of microsoft.vc80.crt.zip? Well copy all that stuff into your newly installed Neverwinter nights 2 directory, usually:

~/.wine/drive_c/Program Files/Atari/Neverwinter Nights 2/

(NOTE: Yes, do overwrite Microsoft.VC80.CRT.manifest.)

Expansion Pack

At this point, you may install the Mask of the Betrayer expansion pack. Just pop the DVD in and run from its root:

wine setup.exe

Nothing special has to be done with this install.

Patching

So far, most of the official patches have not broken anything with regards to running the game under wine. I'm sure that was quite by accident. You should patch whenever possible, but be aware, you will need the NOCD patch for the version you are upgrading to! So, I guess I should have said, “patch as soon as you have the NOCD patch for the new version”.

After a fresh install of NWN2, you will have version 1.00.788 of the game. If you've installed Mask of the Betrayer, your game will have been upgraded to v1.10.1115.

Patch and Patch and Patch and...

Copy all the game patch files (nwn2_pc_english_*.zip) to the NWN2 directory. From within that directory, run:

wine NWN2Launcher.exe

Click the Update button and perform an update. You will get errors about the updater not being able to check for new version. Ignore. After one update finishes, you will have to exit back to the main NWN2 menu and click the Update button again. Keep doing this until there are no more updates found. You may then exit from NWN2Launcher.exe.

While still in the NWN2 directory, rename nwn2main.exe to nwn2main.exe.bak, and nwn2main_amdxp.exe to nwn2main_amdxp.exe.bak. Unzip the NOCD patch (containing the patched nwn2main.exe and nwn2main_amdxp.exe) there.

Play

Launch the game with the command:

wine nwn2main.exe

If all goes well, Yay!

Tweaks

  • Some have said you should turn OFF shadows and turn ON bloom in the game's graphics control panel.
  • For me, exporting WINEDEBUG=-all makes a positive difference in how the game runs.

Protecting the NWN2 Install

NOTE: This is optional but HIGHLY recommended.

As I said earlier, NWN2 needs to be in its own, pristine wine environment. Once I'm sure everything is (more-or-less) working, I like to rename ~/.wine to ~/nwn2 then make a script like the following, called nwn2. Put in somewhere in path (like ~/bin) to launch the game:

#!/usr/bin/env bash

cd ${HOME}/nwn2/drive_c/Program\ Files/Atari/Neverwinter\ Nights\ 2

export WINEDEBUG=-all
export WINEPREFIX=${HOME}/nwn2

wine nwn2main.exe &

Along with that, make this script (called nwn2wine):

#!/usr/bin/env bash

export WINEDEBUG=-all
export WINEPREFIX=${HOME}/nwn2

wine ${*} &

This second script makes it easier to run winecfg, regedit, other any other Wine/Windows commands on your NWN2 environment, should you need to:

nwn2wine winecfg
nwn2wine regedit
 
nwn2/wine.txt · Last modified: 2007/12/23 11:47 by humanzoo
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki