Talk:Running the game

From Guild Wars Wiki
Jump to navigationJump to search

Vista-file-manager.png
Archive


Launching more than one client on a single PC[edit]

Historically it was not very easy to run two or more Guild Wars clients on a single PC. First, this requires to make the copies of Guild Wars installation directory in different directories or on different drives. Before launching a new client user had to modify the Registry data containing the directory path and close the GW mutex (a string in the OS memory) which indicates the running client. To do this, some players used the third-party multi-launch programs, however, this might require to give the user IDs (name, password) and control of the client to a third party, which is against EULA. Another way without third party was in manual changing of the Registry data and closing the mutex using the Sysinternals utility Process Explorer. This didn't contradict the EULA, but was tricky and required a lot of attention.

Since about 2016 the client no longer uses the Registry data (this change hasn't been documented). I looked for a way to close the mutex by a simple script. Instead of Process Explorer, such script runs the command-line utility Handle (handle.exe or its 64-bit counterpart handle64.exe). It can be downloaded from the Windows Sysinternals website https://www.sysinternals.com, Process Utilities.

The script gwmutex.js is written in JScript. Due to Handle's restrictions, it requires the administrative privileges delivered via additional command file GW_ADM.cmd, which should be "Run as administrator" in the right-click menu ("ADM" in the name is a reminder). The script launches the Handle utility, which looks for Guild Wars mutex and saves the result to a file gwmutex.txt. Reading this file and parsing it gives the PID (decimal) and ID (hexadecimal) values, which are used to close the mutex by Handle. This script does not keep anything in the memory and does not affect the client's private data.


Command file: GW_ADM.cmd

@setlocal enableextensions
@cd /d "%~dp0"
@start /min /b wscript gwmutex.js

Script file: gwmutex.js

var WSHShell = WScript.CreateObject("WScript.Shell");
var str, fso, f, si, pid, id, err;
var exe = "handle64.exe";

// get mutex info to file
str = "cmd /c " + exe + ' -a "AN-Mutex-Window-Guild Wars" > gwmutex.txt';
WSHShell.Run(str, 0, true);

// read file
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile("gwmutex.txt");
str = f.ReadLine();
f.Close();

// read PID, mutex handle id
if (str.indexOf("pid:") == -1)
	WSHShell.Popup("Guild Wars mutex is not found", 0, "Warning", 0);
else {
si = str.substring(str.indexOf("pid:") + 4, str.lastIndexOf(":"));
pid = parseInt(si);
id = si.substring(si.lastIndexOf(" ") + 1);

// close mutex
str = exe + " -p " + pid + " -c " + id + " -y";
// show command line (test only)
// WSHShell.Popup(str, 0, "Command", 0);
err = WSHShell.Run(str, 0, true);
if (err == 0)
	str = "Guild Wars mutex is closed";
else	str = "Guild Wars mutex is not closed, error code  " + err;
WSHShell.Popup(str, 0, "Info", 0);
}

Usage

Copy the codes of command and script to Notepad and save them (make sure that extensions are not *.txt). Place 3 files: GW_ADM.cmd, gwmutex.js and handle64.exe (or handle.exe on 32-bit OS, also change the name in the begin of the script) somewhere in your Documents directory: the folder with screens and templates ...\My Documents\Guild Wars\ is a good choice.

Launch the first Guild Wars client as usual, then run GW_ADM.cmd as administrator. You should see the message that GW mutex is closed. If it does not happen, you will see an error message. Error code 6 means that the script was run by normal user, not administrator.

After closing the mutex you may launch the second client from another Guild Wars directory or another drive using another account.

This script with small modifications can be used for launching other programs. For example, you can use it to close the mutex AN-Mutex-Window-Guild Wars 2 if you want to launch the second GW2 client. However, you also need to properly refer to the account-related files Local.dat in the Documents and AppData directories, but it's beyond this Wiki.

Happy Holidays and good playing! --109.252.109.37 20:28, 30 December 2018 (UTC)

An update on Guild Wars technology and Windows XP[edit]

By Stephen Clarke-Willson, Game Director, Guild Wars

Hello fellow Tyrians! When Guild Wars launched in 2005 it ran on Windows 95, Window 98, Windows 98 SE, Windows ME, Windows 2000, and Windows XP. In 2012 we had to drop support for the 16-bit versions of those operating systems in order to deploy new security features.

In early 2019, we started the process of changing the build system for Guild Wars from Visual C++ 6.0 (which was released in 1997) to use Visual Studio 2017. We released that upgrade in late 2019 while still maintaining compatibility with Windows 2000 and Windows XP, our current min-spec machines. Thanks to that compiler update we have been able to build, test and deploy more updates than we were previously able to do with the VC6 compiler.

The 20-year compiler upgrade was a dramatic change; in those 20 years the way the C++ language treated floating point numbers had changed. We tracked down almost all of the arithmetic errors that related to those changes. For those more technically minded the bugs had to do with the way infinity is handled.

I said we tracked down almost all of the crashes – but there was one significant one that we didn’t detect before we released the build into the wild. The bug was most evident in the Domain of Anguish – which is content we mere programmers would never be able to solo and fully test (even with cheats on the development branch – I tried). I want to thank the players who sent us videos that helped us identify the problem. The bug had to do with projectiles colliding with the terrain at just the right angle. I’m happy to say that with the new compiler we were able to debug and fix that bug in two days with very little disruption to the main game and no downtime.

As you know, Microsoft has officially stopped supporting older versions of Windows; we are however grateful that they have managed to maintain tools and compiler support for those operating systems long past their official expiration date. Visual Studio 2017 is the last compiler from Microsoft that supports Windows XP. The other systems that Guild Wars interacts with (the “login servers”) are now built with Visual Studio 2019. It is only a matter of time before we will be building Guild Wars with Visual Studio 2019 and future compilers. So as of January 1st, 2021, we will no longer provide official support for Windows XP or Windows 2000. While the game may continue to run on those operating systems we will stop internal testing on that date. Stephen Clarke-Willson (talk) 17:24, 10 November 2020 (UTC)

Thanks for this update! I’ve copied this over to Feedback:Developer updates/20201109, so we can reuse the developer updates for posts like these. Feel free to post new stuff there, similar to how the game updates work. poke | talk 17:34, 10 November 2020 (UTC)