FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
pocketpc-cab 23.7 KiB
Newer Older
Silas S. Brown's avatar
Silas S. Brown committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
#!/usr/bin/perl -w
# Build an installable Pocket PC cabinet file.
# Copyright 2006 Shaun Jackman

# SSB's note: This is a MODIFIED version, which
# claims to be compatible with non-touchscreen
# devices as well as touchscreen devices.
# It was obtained from
# http://www.mail-archive.com/cegcc-devel@lists.sourceforge.net/msg02565.html
# and I removed some wrong formatting etc that
# was introduced by the website's CMS, plus
# restored the old functionality of having ~
# stand for spaces in file and directory names.
# + hacked it to use %InstallDir% instead of
# $destdir (so Storage Card install works again)
# It still needs the "lcab" binary of course.

use strict;
use Getopt::Long;
use Pod::Usage;
use Text::ParseWords;
use MIME::Base64;


# Constants.
my $architecture = 0;
my @version_requirements = (4, 0, 6, 99, 0, -536870912); # 4.0.0 to 6.99.0xE0000000 (-536870912)
my $verbose = 0;

# Strings.
my $string_count = 0;
my %string_ids;

# Directories.
my $directory_count = 0;
my %directory_ids;
my @directories;

# Files.
my $file_count = 0;
my %file_ids;
my %file_dirs;
my @files;

# RegHives.
my $reghive_count = 0;
my %reghive_ids;
my @reghive_roots;
my @reghives;

# RegKeys.
my $regkey_count = 0;
my %regkey_ids;
my @regkey_hives;
my @regkey_keys;
my @regkey_names;
my @regkey_values;
my @regkey_xmlvalues;
my @regkey_types;
my @regkey_typeids;

# Links.
my $links_count = 0;
my %links;
my %link_targets;
my %link_dirs;


# Returns the ID of the specified string.
sub get_string_id($)
{
        my $string = shift;
        my $id = $string_ids{$string};
        if( defined $id) {
                return $id;
        } else {
                $id = ++$string_count;
                $string_ids{$string} = $id;
                return $id;
        }
}


# Returns the ID of the specified directory.
sub get_directory_id($)
{
        my $directory = shift;
        my $id = $directory_ids{$directory};
        if( defined $id) {
                return $id;
        } else {
                $id = ++$directory_count;
                $directory_ids{$directory} = $id;

                my @strings = split '/', $directory;
                my @ids;
                foreach my $string (@strings) {
                        next if length $string == 0;
                        push @ids, get_string_id( $string);
                }
                push @ids, 0;
                $directories[$id] = \@ids;

                return $id;
        }
}


# Returns the ID of the specified registry key
sub get_reghive_id($$)
{
        my $root = shift;
        my $key = shift;
        my $hive_name = "$root/$key";
        my $id = $reghive_ids{$hive_name};
        if( defined $id) {
                return $id;
        } else {
                $id = ++$reghive_count;
                $reghive_ids{$hive_name} = $id;

                my @strings = split '/', $key;
                my @ids;
                foreach my $string (@strings) {
                        next if length $string == 0;
                        push @ids, get_string_id( $string);
                }
                push @ids, 0;
                $reghives[$id] = \@ids;
                $reghive_roots[$id] = $root;

                return $id;
        }
}

sub parseint($)
{
        my $str = shift;
        if ($str =~ /^0x/i) {
                return hex($str);
        } elsif ($str =~ /^0b/i) {
                return oct($str);
        } else {
                return int($str);
        }
}


# Returns a list of keys sorted by value.
sub get_value_sorted_keys(%)
{
        my %hash = @_;
        return sort { $hash{$a} <=> $hash{$b} } keys %hash;
}


# Creates the files.
sub parse_input($)
{
        my $destdir = shift;
        while(<>) {
                my ($file, $directory, $linkname, $linkdir) = &shellwords($_);
                $file =~ s/~/ /;
                $directory =~ s/~/ /;
                next if length $directory == 0;

                my $id = ++$file_count;
                $file_ids{$file} = $id;
                $file_dirs{$file} = "$directory";
                $files[$id] = get_directory_id "$directory";


                if (defined $linkdir) {
                        $linkname .= '.lnk';

                        $link_targets{$linkname} = "$directory/$file";
                        $link_dirs{$linkname} = $linkdir;

                        my $linknameid = get_string_id $linkname;
                        my $dirid = 0;
                        my $basedir = 0;
                        if ($linkdir =~ /^%CE(\d+)%$/) {
                                $basedir = $1;
                        } else {
                                $dirid = get_directory_id $linkdir;
                        }

                        my @strings = split '/', $linkname;
                        my @stringids;
                        foreach my $string (@strings) {
                                next if length $string == 0;
                                push @stringids, get_string_id $string;
                        }

                        my $fileid = $id;
                        my $id = ++$links_count;
                        my $type = 1;
                        $links{$id} = [ $dirid, $basedir, $fileid, 1, [ @stringids ] ];
                }
        }
}


