clarifications for v1.81

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

nikos wrote:...that's the million dollar question, where is the english dll? there isn't any, so you have to make one. There is no point me supplying one because you need a new one every time there's a new version out
As every man must brave the razor's edge at least once in his life and get a proper shave with a Cut-Throat Blade (not one of those stupid plastic things), so it comes that one must do things the hard way.

For those who want a proper x2 English dll to call their own and corrupt with wild abandon, and yet do NOT wish to go through the rigmarole of installing Visual Studio just to do this, here is a simple step by step.

First, you need a copy of ResHacker.  If you are using the x64 version of x2, be sure to download the beta version of ResHacker as it allows extraction of x64 resources.

You're also going to need a copy of your xplorer2.exe file, and one of the pre-made translation DLL's - the easiest way of getting one is just to re-install x2 selecting "Greek" (or something) as the language.  It will start up in Greek (obviously), but this is not important - we're going to be using the command line for this.  Now, shut up you complainers in the back!  If you're man enough to hack resources, you're man enough to use the command line.  (Remember, this is about shaving with a blade, after all. :D)

Now, I'm going to simplify the command line references by just giving you the basics - it's up to you to sort out the filepaths for yourself, as there are many combinations depending on where you installed things.  For simplicity you can just copy your explorer2.exe and the x2t_greek.dll into your ResHacker folder and open a command line from there - the end result is the same.  Just like a Clint Eastwood western, two files go in, only one file is coming back out. :wink:

This is actually fairly simple - three commands will do it, but keep in mind that they will look a little weird.  Be sure to copy the syntax exactly as I have it here.  I mean it.  If you don't, bad men will come in the night and steal you away.  Don't say I didn't warn you.

Command the First: reshacker -delete x2t_greek.dll, x2t_Blank.dll,,,

Notice there are 4 commas on the line.  These are very important for ResHacker's command syntax, so be sure you keep them in place.  This command just takes the Greek resources (which we don't want) and removes them from the dll, leaving a 1.5 Kb file called "Blank.dll" in the folder.  Simple.

Command the Second: reshacker -extract xplorer2_64.exe, Goombah.res,,,

Yes, more commas.  If you look at them in the right way, they kind of smile back at you so it's ok. :D  Anyway, this command copies the English resources from x2 into a compiled resource file (.RES) called Goombah.res, just because that's just the kind of guy I imagine Nikos to be.  :wink:  The new file should be 211.5 Kb in size.

Command the Third: reshacker -add x2t_Blank.dll, x2t_English.dll, Goombah.res,,,

Ooh look! 5 commas that time.  Very impressive.  Anyway, as you might imagine this just takes the compiled resources from our favourite goombah and adds them to the empty dll we made earlier, creating a new file called x2t_English.dll which should be 216 Kb in size.  Now, as Nikos pointed out above, this file can be called whatever you want, as long as it starts with x2t_ and ends with .dll, so use your imagination.  Go on, humour me.  Use something like x2t_Zorba_the_Castrated.dll just to watch the fish in the sea quiver with joy.  Again, remember the razor blades. :twisted:

So, there you go.  Be sure to remove the x2t_greek.dll from the x2 installation folder, and copy the new x2t_English.dll one into it.  Considering that the whole point of this exercise is to rape and pillage that new little innocent file, I suggest you make a backup of it, so you can always start clean again in the morning, your sins washed away like some Bacchanalian rhapsody gone awfully awry, but in a nice way.  Remember that.  Always in a nice way.  It never hurts to wink at the pretty girl in the corner shop, even though you know she's living a terrible dead end trip to nowhere.  Suggest to her one day that she move to a garret in Paris and learn to paint.  You could change the world by doing that. :wink:  (You know she won't, of course, but even the hopeless can dream of spiritual emancipation.)

The irony here, of course, is that all we did was create a duplicate of x2's English resources, so you won't see any difference when you run it again. :sad:  You have to use ResHacker to go into that DLL and change everything to the way you think it all should be, and of course, only you can be the judge of that.

