mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-13 08:01:33 +01:00
build .cabs for .dlls (based on same for .exes)
This commit is contained in:
parent
a91fd28773
commit
5fa3e2209c
1 changed files with 61 additions and 0 deletions
61
xwords4/wince/dll2cab.pl
Executable file
61
xwords4/wince/dll2cab.pl
Executable file
|
@ -0,0 +1,61 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# Script for turning the Crosswords executable into a cab, along with
|
||||
# a shortcut in the games menu
|
||||
|
||||
use strict;
|
||||
|
||||
sub main() {
|
||||
my $provider = "\"Crosswords project\"";
|
||||
|
||||
usage() if 1 != @ARGV;
|
||||
|
||||
my $path = shift @ARGV;
|
||||
|
||||
usage() unless $path =~ m|.dll$|;
|
||||
|
||||
die "$path not found\n" unless -f $path;
|
||||
|
||||
my $cabname = `basename $path`;
|
||||
chomp $cabname;
|
||||
|
||||
# Create a link. The format, says Shaun, is
|
||||
# <number of characters>#command line<no carriage return or line feed>
|
||||
|
||||
my $userName = $cabname;
|
||||
my $cmdline = "\"\\Program Files\\Crosswords\\" . $userName . "\"";
|
||||
my $cmdlen = length( $cmdline );
|
||||
|
||||
$cabname =~ s/.dll$//;
|
||||
|
||||
my $fname = "/tmp/file$$.list";
|
||||
|
||||
# see this url for %CE5% and other definitions:
|
||||
# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/DevGuideSP/html/sp_wce51consmartphonewindowscestringsozup.asp
|
||||
|
||||
open FILE, "> $fname";
|
||||
|
||||
my $tmpfile = "/tmp/$userName";
|
||||
`cp $path $tmpfile`;
|
||||
print FILE "$tmpfile ";
|
||||
print FILE '%CE1%\\Crosswords', "\n";
|
||||
|
||||
close FILE;
|
||||
|
||||
my $appname = $cabname;
|
||||
$cabname .= ".cab";
|
||||
|
||||
my $cmd = "pocketpc-cab -p $provider -a $appname "
|
||||
. "$fname $cabname";
|
||||
print( STDERR $cmd, "\n");
|
||||
`$cmd`;
|
||||
|
||||
# unlink $linkName, $tmpfile;
|
||||
}
|
||||
|
||||
sub usage() {
|
||||
print STDERR "usage: $0 path/to/xwords4_language.dll\n";
|
||||
exit 2;
|
||||
}
|
||||
|
||||
main();
|
Loading…
Reference in a new issue