sub parse_regfile($)
{
        my $regfile = shift;
        open REGFILE, "<$regfile";
        while(<REGFILE>) {
                my @line = &shellwords($_);
                my $root = shift @line;
                my $key = shift @line;
                my $name = shift @line;
                my $type = shift @line;
                my $value = shift @line;
                next if length $root == 0;

                $root = uc($root);
                my $rootid;
                if ($root eq "HKCR") {
                        $rootid = 1;
                } elsif ($root eq "HKCU") {
                        $rootid = 2;
                } elsif ($root eq "HKLM") {
                        $rootid = 3;
                } elsif ($root eq "HKU") {
                        $rootid = 4;
                } else {
                        print STDERR "Unrecognised registry root $root\n";
                        next;
                }
                $type = lc($type);
                my $manifest_value = '';
                my $xml_value = '';
                my $typeid;
                if ($type eq "string") {
                        $manifest_value = $value . "\0";
                        $xml_value = $value;
                        $typeid = 0x00000000;
                        $type = "string";
                } elsif ($type eq "binary") {
                        $manifest_value = '';
                        while (length $value > 0) {
                                my $byte = hex(substr $value,0,2,'');
                                $manifest_value .= pack 'C',$byte;
                        }
                        $xml_value = encode_base64($manifest_value);
                        chomp $xml_value;
                        $typeid = 0x00000001;
                        $type = "binary";
                } elsif ($type eq "integer" || $type eq "int" || $type eq "dword") {
                        my $int = parseint($value);
                        $manifest_value = pack 'V', $int;
                        $xml_value = "$int";
                        $typeid = 0x00010001;
                        $type = "integer";
                } elsif ($type eq "multistring") {
                        my @strings;
                        push @strings, $value if defined $value;
                        push @strings, @line;
                        $manifest_value = '';
                        $xml_value = '';
                        foreach my $string (@strings) {
                                $manifest_value .= $string . "\0";
                                $xml_value .= $string . "\xEF\x80\x80"; # separate using EF8080, which is 0xF000 encoded as utf8
                        }
                        $manifest_value .= "\0";
                        $typeid = 0x00010000;
                        $type = "multiplestring";
                } else {
                        print STDERR "Unrecognised registry type $type\n";
                        next;
                }
                my $id = ++$regkey_count;
                $regkey_ids{$id} = $id;
                $regkey_hives[$id] = get_reghive_id $rootid, $key;
                $regkey_keys[$id] = "$root/$key";
                $regkey_names[$id] = $name;
                $regkey_values[$id] = $manifest_value;
                $regkey_xmlvalues[$id] = $xml_value;
                $regkey_typeids[$id] = $typeid;
                $regkey_types[$id] = $type;
        }
        close REGFILE;
}


