Custom Autoupdater/Launcher

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Locked
Zaibacu
Posts: 3
Joined: Sun Apr 25, 2010 2:06 pm

Custom Autoupdater/Launcher

Post by Zaibacu »

It's a launcher/auto updater written in Java, works fine on MAC/Linux/and all Microsoft Windows versions. Fully customize-able (by editing settings.xml and gui.xml), button clicks triggers scripts (written in Jython), which can be customized too (if you know this scripting language...).
I've used multithreading technique, so graphic interface, actions, and each script are on separate threads. Because of that, there should be no lags, and launcher should not crash(unless there're some problems in configuration)

Standart looks(yes i know, i'm not very good designer :D):
Image
Background image, font color, button color, button coordinates, window size, center html frame can be anything you want (note: HTML frame is kinda basic. It don't know any CSS and javascript)

For updater to work, you need to create separate folder in your web hosting and create new index.php, then add this php code:
*See 'update.php' file from 'php examples' download*
Last two lines are folders in which newest files are added. It may be not just system directory, I added it for an example.
This page will print files with their sizes, launcher will scan through them, then check your game files and determine which files should be downloaded. Then if you agree, it will download them. :)

Build-in functions:(for scripting)
z.getIP() - returns IP

z.getDir() - returns game dir

z.web(url) - opens webpage in default browser

z.launch(dir) - launches application

z.download(url,destination) - downloads and saves file

z.check() - checks for updates

z.sendPacket(packetString, IP, Port, Timeout) - sends a custom packet to server. packetString, IP goes in string format, Port and Timeout in integer format

Updates:
v1.1
  • Custom packet sending function added. What for? For example you can make launcher start somekind of protection in background(to kill all hack processes, auto ban or something more), and force players to use it. If protection is off - player gets kicked from server. Well it needs some further modifications at server core and little bit advanced script, but atleast I've made it possible for now :)
  • All script files were moved from Data folder to web page. This way server admins have full control of scripts
Scripts php file example:
*See 'scripts.php' file from 'php examples' download*
Basicly you only need to 'echo' each line of script, don't forget to use '<br>' at end of lines. Scripting language remains the same (Jython)

Known bugs:
  • If base game directory has spaces, it may throw error "directory not found bla bla bla". I've did some fixes in script, but not sure if they helped
  • Downloading huge files may crash program (the biggest file i've tryed was 300mb, and it worked fine, but not sure about 1gb+)
Download: Version 1.1 beta
Download: Version 1.0 beta

Download: Example php files
Last edited by Zaibacu on Sat May 01, 2010 1:04 pm, edited 4 times in total.
KadeL
Posts: 142
Joined: Sat Mar 15, 2008 11:04 pm
Location: Argentina
Contact:

Re: Custom Autoupdater/Launcher

Post by KadeL »

Thanks for sharing, nice work :wink:
Sorry everyone for my very bad English, I speak Spanish
Zaibacu
Posts: 3
Joined: Sun Apr 25, 2010 2:06 pm

Re: Custom Autoupdater/Launcher

Post by Zaibacu »

Thanks man :)
Had some free time today, so here's update:
v1.1
  • Custom packet sending function added. What for? For example you can make launcher start somekind of protection in background(to kill all hack processes, auto ban or something more), and force players to use it. If protection is off - player gets kicked from server. Well it needs some further modifications at server core and little bit advanced script, but atleast I've made it possible for now :)
  • All script files were moved from Data folder to web page. This way server admins have full control of scripts
User avatar
pokiokio
Posts: 259
Joined: Wed Mar 04, 2009 8:08 pm

Re: Custom Autoupdater/Launcher

Post by pokiokio »

It may sound noobish but, how do I launch it? :oops:

How are the players gonna run it?
Image
Prolly the youngest L2j user :P
Zaibacu
Posts: 3
Joined: Sun Apr 25, 2010 2:06 pm

Re: Custom Autoupdater/Launcher

Post by Zaibacu »

Well normally it should run on double click the Jar file(or need to set 'open with' with java), or there is bath command 'java -jar file_name.jar'

P.S. And don't forget to delete "dircache.txt" file before you compress the launcher. It simply stores a game directory. If launcher can't find that file, it lets you to set a new one. That way each player can set their game directory
User avatar
Warmaster
Posts: 1
Joined: Sun Jan 09, 2011 3:57 pm
Contact:

Re: Custom Autoupdater/Launcher

Post by Warmaster »

i no like the design sorry :?
Edelvez
Posts: 173
Joined: Fri Nov 06, 2009 6:32 am
Location: Argentina

Re: Custom Autoupdater/Launcher

Post by Edelvez »

First see the date before posting.. do not revive old post
Someone once told me: "The easiest way of doing things, making them the hard way" ;)
Locked