RSS

Get DragonAge Origins Toolset on 64-bit Windows 7, Steam, and SQL Express 2008

04 Mar
With the latest installment of the DragonAge series shipping soon (only 4 days from now… *wibble*), a resurgence of interest in Origins has gripped me. I’ve bee whiling away the odd hour here or there playing through the campaign again, with little hope that I’ll finish it this time either. There’s just so much to do and that’s without all the weight downloadable content (DLC) of the epic Awakenings or the character-specific adventures that have rolled out since then. But I digress…
a
I wanted to mess around with the Toolset again (which allows you to craft your own adventures if you’re willing to invest a lot of time, or to just poke around under the hood and see how BioWare crafted Origins) but as I was running the installer I realized that it wanted to install SQL Express 2005. 2005? That’s a bit out-dated, don’t you think? After all, I’ve already got a SQL Express engine running on my box to support my independent development inititatives with Microsoft Visual Studio 2010. Why on earth should I install another copy of SQL Server?
a
I knew from my own professional experience that SQL 2008 and 2005 are largely compatible for most databases (and 2008 even has a 2005-compatability mode you can set should things go awry…), I thought “why not see if we can make this work with what i’ve got already?” So, I ran a few web queries to make sure I wasn’t setting out on a fool’s errand, and I ran across this wonderful blog post by a bloke named Evan. Evan probably saved me and others hours of time with those steps, but they didn’t quite work for me. Why, you ask? Well, it comes down to the fact that once again, he wants me to use SQL Express 2005. I figured “meh, skip that step, i’ve got 2008 installed…” and just tried to install the 64-bit SQL Server Management Studio (SSMS) Express package. No luck. For reasons unclear to me, it rolls itself back 75% of the way through the install claiming that it was “interrupted.” After trying twice in a row, I gave up on that and decided to use ply my sqlcmd-fu (that’s the special variant of kung fu SQL Server db admins are taught by the wisened sages of their art) and bend things to my will.
a
Sadly, his proffered advice about using SQL scripts he linked to was rather full of fail. While it gave me some (most? all?) of the DB schema, it didn’t give me nearly enough of the data. I kept getting errors about missing IDs and and other inaccessible data from the toolkit after running his scripts.  But a comment on the letter gave me exactly what I needed: the fact that BioWare shipped a full backup of the database with the toolkit. Well, of course they did. How much easier can installing a database get than to use restore a database backup (.bak) and call it a day?
a
The path to success for Win7 amd64, Steam, and SQL 2008 Express is as follows:
a
Prerequisites
  1. SQL Server is installed, running, and responding to your queries. E.g: running:  sqlcmd -S .\SQLEXPRESS -q “select @@version” from a command/powershell prompt will yield:
    Microsoft SQL Server 2008 (SP2) – 10.0.4000.0 (X64)
    Sep 16 2010 19:43:16
    Copyright (c) 1988-2008 Microsoft Corporation
    Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )
  2. You’ve got Dragon Age: Origins installed and you know where it lives. For example, my copy lives in ‘D:\Games\Steam\steamapps\common\dragon age origins\
  3. You’ve installed the Dragon Age Origins Toolset, but opted NOT to install the included 32-bit version of SQL Server 2005 Express.