The reason I gave all these instructions to do it yourself (instead of providing a handy download for the quick and the dirty) is that as Nikos said above, you will need to have a new English dll for every release - this way you can make it yourself with a minimum of trouble.  The commands could easily be made into a batch file to copy/change/move the necessaries so it's all simplified to one click.  (With ResHacker scripting the modification of x2t_English.dll can also be simplified to one click for forthcoming releases, you just have to use your imagination.)

So I leave it up your good selves to form the future and undermine Nikos' design mentality. :D
  • The Shankill Butchers run tonight
    You better shut your windows tight
    They're sharpening their cleavers and their knives
    And taking all their whiskey by the pint

    And everybody knows if you don't
    Mind your mother's words
    A wicked wind will blow
    Your ribbons from your curls
    Everybody moan, everybody shake
    The Shankill Butchers want to catch you awake

    -- The Decemberists
P.S. otlaolap, the link I provided for ResHacker above has a simple introduction of the format to use when making RS scripts - you will have to pay very close attention to the syntax (like the commands above) and be sure to read the created logs to make sure it's doing what you think it should be doing.  It takes a bit of getting used to, but it does make auto-modding easier once you've done the hard work.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Ok, now that we've done the hard work of getting a resource dll to play with, it struck me that technically we only need to keep an "empty" container for updating future versions of x2 with our modded resources.  As we've already created that Empty container in the first step above, everything else (and I mean everything else) can be completely automated. :D

Edit (19-Dec-2010): This post originally went on to describe a script I made in detail to carry over the ideas above.  As the script grew into more of a utility-thing, I moved it over to this thread, which seemed more suitable for the subject.
Last edited by Kilmatead on 2010 Dec 19, 15:26, edited 1 time in total.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

8) :thumbup: :D
User avatar
snakebyte
Gold Member
Gold Member
Posts: 430
Joined: 2003 May 07, 07:14
Location: Seattle
Contact:

Post by snakebyte »

Great job Kilmatead!! :ok:  I will definitely give this a try.
Help! I'm an AI running around in someone's universe simulator.
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Post by dunno »

Does this mean that if I do a clean install with the latest version of X2 that my treasured custom script for overwriting/replacing folders won't work ?.

Please say it isn't so...
User avatar
nikos
Site Admin
Site Admin
Posts: 15800
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

isn't it simpler to use a resource editor in the upright way? There are many free around outside VS
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Post by dunno »

nikos wrote:isn't it simpler to use a resource editor in the upright way?
I have no idea what you mean with that statement.

What I can glean from that statement is that I won't be able to use my script with the new version of X2 which required several months of research, and the kind generosity of time and patience of some X2 forum members to get it to work.

Well, it looks like I won't be installing any newer versions of X2, this after having paid for lifetime upgrades. There's a lesson here, somewhere...
Last edited by dunno on 2010 Dec 12, 09:11, edited 1 time in total.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

dunno wrote:Does this mean that if I do a clean install with the latest version of X2 that my treasured custom script for overwriting/replacing folders won't work?
Of course it will work - why wouldn't it (unless Mr. Pleasant is actually Mugabe's nom de plume, as we all suspect it is anyway :D)?  The type of customisation this thread is talking about is for changing x2's interface for usability - not about changing x2's basic functionality.

Your script will be fine.
nikos wrote:isn't it simpler to use a resource editor in the upright way?
First of all, a resource editor is like a woman - you have to treat them... oh, what would you know, you're married anyway. :D
I actually own the full version of VS '08 (academic license), and at the time I had toyed with the idea of re-teaching myself the intricacies of C and the like, but never quite "got around to it yet."  Installing VS is what I'm talking about - on a x64 system there always seems to be something that "isn't quite right"... either .NET is fumbled in a basic way (causing carryover into the system) or all the SQL crap it installs without asking just seems to have an attitude problem with me. :shrug:

Every time I install it, I think "ok, it'll be better now, updates and SP's will have fixed it"... but no, it still gives me that creepy look in the mornings.

