Author Topic: Running a demo from any folder  (Read 2644 times)

Floride

  • Elite Boss
  • *****
  • Posts: 863
  • Badgehunter Extraordinaire
Running a demo from any folder
« on: May 01, 2013, 11:54:30 PM »
There must be a registry key that always redirects the game to the client_demos folder. With a copy of the game client not technically installed, I can run demos from any folder, including my backup drive.

This is what I did (running Windows XP):
I uninstalled the NCsoft launcher back in December with extreme vigor and malice, but did not uninstall the game client.
Then, because I don't have a CoH install disk,  I backed up the game by copying the entire NCSoft folder (C:\Program Files\NCSoft) to an external backup drive (just i23, I never had i24).
Then, recently, I did a clean install of Windows XP (new format, partition, 6 hours of Windows Updates, the works).
Then I copied the NCSoft folder from my backup drive and pasted it into C:\Program Files.
Since the game is not technically "installed" according to Windows, I can't run Icon or a demolaunching program because they look for registry keys. So I created a drop-and-play desktop shortcut.
(For those who don't know what that is, in XP you rightclick on cityofheroes.exe and send to desktop as shortcut, rightclick the new shortcut, go to Properties>Shortcut>Target and added -project CoH -demoplay to the end of the Target field, which allows you to just drag and drop any demo from client_demos to the desktop shortcut and launch it)
My shortcut's Target field looks exactly like this, quotes and all:
Code: [Select]
"C:\Program Files\NCSoft\City of Heroes\cityofheroes.exe" -project "coh" -demoplayNow, out of habit, I've been only saving demos to the client_demos folder. But yesterday I accidentally saved a demo to my desktop. Just for giggles (and expecting an error message from the client) I dragged the demo from the desktop to the shortcut and it launched!
To check if this was for real, I have cut (not copied) and pasted demos from client_demos to my desktop, and every one of them ran from the desktop. I even renamed them with gibberish like oiuibfyutopiuu.cohdemo and they all still launched.

But I must add that I don't know if this alone is what caused it. I also recently tried something just to see what would happen (famous last words!) and I made a shortcut to cityofheroes.exe and added added to the Target field:
-project CoH -launcher -setregion NA -setlocale 1033 -auth 64.25.36.88
BTW, I found this in a file called addcache.xml in the City of Heroes folder and wanted to see what it would do. Interestingly, It let me login to the game, click the EULA, and got me to the server select screen with the only server available named "UNNAMED".
Weird.

Anyhow, I'm living proof of the danger of a little bit of knowledge, but occasionally serendipity presides.

History shows again and again
How nature points out the folly of men

Hotaru

  • Lieutenant
  • ***
  • Posts: 77
  • Just a demo-loving fool in the Far East...
Re: Running a demo from any folder
« Reply #1 on: May 02, 2013, 09:00:35 AM »
Drag-n-drop to the shortcut is the only way to go, in my opinion. It lets me throw my demos into subfolders (20-30 Hero alignment missions, etc), I don't have to worry about duplicate names if I download a zip of someone else's demos, and I can rename my demos to something more comprehensible--with spaces!

Aggelakis

  • Elite Boss
  • *****
  • Posts: 3,001
Re: Running a demo from any folder
« Reply #2 on: May 02, 2013, 10:24:39 AM »
Now, out of habit, I've been only saving demos to the client_demos folder. But yesterday I accidentally saved a demo to my desktop. Just for giggles (and expecting an error message from the client) I dragged the demo from the desktop to the shortcut and it launched!
To check if this was for real, I have cut (not copied) and pasted demos from client_demos to my desktop, and every one of them ran from the desktop. I even renamed them with gibberish like oiuibfyutopiuu.cohdemo and they all still launched.
That's because your desktop is a folder within Windows Explorer. There's just an extra graphical interface they called the desktop.

(Removed the excessive coloration because it was boggling my brain.)
Bob Dole!! Bob Dole. Bob Dole! Bob Dole. Bob Dole. Bob Dole... Bob Dole... Bob... Dole...... Bob...


ParagonWiki
OuroPortal

Floride

  • Elite Boss
  • *****
  • Posts: 863
  • Badgehunter Extraordinaire
Re: Running a demo from any folder
« Reply #3 on: May 04, 2013, 11:00:59 AM »
I was under the impression that demos had to be in the client_demos folder to run. Thought I discovered something new. Ahh well...
History shows again and again
How nature points out the folly of men

The Fifth Horseman

  • Elite Boss
  • *****
  • Posts: 961
  • Outside known realities.
Re: Running a demo from any folder
« Reply #4 on: May 04, 2013, 11:04:02 PM »
Was known for a while. The only real hurdle my CoXLauncher app was supposed to overcome is that cityofheroes.exe always tries to find its' data files in a path relative to the current working directory.
If you want, I can strip it down to assuming it launches from the same directory as cityofheroes.exe is located in, that would essentially reduce everything to:
Code: [Select]
                string demo = args[0];
                for (int i = 1; i < args.Length; i++)
                    demo += " " + args[i];
                string CoHdir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
                ProcessStartInfo _processStartInfo = new ProcessStartInfo();
                _processStartInfo.WorkingDirectory = @CoHdir;
                _processStartInfo.FileName = @"cityofheroes.exe";
                _processStartInfo.Arguments = "-demoplay \"" + demo + "\" -project CoHBeta -launcher -setregion EU -setlocale 1033 -auth 0.0.0.0";
                Process myProcess = Process.Start(_processStartInfo);
We were heroes. We were villains. At the end of the world we all fought as one. It's what we did that defines us.
The end occurred pretty much as we predicted: all servers redlining until midnight... and then no servers to go around.

Somewhere beyond time and space, if you look hard you might find a flash of silver trailing crimson: a lone lost Spartan on his way home.