SQLCMD to the rescue!
  1. Once you install the toolkit, you’ll find they’ve included the aforementioned SQL database backup file (bw_dragonage_content.bak) for you. For steam users, it resides in the tools\dbbak subfolder of your dragon age installation. Go search your computer for it and get a hold of the full path to that file. You’ll need it shortly.
  2. We’ll need to issue several commands to SQL Server, and we’ll use a console application called SQLCMD to do it. So open up an elevated command prompt or powershell prompt and execute the following command to connect to your local copy of SQL Server Express:
  3. SQLCMD -S .\SQLEXPRESS
  4. Now, every database backup has a designated place in the file system where its data (files that usually end in .mdf) and possibly logs (files that end in .ldf) are stored. Most database restores assume that the files you’re restoring from the .bak should go back to where they were found originally, so we’re going to roll with that assumption. First, we need to see where those files are expected to be, without actually restoring anything. To do this, we’ll use a mode of the SQL “RESTORE” command called “FILELISTONLY” to get the logical and physical names of the mdf and ldf in the backup file:
  5. RESTORE FILELISTONLY FROM DISK = ‘D:\Games\Steam\steamapps\common\dragon age origins\tools\dbbak\bw_dragonage_content.bak’
    GO
  6. You should see near the end the logical and physical filenames of the .mdf and .ldf in the file (after of a bunch of staggered “—–” characters … this is the pretty-printing that would make the data look like a table were your console window wide enough, or were you to output the query results to a text file), e.g.:
  7. bw_dragonage_content C:\Program Files\DAODB\Data\bw_dragonage_content.mdf
    bw_dragonage_content_log C:\Program Files\DAODB\Data\bw_dragonage_content.ldf
  8. The name without the path is the “logical” name. The fully-pathed file is… you guessed it, the filename. Once you are armed with these, you need to make sure the physical path this .bak file will expect actually exists. Since we’re running a 64-bit version of windows, chances are high that the Toolset installer created the “\DAODB\Data” folder in your Program Files (x86) folder (where all good little 32-bit programs go), not your Program Files folder (which houses the 64-bit ones). Fixing this is a simple matter of cutting and pasting the “DAODB” folder from your Program Files (x86) folder and pasting it in the Program Files folder. Once the folder C:\Program Files\DAODB\Data exists in your local filesystem, you’re golden. Use Windows Explorer to do this — far simpler and faster than aborting your SQLCMD session and then re-starting it later.
  9. Now we have to create the database so the backup will have a place to be restored to! Run these commands in your SQLCMD session (the color-coding is provided so you can visually map the values you got from FILELISTONLY above. If for some odd reason these have changed, you’ll know where to put the new values):
  10. USE master;
    GO
    CREATE DATABASE bw_dragonage_content
    ON PRIMARY
    ( NAME = bw_dragonage_content, FILENAME = ‘C:\Program Files\DAODB\Data\bw_dragonage_content.mdf‘)
    LOG ON
    ( NAME = bw_dragonage_content_log, FILENAME = ‘C:\Program Files\DAODB\Data\bw_dragonage_content.ldf);
    GO
  11. You probably won’t get anything by way of a success message, but if you don’t get an error, you should be good to go.
  12. Now all we have to do is restore their database backup! Tweak the paths to match your system and then run this in your SQLCMD session:
  13. RESTORE DATABASE bw_dragonage_content FROM DISK = ‘D:\Games\Steam\steamapps\common\dragon age origins\tools\dbbak\bw_dragonage_content.bak’ WITH REPLACE,RECOVERY
  14. This will take some time and you’ll see some output, and probably a few ‘upgrade schema’ comments, but at the end of it all you will have successfully created the database!
  15. That’s it for DB creation! Exit SQLCMD by typing:
  16. EXIT

  17. All that remains is to tell the Dragon Age Toolset how to find the database. (If you don’t, you’ll get an error that says it can’t connect. If you’re wondering why, it’s because when the Toolset installs itself, it installs a “named instance” of SQLEXPRESS that isn’t “SQLEXPRESS”that is To do this, run the “ConfigureToolset.exe” that is located in the tools directory (the parent folder of the ‘dbbak’ folder that houses the .bak file).
  18. It will open to the ‘Game Builds’ menu. That’s not what we want. Click [Next] to find the ‘Databases’ window. Once there, uncheck ‘Use the default database’ and then click the [...] button. This will open the standard ‘Data Link Properties’ window that every Windows database admin knows and loves. Here, you will want to specify “.\SQLEXPRESS” for your server in #1, leave #2 alone (it should default to ‘Use Windows NT Integrated security’), and for #3, select the bw_dragonage_content database we just restored. Lastly, click [Test Connection] at the bottom and assuming all went well, you’re done!
  19. What your settings should look like when you're done...

  20. Click [OK], then click [Next] in the ConfigureToolset UI, and lastly click [Finish].
  21. Now you should be able to use the Toolset to your heart’s content on Windows 7 64-bit with SQL Server 2008. Yay!
Caveat: I haven’t done extensive testing so I can’t vouch that running the Toolset on 2008 won’t cause some problems down the line. I’m a total n00b when it comes to the Toolset itself… I just happen to know a thing or two about Windows and SQL. ;-)
Afterthought: More advanced / picky users might want to relocate the files from the DAODB directory to somewhere else. in that case you’ll want to create the DB with different filename specifications, and then restore with the MOVE directive as such:
RESTORE DATABASE bw_dragonage_content FROM DISK = ‘D:\Games\Steam\steamapps\common\dragon age origins\tools\dbbak\bw_dragonage_content.bak’ WITH REPLACE,RECOVERY,MOVE ‘bw_dragonage_content’ TO ‘[preffered path]\bw_dragonage_content.mdf’ , MOVE ‘bw_dragonage_content_log’ TO ‘[preferred_path]\bw_dragonage_content_log.ldf’
Happy modding!
About these ads
 
9 Comments

Posted by on March 4, 2011 in Computational Engines, Things Geeky

 

Tags: ,

9 responses to “Get DragonAge Origins Toolset on 64-bit Windows 7, Steam, and SQL Express 2008

  1. Xax

    July 20, 2011 at 06:56

    Hi there,

    I’ve been searching a long time before finding your post.
    It’s works perfectly!!

    Muchas gracias!

    Xax

     
    • jer

      July 21, 2011 at 08:28

      Glad it helped, Xax!

       
  2. Kay

    August 3, 2011 at 06:18

    Weird i cant find the elevated command prompt or powershell prompt anywhere

     
    • jer

      August 3, 2011 at 06:43

      Elevation only applies in Windows Vista and higher. Powershell was optional in Vista, but comes built-in with Windows 7.

      For information on how to start an elevated command prompt, go here:

      http://www.sevenforums.com/tutorials/783-elevated-command-prompt.html

      The same techniques apply to elevate a Powershell prompt. Since I’m not doing anything Powershell-specific in the above steps, I recommend just using the elevated command prompt.

       
  3. Darksaber

    November 23, 2011 at 02:29

    YOU ARE THE MAN!!!

     
    • jer

      August 20, 2012 at 16:42

      I do what I can. =^)

       
  4. Guido

    March 9, 2013 at 19:14

    Thanks alot for this . helped me out bigtime … since i only had issues with sql server 2005…

     
  5. A very happy person

    January 21, 2014 at 07:01

    I know I’m necro-commenting, but 1) this worked swimmingly, but 2) is something I’m posting for anyone else who Googles their way here: I did have to modify the permissions on that Data directory for sqlcmd to be able to write there. (This is Win7 Pro.) Makes sense because Windows is more picky now about what it permits to write to the Program Files directories, and once I did that, everything worked as it should.

     
    • jer

      January 21, 2014 at 10:12

      Thanks, very happy person. :)

       

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: