Add-On Installer for SuperTuxKart

Add-On Installer for SuperTuxKart

Postby Toren1994 » 09 May 2010, 20:42

Hi all

Again and again, my friends who play SuperTuxKart ask me questions like: How I install Add-On's for SuperTuxKart. What is the path to the karts folder again. etc.
Therefore, I made a programm (Mac) which install add-on's (karts and tracks) for SuperTuxKart 0.6. It's only a betaversion... :)

It works on Mac OS X 10.5 PPC and Intel / Mac OS X 10.6 Intel

Suggestions and tipps are welcome. Tell me if I mistranslated the program. I'm not very good in english... ;)
Download:
English Version: http://www.supertuxkart.de/STK-Add-On-Installer-(English).zip
German Version: http://www.supertuxkart.de/STK-Add-On-Installer-(German).zip

greetings Toren
Toren1994
 
Posts: 16
Joined: 11 Dec 2009, 20:07

Re: Add-On Installer for SuperTuxKart

Postby Auria » 10 May 2010, 01:28

Hi,

interesting! In what language is it written, is it open source?
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Add-On Installer for SuperTuxKart

Postby Toren1994 » 10 May 2010, 09:21

I written it in Cocoa, Objective-C and it's open source of course ;) .
Toren1994
 
Posts: 16
Joined: 11 Dec 2009, 20:07

Re: Add-On Installer for SuperTuxKart

Postby xapantu » 10 May 2010, 15:42

I think Objective-C doesn't work on Linux and Windows, does it ? (edit : maybe objective-c works but cocoa...)

If Objective-C works, I can help you to port it on linux, if you want.

edit2 : can we see the code anywhere ?
xapantu
 
Posts: 283
Joined: 07 Dec 2009, 17:30

Re: Add-On Installer for SuperTuxKart

Postby Toren1994 » 10 May 2010, 16:37

Cocoa Obj-C works on Mac. I don't know whether it work on Linux.

It's not only a Code. It's virtually a project with classes (.m and .h / Cocoa classes). At the moment, i learn cocoa objective-c and this is one of my first project :lol: .
Here is an extract from the bulk of this programm.
{l Code}: {l Select All Code}
- (IBAction)doMove:(id)sender {
   // InfoLabel...
   [infoLabel setHidden:NO];
   NSString * sourcePath = [addonPath stringValue];
   NSString * destPath = [addonDestPath stringValue];
   NSFileManager *fm = [NSFileManager defaultManager];

   // Pfade werden erstellt...
   NSString *directoryPath = [addonPath stringValue];
   NSDirectoryEnumerator *directoryEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:directoryPath];
   
   for (NSString *path in directoryEnumerator) {
      
      // Überprüfen...
      if ([[path pathExtension] isEqualToString:@"kart"]) {
         // Don't enumerate this directory.
         [directoryEnumerator skipDescendents];
         
         if ([fm moveItemAtPath:sourcePath toPath:destPath error:nil] == YES) {
            [infoLabel setStringValue:@"Installation erfolgreich!"];
            [ok setImage:[NSImage imageNamed: @"ok.png"]];
            [ok2 setImage:[NSImage imageNamed: @"ok.png"]];
         } else {
            [infoLabel setStringValue:@"Programm konnte das Add-On nicht installieren. Überprüfen Sie die Lokation von SuperTuxKart.app."];
            [error setImage:[NSImage imageNamed: @"err (.............)

It isn't easy at all.

Edit: I use XCode to build it.
Toren1994
 
Posts: 16
Joined: 11 Dec 2009, 20:07

Re: Add-On Installer for SuperTuxKart

Postby xapantu » 10 May 2010, 17:06

Toren1994 {l Wrote}:Cocoa Obj-C works on Mac. I don't know whether it work on Linux.

I think it doesn't work on Linux and Windows :( (and I haven't any Mac).
Toren1994 {l Wrote}:It's not only a Code. It's virtually a project with classes (.m and .h / Cocoa classes). At the moment, i learn cocoa objective-c and this is one of my first project :lol: .

I haven't any Mac but your code isn't in real files ?
Toren1994 {l Wrote}: I use XCode to build it.

And it doesn't work on Linux too :(
xapantu
 
Posts: 283
Joined: 07 Dec 2009, 17:30

Re: Add-On Installer for SuperTuxKart

Postby Auria » 11 May 2010, 00:46

Objective-C works on Linux, but not Cocoa (GNUstep implements a subset of it). BUT, anyway, add-ons location is different between OS X and Linux anyway so a cross-platform installer couldn't share much code
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Add-On Installer for SuperTuxKart

Postby vjuk » 29 May 2010, 12:43

wouldnt it be cool if you could make a in-game add on browser and downloader so ppl could really easily get all the add-ons
vjuk
 
Posts: 10
Joined: 07 Dec 2009, 13:35

Re: Add-On Installer for SuperTuxKart

Postby Auria » 29 May 2010, 17:08

Yes it would be cool, but also a lot of work, so that won't happen just right now
Image
User avatar
Auria
STK Moderator
 
Posts: 2976
Joined: 07 Dec 2009, 03:52

Re: Add-On Installer for SuperTuxKart

Postby acme_pjz » 30 May 2010, 06:26

Maybe you can just use installer maker (e.g. InnoSetup) to make an add-on installer, I think that is easier than C ;)

(In Linux maybe sh is enough ...)
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Add-On Installer for SuperTuxKart

Postby Toren1994 » 01 Jun 2010, 16:47

I'm working at the moment for a Mac Os X 10.4 Version.
Toren1994
 
Posts: 16
Joined: 11 Dec 2009, 20:07

Who is online

Users browsing this forum: No registered users and 1 guest

cron