Whereas ResHacker is all of 4 significant files in 2 MB.  You do the maths.

And besides, I found a novel use for your %X2DIR% variable, didn't I?  Why else is it there?
pj
Gold Member
Gold Member
Posts: 477
Joined: 2006 Jan 26, 14:01
Location: Florida

Post by pj »

Kilmatead wrote:... the script uses the X2DIR environmental variable to get the install folder...
This environment variable only exists in command environments spawned from within X2. It isn't defined from system level cmd environments (e.g. running cmd from Start > Run). At least that is the case for my system running XP+SP3 and X2 1.8.0.19 (though probably running 1.81 by day's end).

Perhaps add an additional variable definition at the top of the file such as:

Code: Select all

x2_Install = "C:\Program Files\zabkat\xplorer2"

==================
PJ in (blustery) FL
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Well, ok, can't argue with that... however I never planned on running it outside of x2 demesnes - usually I just navigated to the folder it was in using x2 and ran it from there (given that it's bright enough to know to kill x2 processes first).

I used the variable simply because you never know who's using x64 or not, and non-default install folders, and tried to keep the "need to modify the script before it works" to a minimum - i.e., locating ResHacker, as that could be bloody anywhere.

I started out with that simple x2_Install definition, but then one day I changed my installation folder and forgot to change the pointer.  I hate manual transmissions, so I tried to automate it.  Not a perfect system. :shrug:

I have since taken a leaf from Snakebyte's tree and just made a new menu for it anyway...

Image

I suppose it wouldn't hurt to do a couple of simple "if .FileExists()" checks on x2 and ResHacker, just to make sure they're available before anything exciting happens.

I would actually expect more complaints from people who say "now I have to save all my dialogs as individual RES files? What a pain." :D
pj
Gold Member
Gold Member
Posts: 477
Joined: 2006 Jan 26, 14:01
Location: Florida

Post by pj »

Kilmatead wrote:... usually I just navigated to the folder it was in using x2 and ran it from there (given that it's bright enough to know to kill x2 processes first...
Sorry for my ignorance. I guess I read too many Greek tragedies where the child dies or suffers horribly after killing the parent. I didn't expect a spawned process would survive killing the spawning process, but I have to admit I didn't look closely at your script to see that was exactly what you did.

All in all, very masterful bit of work to allow user preferences. Something to work on over the holidays while the SO goes off to work and I bide my time until my project restarts next year...

==============
PJ in (sunny and cool) FL
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

pj wrote:I didn't expect a spawned process would survive killing the spawning process
Patricide, Matricide, and Suicide are all viable means to an end when you're a vengeful sub-process, or an aspiring Roman scion with a foolhardy sense of romantic destiny.  VBS is a little too forgiving for its own good at times, but I'm not arguing.  I'm forever killing/restarting background processes like Thunderbird when doing image backups, etc.  I discovered x2 could be lawfully killed (and resurrected) when writing a script to import the registry settings (instead of having to go through windows explorer each time).  Seemed handy for this, too.

I take your point about the x2path though... if one wanted to call the VBS remotely (for whatever reason) it would be impractical.  Sometime this week I'll repost it with more error checking (like unrecognised RES-Types), an extra option to rebuild only a "clean" dll (in case someone wreaks it beyond recognition and wants to start over without mods), and a slightly improved x2 resurrection routine (it was disabled above as it was too simple).

If anyone has any suggestions let me know.  And no, it still won't make a decent cup of tea. :wink:

It may, however, unexpectedly sing Bob Dylan songs...
When you're sad and when you're lonely
And you haven't got a friend
Just remember that (process) death is not the end

And all that you held sacred
Falls down and does not bend
Just remember that (process) death is not the end.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Ok, the aspect of this thread dealing with Resource Editing and/or my script may now be found here (everything completely rewritten with a new script and .RES examples for beginners) as it needed a home of its own, as do we all at Christmastime.

For all of the 1 or two people who might find it useful - enjoy. :D
Post Reply