Difference between revisions of "Wiimms SZS Tools"

From Custom Mario Kart
Jump to navigation Jump to search
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
  
'''Wiimms SZS Tools''' should be a set of different tools to manipulate SZS files.  All tools are command line tools and run without any interaction. The main goal is to run them in batch files and scripts to automate recurring jobs. At this moment the tools are '''alpha''' and there is only one tool:
+
'''Wiimms SZS Tools''' should be a set of different tools to manipulate SZS files.  All tools are command line tools and run without any interaction. The main goal is to run them in batch files and scripts to automate recurring jobs. At this moment there is only one tool:
 
* '''wszst''' : Wiimms SZS Tool
 
* '''wszst''' : Wiimms SZS Tool
  
Line 7: Line 7:
 
Both tools together can be used to change the track names of all message files of all languages without interaction.
 
Both tools together can be used to change the track names of all message files of all languages without interaction.
  
This toolser will not replace the [[SZS Modifier]] or [[CTools|SZS Explorer]], because they are interative tools with GUI support.
+
This toolset will not replace the [[SZS Modifier]] or [[CTools|SZS Explorer]], because they are interative tools with GUI support.
  
 
== wszst (Wiimms SZS Tool) ==
 
== wszst (Wiimms SZS Tool) ==
Line 20: Line 20:
 
<pre>
 
<pre>
  
wszst : Wiimms SZS Tool : It can list, analyze, extract and compose SZS files.
+
wszst : Wiimms SZS Tool : It can list, analyze, extract and compose
 +
        SZS files.
  
 
Syntax: wszst [option]... command [option|parameter|file]...
 
Syntax: wszst [option]... command [option|parameter|file]...
Line 27: Line 28:
  
 
   VERSION          : Print program name and version and exit.
 
   VERSION          : Print program name and version and exit.
   HELP      | H  : Print help and exit. If the first non option is a valid
+
   HELP      | H  : Print help and exit. If the first non option is
                    command name, then a help for the given command is
+
                    a valid command name, then a help for the given
 +
                    command is printed.
 +
  TEST            : Test options: All options are allowed, some are
 
                     printed.
 
                     printed.
  TEST            : Test options: All options are allowed, some are printed.
+
   ERROR      | ERR : Translate exit code to message or print a table
   ERROR      | ERR : Translate exit code to message or print a table with all
+
                    with all error messages if not exit code is
                    error messages if not exit code is given.
+
                    given.
  
 
   LIST      | LS  : List all sub files of SZS and U8 files.
 
   LIST      | LS  : List all sub files of SZS and U8 files.
   LIST-L    | LL  : List all sub files with size. 'LIST-L' is a shortcut for
+
   LIST-L    | LL  : List all sub files with size. 'LIST-L' is a
                    'LIST --long.
+
                    shortcut for 'LIST --long.
   LIST-LL    | LLL : List all sub files with offset and size. 'LIST-LL' is a
+
   LIST-LL    | LLL : List all sub files with offset and size.
                    shortcut for 'LIST --long --long'.
+
                    'LIST-LL' is a shortcut for 'LIST --long
 +
                    --long'.
 +
 
 
   DECOMPRESS | DEC : Decompress SZS files. The default destination is
 
   DECOMPRESS | DEC : Decompress SZS files. The default destination is
 
                     '%P/%N.u8'.
 
                     '%P/%N.u8'.
   COMPRESS  | COM : Create compressed SZS files. The default destination is
+
   COMPRESS  | COM : Create compressed SZS files. The default
 +
                    destination is '%P/%N.szs'.
 +
  EXTRACT    | X  : Extract all sub files of SZS and U8 files. The
 +
                    default destination is '%P/%N.d/'.
 +
  CREATE    | C  : Create SZS files by adding all files of the
 +
                    directory structure. The default destination is
 
                     '%P/%N.szs'.
 
                     '%P/%N.szs'.
  EXTRACT    | X  : Extract all sub files of SZS and U8 files. The default
+
 
                    destination is '%P/%N.d/'.
+
Type 'wszst HELP command' to get command specific help.
  
 
</pre>
 
