(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.
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.
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.
Oh yeah, unzip it into your safe location with the DirectX DLLs and imm32.dll. We'll use all that stuff a little later.
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.
Run winecfg and configure the following 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
Now, cp (don't mv, you'll need them again) devenum.dll and dxdiagn.dll to ~/.wine/drive_c/windows/system32/.
Put in your NWN2 DVD, change to its directory, and start the installation with the command:
wine setup.exe
Perform the installation normally.
… 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.)
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.
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.
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.
Launch the game with the command:
wine nwn2main.exe
If all goes well, Yay!
WINEDEBUG=-all makes a positive difference in how the game runs.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