BF42 - Start from URL

For info on the site, community and 'battlefieldy' things
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

BF42 - Start from URL

Post by Jeronimo »

I've made a little VBScript which extends your Browser (TS3 etc.) with the ability to start BF1942 and connect to a server directly from a hyperlink. It works with the following URL format definition:

bf1942://ip:port/mod

For example:
bf1942://127.0.0.1:14567/dc_final

Download here:
http://public.valkyrie-clan.com/downloa ... 42.vbs.txt

I have renamed the file to .txt, so it is downloadable. It's plain text and you find installation instructions inside. VBScript files can be run natively under Windows XP or higher - no other software required.

You can "save the choice" when your browser asks you for if it should open with an external program, since the script will always ask you again if you really wanna join.
Here's a link to our clan's server which should work right away if installed correctly: [url]bf1942://81.20.132.132:14567/dc_final[/url]

It has been tested on XP only - the necessary registry entries might differ on Vista or 7. I will extend the script if somebody reports that it doesnt work for Vista/7.

This is "open source" (obviously) and may be used and extended without limitations. No warranties for damage that ... bla bla you know already, read the code if you dont trust it ^^
Image
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

Re: BF42 - Start from URL

Post by Jeronimo »

No other way, since you need something that parses the URL. BF itself unfortunately doesnt do it (like TS or IRC, for example).
Image
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: BF42 - Start from URL

Post by fo0k »

This is neat!

But perhaps needs an active x style installer to prompt you and then do the magic.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

i´m thinking of implementing this on our webpage, will download and take a look.

thanks!
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

Re: BF42 - Start from URL

Post by Jeronimo »

fo0k wrote:But perhaps needs an active x style installer to prompt you and then do the magic.
Yeah, but GUI is a big problem with vbscript ^^ The only thing the installer does is to create the registry keys so your machine knows the protocol "bf1942" and what program is linked to it. These keys will be overwritten when you someday reinstall your BF in another folder and then just start the script again there. So all input the "installer" needs is where your bf1942.exe is located, and this is given to it by putting it in the same folder. Put it in and run - installation complete. That's it ;)

The good thing about VBScript (and that is why I chose it) is that it is the only script language that has the interpreter already there with every Windows. So I can give you the source code instead of something compiled, and it's still runable without installing an interpreter.
Image
hardrock
Posts: 7
Joined: Fri Feb 05, 2010 5:25 pm

Re: BF42 - Start from URL

Post by hardrock »

this is the first website forum i ever joined, not the date shown, but i think back in like '03 or so, and i'm old, as is the game, but you all are the she-it, (spell it, dont read it, lol), of them all. keep it up yall!
Shrooms
Posts: 70
Joined: Wed Aug 11, 2010 12:35 am

Re: BF42 - Start from URL

Post by Shrooms »

My friend enfo is having trouble with the script working. He is getting the error invalid root in registry key HKCR/bf1942 That doesn't make sense
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

Re: BF42 - Start from URL

Post by Jeronimo »

Please gimme some more details... what OS is he using?
Image
Shrooms
Posts: 70
Joined: Wed Aug 11, 2010 12:35 am

Re: BF42 - Start from URL

Post by Shrooms »

He's using vista 32 bit, and i walked him through the process and it just doesn't seem to work
Jeronimo
Posts: 196
Joined: Sun Dec 27, 2009 8:55 pm
Location: Germany
Contact:

Re: BF42 - Start from URL

Post by Jeronimo »

I just installed Win7 x86 on a VM to test it.

My first approach with an admin user and no password set led to the exact same error message.
After a little bit of googling it became clear that this is the case when the user doesn't have write access to the hive key HKEY_CLASSES_ROOT in the registry. The script places reg keys there to link to the bf1942:// protocol.

So I gave my admin account a password then and restarted. After that I could run the installation without problems. All keys were installed and worked correctly when clicking on a link.

So for the installation in Vista and Win7 the script must be run in an admin account that has a password. Note: This is only necessary once for all users when installing the script by running it from the bf1942 folder.

Can you please try again and tell me if that helped?
Image
Post Reply