</pre>
Line 52: Line 62:
 
The command '''LIST''' list the sub files of [[SZS File]]s.
 
The command '''LIST''' list the sub files of [[SZS File]]s.
  
wszst LIST sourcefiles
+
<pre>
 +
wszst LIST|LS : List all sub files of SZS and U8 files.
 +
 
 +
Syntax: wszst LIST [source]...
 +
 
 +
Options:
 +
 
 +
  -l --long      If set, the size of each file is printed. If set
 +
                  twice, offset and size are printed.
 +
  -H --no-header  Suppress printing of header and footer.
 +
 
 +
</pre>
  
 
=== wszst DECOMPRESS ===
 
=== wszst DECOMPRESS ===
Line 58: Line 79:
 
The command '''DECOMPRESS''' decompresses a [[SZS File]] and stores the decompressed data into file.
 
The command '''DECOMPRESS''' decompresses a [[SZS File]] and stores the decompressed data into file.
  
wszst DECOMPRESS sourcefiles --dest destination
+
<pre>
 +
wszst DECOMPRESS|DEC : Decompress SZS files. The default destination
 +
                      is '%P/%N.u8'.
 +
 
 +
Syntax: wszst DECOMPRESS [szs]...
 +
 
 +
Options:
 +
 
 +
  -d --dest path    Define a destination path (directory/file).
 +
                      The path may contain escape sequences: %Q is
 +
                    replaced by the fully qualified source name. %P
 +
                    and %F are replaced by the path or by the
 +
                    filename. %N and %E are replaced by filename
 +
                    without extension or by the extension.
 +
  -D --DEST path    Like --dest, but create the directory path
 +
                    automatically.
 +
  -E --esc char    Define an alternative escape character for
 +
                    destination files. The default is '%'. For
 +
                    Windows (CYGWIN) it is a good choice to set
 +
                    '-E$'.
 +
 
 +
  -o --overwrite    Overwrite already existing files without warning.
 +
  -r --remove-dest  Remove already existing files before creating it.
 +
                    If set, --overwrite is ignored.
 +
  -u --update      Create only files that do not exist. Already
 +
                    existing files are ignored without warning. If
 +
                    set, --overwrite and --remove-dest are ignored.
 +
</pre>
  
 
=== wszst COMPRESS ===
 
=== wszst COMPRESS ===
Line 64: Line 112:
 
The command '''COMPRESS''' compresses a binary file and creates [[SZS File]].
 
The command '''COMPRESS''' compresses a binary file and creates [[SZS File]].
  
wszst COMPRESS sourcefiles --dest destination
+
<pre>
 +
wszst COMPRESS|COM : Create compressed SZS files. The default
 +
                    destination is '%P/%N.szs'.
 +
 
 +
Syntax: wszst COMPRESS [source]...
 +
 
 +
Options:
 +
 
 +
  -d --dest path    Define a destination path (directory/file).
 +
                      The path may contain escape sequences: %Q is
 +
                    replaced by the fully qualified source name. %P
 +
                    and %F are replaced by the path or by the
 +
                    filename. %N and %E are replaced by filename
 +
                    without extension or by the extension.
 +
  -D --DEST path    Like --dest, but create the directory path
 +
                    automatically.
 +
  -E --esc char    Define an alternative escape character for
 +
                    destination files. The default is '%'. For
 +
                    Windows (CYGWIN) it is a good choice to set
 +
                    '-E$'.
 +
 
 +
  -o --overwrite    Overwrite already existing files without warning.
 +
  -r --remove-dest  Remove already existing files before creating it.
 +
                    If set, --overwrite is ignored.
 +
  -u --update      Create only files that do not exist. Already
 +
                    existing files are ignored without warning. If
 +
                    set, --overwrite and --remove-dest are ignored.
 +
 
 +
</pre>
  
 
=== wszst EXTRACT ===
 
=== wszst EXTRACT ===
Line 70: Line 146:
 
The command '''EXTRACT''' extracts the sub file of source files and copy the files into a directory structure.
 
The command '''EXTRACT''' extracts the sub file of source files and copy the files into a directory structure.
  