# Returns the entire manifest.
sub get_manifest($$)
{
        my ($provider, $application) = @_;

# Header.
        my $offset = 100;

# Application.
        my $application_offset = $offset;
        $application .= "\0";
        while ((length $application) % 4 != 0) {
                $application .= "\0";
        }
        $offset += length $application;

# Provider.
        my $provider_offset = $offset;
        $provider .= "\0";
        while ((length $provider) % 4 != 0) {
                $provider .= "\0";
        }
        $offset += length $provider;

# Unsupported platforms.
        my $unsupported_offset = $offset;
        my $unsupported = '';
        $offset += length $unsupported;

# Strings.
        my $strings_offset = $offset;
        my $strings = '';
        foreach my $string (get_value_sorted_keys %string_ids) {
                my $string_id = $string_ids{$string};
                print "$string($string_id)\n" if $verbose;
                $string .= "\0";
                while ((length $string) % 4 != 0) {
                        $string .= "\0";
                }
                $strings .= pack 'vv', $string_id, length $string;
                $strings .= $string;
        }
        $offset += length $strings;

# Directories.
        my $directories_offset = $offset;
        my $directories = '';
        foreach my $directory (get_value_sorted_keys %directory_ids) {
                my $directory_id = $directory_ids{$directory};
                my @ids = @{$directories[$directory_id]};
                print "$directory($directory_id): @ids\n" if $verbose;
                $directories .= pack 'vv', $directory_id, 2 * scalar @ids;
                foreach my $id (@ids) {
                        $directories .= pack 'v', $id;
                }
        }
        $offset += length $directories;

# Files.
        my $files_offset = $offset;
        my $files = '';
        foreach my $path (get_value_sorted_keys %file_ids) {
                my $file_id = $file_ids{$path};
                my $directory_id = $files[$file_id];
                my $file = $path;
                $file =~ s/^.*\///;
                $file .= "\0";
                while ((length $file) % 4 != 0) {
                        $file .= "\0";
                }
                print "$file($file_id): $directory_id\n" if $verbose;
                $files .= pack 'vvvVv', $file_id, $directory_id, $file_id,
                        0, length $file;
                $files .= $file;
        }
        $offset += length $files;

# RegHives.
        my $reghives_offset = $offset;
        my $reghives = '';
        foreach my $reghive (get_value_sorted_keys %reghive_ids) {
                my $reghive_id = $reghive_ids{$reghive};
                my $reghive_root = $reghive_roots[$reghive_id];
                my @ids = @{$reghives[$reghive_id]};
                print "$reghive($reghive_id): @ids\n" if $verbose;
                $reghives .= pack 'vvvv', $reghive_id, $reghive_root, 0, 2 * scalar @ids;
                foreach my $id (@ids) {
                        $reghives .= pack 'v', $id;
                }
        }
        $offset += length $reghives;

# RegKeys.
        my $regkeys_offset = $offset;
        my $regkeys = '';
        foreach my $regkey_id (get_value_sorted_keys %regkey_ids) {
                my $hive = $regkey_hives[$regkey_id];
                my $name = $regkey_names[$regkey_id];
                my $value = $regkey_values[$regkey_id];
                my $len = length($value);
                my $typeid = $regkey_typeids[$regkey_id];
                print "$name($regkey_id): \n" if $verbose;
                $regkeys .= pack 'vvvVv', $regkey_id, $hive, 0, $typeid, length($name) + 1 + length($value);
                $regkeys .= $name . "\0" . $value;
        }
        $offset += length $regkeys;

# Links.
        my $links_offset = $offset;
        my $links = '';
        foreach my $link_id (keys %links) {
                my @link = @{ $links{$link_id} };
                my $dirid = $link[0];
                my $basedir = $link[1];
                my $fileid = $link[2];
                my $type = $link[3];
                my @stringids = @{ $link[4] };
                my $length = 2 * scalar @stringids;
                $links .= pack 'vvvvvv', $link_id, $dirid, $basedir, $fileid, $type, $length;
                foreach my $id (@stringids) {
                        $links .= pack 'v', $id;
                }
        }
        $offset += length $links;

# Header.
        my $length = $offset;
        my @fields = (
                0, $length, 0, 1, $architecture,
                @version_requirements,
                $string_count, $directory_count, $file_count,
                $reghive_count, $regkey_count, $links_count,
                $strings_offset, $directories_offset, $files_offset,
                $reghives_offset, $regkeys_offset, $links_offset,
                $application_offset, length $application,
                $provider_offset, length $provider,
                $unsupported_offset, length $unsupported,
                0, 0);
        my $header = 'MSCE';
        $header .= pack 'V11 v6 V6 v8', @fields;

        return $header . $application . $provider . $unsupported .
                $strings . $directories . $files .
                $reghives . $regkeys . $links;
}

# Returns a munged version of the specified filename.
# Removes the leading path. Removes the extension. Removes spaces.
# Truncates to eight characters. Pads to eight characters with leading
# zeros. Adds a numeric extension.
sub munge_filename($$)
{
        my $munged = shift;
        my $extension = shift;
        $munged =~ s/^.*\///;
        $munged =~ s/\..*$//;
        $munged =~ s/ //;
        $munged = substr $munged, 0, 8;
        $munged = sprintf '%08s.%03d', $munged, $extension;
        return $munged;
}

