Page 1 of 1

Add-On Installer for SuperTuxKart

PostPosted: 09 May 2010, 20:42
by Toren1994
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

Re: Add-On Installer for SuperTuxKart

PostPosted: 10 May 2010, 01:28
by Auria
Hi,

interesting! In what language is it written, is it open source?

Re: Add-On Installer for SuperTuxKart

PostPosted: 10 May 2010, 09:21
by Toren1994
I written it in Cocoa, Objective-C and it's open source of course ;) .

Re: Add-On Installer for SuperTuxKart

PostPosted: 10 May 2010, 15:42
by xapantu
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 ?

Re: Add-On Installer for SuperTuxKart

PostPosted: 10 May 2010, 16:37
by Toren1994
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.

Re: Add-On Installer for SuperTuxKart

PostPosted: 10 May 2010, 17:06
by xapantu
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 :(

Re: Add-On Installer for SuperTuxKart

PostPosted: 11 May 2010, 00:46
by Auria
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

Re: Add-On Installer for SuperTuxKart

PostPosted: 29 May 2010, 12:43
by vjuk
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

Re: Add-On Installer for SuperTuxKart

PostPosted: 29 May 2010, 17:08
by Auria
Yes it would be cool, but also a lot of work, so that won't happen just right now

Re: Add-On Installer for SuperTuxKart

PostPosted: 30 May 2010, 06:26
by acme_pjz
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 ...)

Re: Add-On Installer for SuperTuxKart

PostPosted: 01 Jun 2010, 16:47
by Toren1994
I'm working at the moment for a Mac Os X 10.4 Version.