wszst EXTRACT sourcefiles --dest destination_directory
+
<pre>
 +
wszst EXTRACT|X : Extract all sub files of SZS and U8 files. The
 +
                  default destination is '%P/%N.d/'.
 +
 
 +
Syntax: wszst EXTRACT [source]...
 +
 
 +
Options:
 +
 
 +
  -d --dest path    Define a destination path (directory/file).
 +
                      The path may contain escape sequences: %Q is
 +
                    replaced by the fully qualified source name. %P
 +
                    and %F are replaced by the path or by the
 +
                    filename. %N and %E are replaced by filename
 +
                    without extension or by the extension.
 +
  -D --DEST path    Like --dest, but create the directory path
 +
                    automatically.
 +
  -E --esc char    Define an alternative escape character for
 +
                    destination files. The default is '%'. For
 +
                    Windows (CYGWIN) it is a good choice to set
 +
                    '-E$'.
 +
 
 +
  -o --overwrite    Overwrite already existing files without warning.
 +
  -r --remove-dest  Remove already existing files before creating it.
 +
                    If set, --overwrite is ignored.
 +
  -u --update      Create only files that do not exist. Already
 +
                    existing files are ignored without warning. If
 +
                    set, --overwrite and --remove-dest are ignored.
 +
</pre>
  
 
=== wszst CREATE ===
 
=== wszst CREATE ===
Line 76: Line 179:
 
The command '''CREATE''' creates a [[SZS file]] by adding all files of the directory structure.  
 
The command '''CREATE''' creates a [[SZS file]] by adding all files of the directory structure.  
  
wszst CREATE source_directory --dest dest_file
+
<pre>
 +
wszst CREATE|C : Create SZS files by adding all files of the
 +
                directory structure. The default destination is
 +
                '%P/%N.szs'.
 +
 
 +
Syntax: wszst CREATE [source_dir]...
 +
 
 +
Options:
 +
 
 +
  -d --dest path    Define a destination path (directory/file).
 +
                      The path may contain escape sequences: %Q is
 +
                    replaced by the fully qualified source name. %P
 +
                    and %F are replaced by the path or by the
 +
                    filename. %N and %E are replaced by filename
 +
                    without extension or by the extension.
 +
  -D --DEST path    Like --dest, but create the directory path
 +
                    automatically.
 +
  -E --esc char    Define an alternative escape character for
 +
                    destination files. The default is '%'. For
 +
                    Windows (CYGWIN) it is a good choice to set
 +
                    '-E$'.
 +
 
 +
  -o --overwrite    Overwrite already existing files without warning.
 +
  -r --remove-dest  Remove already existing files before creating it.
 +
                    If set, --overwrite is ignored.
 +
  -u --update      Create only files that do not exist. Already
 +
                    existing files are ignored without warning. If
 +
                    set, --overwrite and --remove-dest are ignored.
 +
  -8 --u8          Create an uncompressed U8 file instead of a
 +
                    compressed SZS file. The default destination
 +
                    changes to '%P/%N.u8'.
 +
  -L --logging      Print the internal file list like command LIST.
 +
</pre>
 +
 
 +
== Tests ==
 +
 
 +
I have made several tests with the following files:
 +
* All files of <tt>Scene/UI/</tt>, but not <tt>Title.szs</tt> (does not work).
 +
* Some (custom) tracks of <tt>Race/Course/</tt>
 +
 
 +
The tests:
 +
* Decompress and compress and decompress again SZS files and compare the results.
 +
* Extract all files, create SZS and extract again. The both extracted file system are equal.
 +
* Extract some of the files with SZS Explorer and compare them to my extracted files.
 +
* Extract all files and create a new SZS files. Then create a new ISO image with the new SZS files and play it.
  
 
== Download ==
 
== Download ==
  