# Returns the _setup.xml file
sub get_setupxml($$)
{
        my ($provider, $application) = @_;

        my $output;

        $output .= "<wap-provisioningdoc>\n";
        $output .= "\t<characteristic type=\"Install\">\n";
        $output .= "\t\t<parm name=\"InstallPhase\" value=\"install\" />\n";
        $output .= "\t\t<parm name=\"OSVersionMin\" value=\"$version_requirements[0].$version_requirements[1]\" />\n";
        $output .= "\t\t<parm name=\"OSVersionMax\" value=\"$version_requirements[2].$version_requirements[3]\" />\n";
        $output .= "\t\t<parm name=\"BuildNumberMin\" value=\"$version_requirements[4]\" />\n";
        $output .= "\t\t<parm name=\"BuildNumberMax\" value=\"$version_requirements[5]\" />\n";
        $output .= "\t\t<parm name=\"AppName\" value=\"$provider $application\" />\n";
        my @filenames = get_value_sorted_keys %file_ids;
        $output .= "\t\t<parm name=\"InstallDir\" value=\"\\\" translation=\"install\" />\n";
        my $dirs = scalar keys %directory_ids;
        my $files = scalar keys %file_ids;
        $output .= "\t\t<parm name=\"NumDirs\" value=\"$dirs\" />\n";
        $output .= "\t\t<parm name=\"NumFiles\" value=\"$files\" />\n";
        $output .= "\t\t<parm name=\"NumRegKeys\" value=\"$regkey_count\" />\n";
        $output .= "\t\t<parm name=\"NumRegVals\" value=\"$regkey_count\" />\n";
        my $shortcuts = scalar keys %links;
        $output .= "\t\t<parm name=\"NumShortcuts\" value=\"$shortcuts\" />\n";
        $output .= "\t</characteristic>\n";

        $output .= "\t<characteristic type=\"FileOperation\">\n";

        foreach my $path (get_value_sorted_keys %file_ids) {
                my $file_id = $file_ids{$path};
                my $dir = $file_dirs{$path};
                my $file = $path;
                $file =~ s/^.*\///g;
                $file =~ s/\//\\/g;
                $dir =~ s/\//\\/g;
                my $munged_file = munge_filename $file, $file_id;
                $output .= "\t\t<characteristic type=\"\%InstallDir\%$dir\" translation=\"install\">\n";
                $output .= "\t\t\t<characteristic type=\"MakeDir\" />\n";
                $output .= "\t\t\t<characteristic type=\"$file\" translation=\"install\">\n";
                $output .= "\t\t\t\t<characteristic type=\"Extract\">\n";
                $output .= "\t\t\t\t\t<parm name=\"Source\" value=\"$munged_file\" />\n";
                $output .= "\t\t\t\t</characteristic>\n";
                $output .= "\t\t\t</characteristic>\n";
                $output .= "\t\t</characteristic>\n";
        }
        foreach my $link (get_value_sorted_keys %link_dirs) {
                my $link_dir = $link_dirs{$link};
                my $link_target = $link_targets{$link};
                $link =~ s/\//\\/g;
                $link_dir =~ s/\//\\/g;
                $link_target =~ s/\//\\/g;
                $output .= "\t\t<characteristic type=\"$link_dir\" translation=\"install\">\n";
                $output .= "\t\t\t<characteristic type=\"MakeDir\" />\n";
                $output .= "\t\t\t<characteristic type=\"$link\" translation=\"install\">\n";
                $output .= "\t\t\t\t<characteristic type=\"Shortcut\">\n";
                $output .= "\t\t\t\t\t<parm name=\"Source\" value=\"$link_target\" translation=\"install\" />\n";
                $output .= "\t\t\t\t</characteristic>\n";
                $output .= "\t\t\t</characteristic>\n";
                $output .= "\t\t</characteristic>\n";
        }
        $output .= "\t</characteristic>\n";
        $output .= "\t<characteristic type=\"Registry\">\n";
        foreach my $regkey_id (get_value_sorted_keys %regkey_ids) {
                my $key = $regkey_keys[$regkey_id];
                my $name = $regkey_names[$regkey_id];
                my $type = $regkey_types[$regkey_id];
                my $value = $regkey_xmlvalues[$regkey_id];
                $key =~ s/\//\\/g;
                $output .= "\t\t<characteristic type=\"$key\">\n";
                $output .= "\t\t\t<parm name=\"$name\" value=\"$value\" datatype=\"$type\" />\n";
                $output .= "\t\t</characteristic>\n";
        }
        $output .= "\t</characteristic>\n";
        $output .= "</wap-provisioningdoc>\n";

        return $output;
}


# Prints the version message and exits.
sub version()
{
        print
                "pocketpc-cab 1.0.1\n" .
                "Written by Shaun Jackman <sjackman\@gmail.com>.\n" .
                "\n" .
                "Copyright 2006 Shaun Jackman\n" .
                "This is free software; see the source for copying\n" .
                "conditions. There is NO warranty; not even for\n" .
                "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
        exit 0;
}