Download an '''alpha version''' of '''Wiimms SZS Tools''':
+
Download '''Beta Version 0.01a'' of '''Wiimms SZS Tools''':
* [http://wit.wiimm.de/download/szs-v0.00a-r2374-cygwin.zip Windows (Cygwin)]
+
* [http://wit.wiimm.de/download/szs-v0.01a.beta-r2385-cygwin.zip Windows (Cygwin)]
* [http://wit.wiimm.de/download/szs-v0.00a-r2374-i386.tar.gz Linux/i386 (32 bit)]
+
* [http://wit.wiimm.de/download/szs-v0.01a.beta-r2385-i386.tar.gz Linux/i386 (32 bit)]
* [http://wit.wiimm.de/download/szs-v0.00a-r2374-x86_64.tar.gz Linux/x86_64 (64 bit)]
+
* [http://wit.wiimm.de/download/szs-v0.01a.beta-r2385-x86_64.tar.gz Linux/x86_64 (64 bit)]
Mac support is planned.
+
* [http://wit.wiimm.de/download/szs-v0.01a.beta-r2385-mac.tar.gz Mac (universal binary)]
  
 
== Links ==
 
== Links ==

Revision as of 16:09, 31 March 2011

Introduction

Wiimms SZS Tools should be a set of different tools to manipulate SZS files. All tools are command line tools and run without any interaction. The main goal is to run them in batch files and scripts to automate recurring jobs. At this moment there is only one tool:

  • wszst : Wiimms SZS Tool

A second tool to change the content of message files is planned. Both tools together can be used to change the track names of all message files of all languages without interaction.

This toolset will not replace the SZS Modifier or SZS Explorer, because they are interative tools with GUI support.

wszst (Wiimms SZS Tool)

wszst is a command driven tool. Only a few commands are implemented yet; other will follow.

wszst HELP

The HELP command print the built in help. Type wszst HELP for a general help. Add a command to print command specific help:


wszst : Wiimms SZS Tool : It can list, analyze, extract and compose
        SZS files.

Syntax: wszst [option]... command [option|parameter|file]...

Commands:

  VERSION          : Print program name and version and exit.
  HELP       | H   : Print help and exit. If the first non option is
                     a valid command name, then a help for the given
                     command is printed.
  TEST             : Test options: All options are allowed, some are
                     printed.
  ERROR      | ERR : Translate exit code to message or print a table
                     with all error messages if not exit code is
                     given.

  LIST       | LS  : List all sub files of SZS and U8 files.
  LIST-L     | LL  : List all sub files with size. 'LIST-L' is a
                     shortcut for 'LIST --long.
  LIST-LL    | LLL : List all sub files with offset and size.
                     'LIST-LL' is a shortcut for 'LIST --long
                     --long'.

  DECOMPRESS | DEC : Decompress SZS files. The default destination is
                     '%P/%N.u8'.
  COMPRESS   | COM : Create compressed SZS files. The default
                     destination is '%P/%N.szs'.
  EXTRACT    | X   : Extract all sub files of SZS and U8 files. The
                     default destination is '%P/%N.d/'.
  CREATE     | C   : Create SZS files by adding all files of the
                     directory structure. The default destination is
                     '%P/%N.szs'.

Type 'wszst HELP command' to get command specific help.

wszst LIST

The command LIST list the sub files of SZS Files.

wszst LIST|LS : List all sub files of SZS and U8 files.

Syntax: wszst LIST [source]...

Options:

  -l --long       If set, the size of each file is printed. If set
                  twice, offset and size are printed.
  -H --no-header  Suppress printing of header and footer.

wszst DECOMPRESS

The command DECOMPRESS decompresses a SZS File and stores the decompressed data into file.

wszst DECOMPRESS|DEC : Decompress SZS files. The default destination
                       is '%P/%N.u8'.

Syntax: wszst DECOMPRESS [szs]...

Options:

  -d --dest path    Define a destination path (directory/file).
                      The path may contain escape sequences: %Q is
                    replaced by the fully qualified source name. %P
                    and %F are replaced by the path or by the
                    filename. %N and %E are replaced by filename
                    without extension or by the extension.
  -D --DEST path    Like --dest, but create the directory path
                    automatically.
  -E --esc char     Define an alternative escape character for
                    destination files. The default is '%'. For
                    Windows (CYGWIN) it is a good choice to set
                    '-E$'.

  -o --overwrite    Overwrite already existing files without warning.
  -r --remove-dest  Remove already existing files before creating it.
                    If set, --overwrite is ignored.
  -u --update       Create only files that do not exist. Already
                    existing files are ignored without warning. If
                    set, --overwrite and --remove-dest are ignored.

wszst COMPRESS

The command COMPRESS compresses a binary file and creates SZS File.

wszst COMPRESS|COM : Create compressed SZS files. The default
                     destination is '%P/%N.szs'.

Syntax: wszst COMPRESS [source]...

Options:

  -d --dest path    Define a destination path (directory/file).
                      The path may contain escape sequences: %Q is
                    replaced by the fully qualified source name. %P
                    and %F are replaced by the path or by the
                    filename. %N and %E are replaced by filename
                    without extension or by the extension.
  -D --DEST path    Like --dest, but create the directory path
                    automatically.
  -E --esc char     Define an alternative escape character for
                    destination files. The default is '%'. For
                    Windows (CYGWIN) it is a good choice to set
                    '-E$'.

  -o --overwrite    Overwrite already existing files without warning.
  -r --remove-dest  Remove already existing files before creating it.
                    If set, --overwrite is ignored.
  -u --update       Create only files that do not exist. Already
                    existing files are ignored without warning. If
                    set, --overwrite and --remove-dest are ignored.

wszst EXTRACT

The command EXTRACT extracts the sub file of source files and copy the files into a directory structure.

wszst EXTRACT|X : Extract all sub files of SZS and U8 files. The
                  default destination is '%P/%N.d/'.

Syntax: wszst EXTRACT [source]...

Options:

  -d --dest path    Define a destination path (directory/file).
                      The path may contain escape sequences: %Q is
                    replaced by the fully qualified source name. %P
                    and %F are replaced by the path or by the
                    filename. %N and %E are replaced by filename
                    without extension or by the extension.
  -D --DEST path    Like --dest, but create the directory path
                    automatically.
  -E --esc char     Define an alternative escape character for
                    destination files. The default is '%'. For
                    Windows (CYGWIN) it is a good choice to set
                    '-E$'.

  -o --overwrite    Overwrite already existing files without warning.
  -r --remove-dest  Remove already existing files before creating it.
                    If set, --overwrite is ignored.
  -u --update       Create only files that do not exist. Already
                    existing files are ignored without warning. If
                    set, --overwrite and --remove-dest are ignored.

wszst CREATE

The command CREATE creates a SZS file by adding all files of the directory structure.

wszst CREATE|C : Create SZS files by adding all files of the
                 directory structure. The default destination is
                 '%P/%N.szs'.

Syntax: wszst CREATE [source_dir]...

Options:

  -d --dest path    Define a destination path (directory/file).
                      The path may contain escape sequences: %Q is
                    replaced by the fully qualified source name. %P
                    and %F are replaced by the path or by the
                    filename. %N and %E are replaced by filename
                    without extension or by the extension.
  -D --DEST path    Like --dest, but create the directory path
                    automatically.
  -E --esc char     Define an alternative escape character for
                    destination files. The default is '%'. For
                    Windows (CYGWIN) it is a good choice to set
                    '-E$'.

  -o --overwrite    Overwrite already existing files without warning.
  -r --remove-dest  Remove already existing files before creating it.
                    If set, --overwrite is ignored.
  -u --update       Create only files that do not exist. Already
                    existing files are ignored without warning. If
                    set, --overwrite and --remove-dest are ignored.
  -8 --u8           Create an uncompressed U8 file instead of a
                    compressed SZS file. The default destination
                    changes to '%P/%N.u8'.
  -L --logging      Print the internal file list like command LIST.

Tests

I have made several tests with the following files:

  • All files of Scene/UI/, but not Title.szs (does not work).
  • Some (custom) tracks of Race/Course/

The tests:

  • Decompress and compress and decompress again SZS files and compare the results.
  • Extract all files, create SZS and extract again. The both extracted file system are equal.
  • Extract some of the files with SZS Explorer and compare them to my extracted files.
  • Extract all files and create a new SZS files. Then create a new ISO image with the new SZS files and play it.

Download

Download Beta Version 0.01a of Wiimms SZS Tools':

Links