# Main.
sub main()
{
        # Parse the command line.
        my $provider = 'Provider';
        my $application = 'Application';
        my $sourcedir = '';
        my $destdir = '';
        my $regfile;

        GetOptions(
                        "provider=s" => \$provider,
                        "application=s" => \$application,
                        "source=s" => \$sourcedir,
                        "dest=s" => \$destdir,
                        "registry=s" => \$regfile,
                        "verbose|v!" => \$verbose,
                        "help|?" => sub { pod2usage(
                                -exitstatus => 0, -verbose => 1) },
                        "man" => sub { pod2usage(
                                -exitstatus => 0, -verbose => 2) },
                        "version" => \&version);

        $sourcedir .= '/' if length $sourcedir > 0;
        $destdir .= '/' if length $destdir > 0;

        if( scalar @ARGV < 1) {
                print
                        "pocketpc-cab: missing file arguments\n" .
                        "Try `pocketpc-cab --help' for more information.\n";
                exit 1;
        }
        my $cab_filename = pop @ARGV;

        # Parse the input file.
        parse_input( $destdir);
        parse_regfile($regfile) if defined $regfile;

        # Create the manifest.
        my $manifest = "manifest.000";
        open MANIFEST, ">$manifest";
        binmode MANIFEST;
        print MANIFEST get_manifest( $provider, $application);
        close MANIFEST;

        # Create the _setup.xml
        my $setupxml = "_setup.xml";
        open SETUPXML, ">$setupxml";
        print SETUPXML get_setupxml( $provider, $application);
        close SETUPXML;

        # Copy the data files.
        my $munged_files = " $setupxml";
        my $i = 0;
        foreach my $file (get_value_sorted_keys %file_ids) {
                my $munged_file = munge_filename $file, ++$i;
                print "$file: $munged_file\n" if $verbose;
                `cp "$sourcedir$file" "$munged_file"`;
                exit $? >> 8 if $? > 0;
                $munged_files = ' ' . $munged_file . $munged_files;
        }
        $munged_files = 'manifest.000' . $munged_files;

        # Create the cab.
        print "$cab_filename: $munged_files\n" if $verbose;
        my $lcab_output = `lcab $munged_files $cab_filename`;
        exit $? >> 8 if $? > 0;
        print $lcab_output if $verbose;
        `rm $munged_files`;
}


# Entry-point.
main;


__END__

=head1 NAME

pocketpc-cab - build an installable Pocket PC cabinet file

=head1 SYNOPSIS

B<pocketpc-cab> [I<OPTION>]... I<INPUTFILE> I<CABINET>

=head1 DESCRIPTION
                                                                                
                                                        
Read the INPUTFILE, which is a list of filenames and destination
directories, and create CABINET, a cabinet file, that will install
those files into the specified directories.

=head1 OPTIONS

=over

=item B<-p, --provider>=I<PROVIDER>

set the provider name

=item B<-a, --application>=I<APPLICATION>

set the application name

=item B<-s, --source>=I<SOURCE>

set the source directory

=item B<-d, --dest>=I<DEST>

set the destination directory

=item B<-r, --registry>=I<REGISTRYFILE>

use a registry specification file

=item B<-v, --verbose>

display verbose output

=item B<--help>

display a brief help message

=item B<--man>

display the full documentation

=back

=head1 EXAMPLES

 $ cat > foobar.files <<EOF
 foobar.exe /bin "Shortcut Name" %CE11%
 foobar.dll /windows
 EOF
 $ cat > foobar.regkeys <<EOF
 HKCU Software/Fooware/Foobar Name string "Some string"
 HKCU Software/Fooware/Foobar Data binary 00112233445566778899aabbccddeeff
 HKCU Software/Fooware/Foobar Value integer 42
 HKCU Software/Fooware/Foobar HexValue integer 0xff
 HKCU Software/Fooware/Foobar Names multistring "String 1" "String 2"
 EOF
 $ pocketpc-cab -p Fooware -a FooBar -r foobar.regkeys foobar.files foobar.cab

=head1 AUTHOR

Written by Shaun Jackman.

=head1 REPORTING BUGS

Report bugs to Shaun Jackman <sjackman@gmail.com>.

=head1 COPYRIGHT

Copyright 2006 Shaun Jackman

This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

=head1 SEE ALSO

=over

=item B<lcab>(1)

create cabinet archives

=item B</usr/share/doc/pocketpc-cab/wince_cab_format.html>

Windows CE installation cabinet file format

=back

=cut


ChangeLog

2006-04-06  Shaun Jackman  <sjackman@gmail.com>

        * Release version 1.0.1.
        * Fix the CAB for WinCE5 by putting the manifest.000 file first in
        the cabinet file.
        Thanks to Rouven Sch\u0152rch <rouven.schuerch@tegonal.com>.

2004-09-17  Shaun Jackman  <sjackman@debian.org>

        * Initial release, version 1.0.0.