Subversion Repositories DevTools

Rev

Rev 1566 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1532 dpurdie 1
#! perl
2
########################################################################
3
# Copyright ( C ) 2005 ERG Limited, All rights reserved
4
#
5
# Module name   : jats.sh
6
# Module type   : Makefile system
7
# Compiler(s)   : n/a
8
# Environment(s): jats
9
#
10
# Description   : Build an Install Shield project for deployment
11
#                 This script isolates the IS build from the rest of
12
#                 the deployment process.
13
#
14
#                 Assumes that:
15
#                       IS 11.5 Standalone builder has been installed
16
#                       Merge Modules have been installed / updated
17
#                       to subdirs with the SA installation of:
18
#                           Modules\i386
19
#                           Objects
20
#
21
#                 Note: IS SA builder can be copied and registered
22
#                       The installation is very simple.
23
#                       Registartion: regsvr32.exe
24
#
25
#                       Currently this script will register the required
26
#                       DLL anyway.
27
#
28
# Usage         : Refer to POD within this script
29
#
30
#......................................................................#
31
 
1556 lkelly 32
require 5.008_006;
33
 
1532 dpurdie 34
use strict;
35
use warnings;
36
use JatsError;                              # Error reporting
1534 dpurdie 37
use JatsSystem;                             # System interface
1532 dpurdie 38
use Win32::OLE;                             # load the Win32::OLE module
39
use Pod::Usage;                             # required for help support
40
use Getopt::Long;                           # Parse input options
41
use Cwd;                                    # Where am I
42
use File::Copy;                             # Transfer files
43
use File::Path;
44
use File::Find;                             # Ony for kludge copy
45
use FileUtils;
46
 
47
my $VERSION = "1.0.0";                      # Update this
48
 
49
#
50
#   Globals
51
#
52
my $opt_debug   = $ENV{'GBE_DEBUG'};        # Allow global debug
53
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
54
my $opt_help = 0;
55
my $opt_manual;
56
 
57
my $opt_read_only = 1;
58
my $opt_use_sa = 1;
59
my $opt_build = 1;
60
my $opt_project;
61
my $opt_new_codes;
62
my $opt_name;
63
my $opt_version;
64
my $opt_suffix;
65
my $opt_outpath;
66
my @opt_mergemodule;
67
my $opt_workdir;
1538 dpurdie 68
my $opt_name_version = 1;
1564 dpurdie 69
my $opt_multi_prod = 0;
70
my $opt_multi_rel = 0;
1532 dpurdie 71
 
72
#
73
#   Kludgy values
74
#       May need to be configured
75
#       These are current IS 11.5 install locations
76
#
6481 dpurdie 77
my @AutoBuilderOLE = ('C:\Program Files\Macrovision\IS11.5',
78
                      'C:\Program Files (X86)\Macrovision\IS11.5' );
79
 
80
 
81
my @AutoBuilderSA = ('C:\Program Files\Macrovision\IS 11.5 StandaloneBuild',
82
                     'C:\Program Files (X86)\Macrovision\IS 11.5 StandaloneBuild');
83
my $AutoBuilder;
1532 dpurdie 84
my $result_code = 0;
85
 
86
#-------------------------------------------------------------------------------
87
# Function        : Mainline Entry Point
88
#
89
# Description     :
90
#
91
# Inputs          :
92
#
93
my $result = GetOptions (
94
                "help+"         => \$opt_help,              # flag, multiple use allowed
95
                "manual"        => \$opt_manual,            # flag
96
                "verbose+"      => \$opt_verbose,           # flag, multiple use allowed
97
                "readonly!"     => \$opt_read_only,         # [no]flag
98
                "standalone!"   => \$opt_use_sa,            # [no]flag
99
                "build!"        => \$opt_build,             # [no]flag
100
                "project=s"     => \$opt_project,           # string
101
                "codes!"        => \$opt_new_codes,         # [no]flag
102
                "version=s"     => \$opt_version,           # string
103
                "out=s"         => \$opt_outpath,           # string
104
                "mergemodule=s" => \@opt_mergemodule,       # string
105
                "workdir=s"     => \$opt_workdir,           # string
1538 dpurdie 106
                "nameversion!"  => \$opt_name_version,      # [no]flag
1564 dpurdie 107
                "multiprod!"    => \$opt_multi_prod,        # [no]flag no by default
108
                "multirel!"     => \$opt_multi_rel          # [no]flag no by default
1532 dpurdie 109
                );
110
 
111
                #
112
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
113
                #
114
 
115
#
116
#   Process help and manual options
117
#
118
pod2usage(-verbose => 0, -message => "Version: $VERSION") if ($opt_help == 1 || ! $result);
119
pod2usage(-verbose => 1) if ($opt_help == 2 );
120
pod2usage(-verbose => 2) if ($opt_manual || ($opt_help > 2));
121
#pod2usage(-verbose => 0, -message => "Version: $VERSION") if ( $#ARGV < 0 );
122
 
123
#
124
#   Configure the error reporting process now that we have the user options
125
#
126
ErrorConfig( 'name'    =>'ISBUILD',
127
             'verbose' => $opt_verbose,
128
            );
129
 
130
#
131
#   User must specify a project or we will attempt to locate one
132
#
133
Verbose ("Current directory: " . getcwd );
134
unless ( $opt_project )
135
{
136
    my @projects = glob ('*.ism' );
137
    Error ("No InstallShield projects found in current directory") unless ( $#projects >= 0 );
138
    Error ( "Multiple Install Shield projects located. Use -project option") if ( $#projects > 0 );
139
    $opt_project = $projects[0];
140
}
141
else
142
{
143
    Error ("Project file not found: $opt_project") unless ( -f $opt_project );
144
}
145
#
146
#   Determine project name from the project file name
147
#       - remove any path information
148
#       - remove .ism extension
149
#
150
$opt_name = $opt_project;
151
$opt_name =~ s~\\~/~g;
152
$opt_name =~ s~.*/~~;
153
$opt_name =~ s~\.ism$~~i;
154
 
155
#
156
#   User must specify a version
157
#   This will be processed and used within the build
158
#
159
Error ("Version must be specified") unless ( $opt_version );
160
Error ("Bad format for version: $opt_version") unless ( $opt_version =~ m~(\d+\.\d+\.\d+)\.(\w+)$~ );
161
$opt_version = $1;
162
$opt_suffix = $2;
163
Error ("Project suffix not found in version") unless ( $opt_suffix );
164
Message( "Package: $opt_name, Version: $opt_version, Project: $opt_suffix");
165
 
166
#
167
#   Output path must exist
168
#
169
if ( $opt_outpath )
170
{
171
    Error("Output path does not exist: $opt_outpath") unless ( -e $opt_outpath );
172
    Error("Output path is not a directory: $opt_outpath") unless ( -d $opt_outpath );
173
}
174
 
175
#
176
#   Workdir path must exist
177
#
178
$opt_workdir = getcwd unless( $opt_workdir );
179
Error("Workdir path does not exist: $opt_outpath") unless ( -e $opt_workdir );
180
Error("Workdir path is not a directory: $opt_outpath") unless ( -d $opt_workdir );
181
 
182
#
183
#   Process Merge Module paths
184
#
185
if ( @opt_mergemodule )
186
{
187
    #
188
    #   User may have entered a comma seperated list
189
    #   Convert into a full array
190
    #
191
    @opt_mergemodule = split(/,/,join(',',@opt_mergemodule));
192
 
193
    #
194
    #   Ensure that each path exists
195
    #   Clean up paths
196
    #
197
    foreach my $path ( @opt_mergemodule )
198
    {
199
        Warning ("MergeModule path not found: $path" ) unless ( -d $path );
200
        $path =~ s~/~\\~g;
201
    }
202
}
203
 
204
#
205
#   Instantiate the Developer Automation interface
206
#   Use the StandAlone interface if it can be found
207
#
208
my $dev;
209
if ( $opt_use_sa )
210
{
211
    Message "Using StandAlone OLE";
6481 dpurdie 212
    $AutoBuilder = LocateInstallShield(\@AutoBuilderSA, 'SAAuto1150.dll');
1532 dpurdie 213
 
214
    #
215
    #   Ensure the interface is registered
216
    #   This allows a simple 'copy' of the SA build environment to a build
217
    #   machine.
218
    #
219
    my $regdll = $AutoBuilder . '\SAAuto1150.dll' ;
220
    Error ("Cannot find SA OLE DLL: $regdll") unless ( -f $regdll );
221
 
222
    my $rv = System( 'regsvr32.exe', '/s', $regdll);
6481 dpurdie 223
    Warning ("Failed to register $regdll: $rv" ) if ( $rv  );
1532 dpurdie 224
 
225
    $dev = Win32::OLE->new("SAAuto1150.ISWiProject");
226
 
227
} else {
6481 dpurdie 228
 
1532 dpurdie 229
    Message "Using InstallShield OLE";
6481 dpurdie 230
    $AutoBuilder = LocateInstallShield(\@AutoBuilderOLE, 'System\isdev.exe');
1532 dpurdie 231
    $dev = Win32::OLE->new("IswiAuto1150.ISWiProject");
232
 
233
}
234
Error( "Cannot open Automation interface") unless ( $dev );
235
 
236
#
237
#   Open a project as read-write
238
#   The second argument ( if true ) will open as read only
239
#
240
Verbose ("Opening project: $opt_project, ReadOnly: $opt_read_only" );
241
$dev->OpenProject( $opt_project, $opt_read_only );
242
my $estring = Win32::OLE->LastError();
243
Error( $estring ) if ( $estring );
244
Verbose ("Project Open");
245
 
246
#DebugDumpData("Dev", $dev );
247
 
248
#
1538 dpurdie 249
#   Massage the ProductName [ if required ]
1532 dpurdie 250
#   Should contain a comma<space><version>
251
#
1538 dpurdie 252
if ( $opt_name_version )
1532 dpurdie 253
{
1538 dpurdie 254
    Verbose( "Update ProductName" );
255
    Verbose( "Originial ProductName   :" . $dev->ProductName);
256
    my $product_name = $dev->ProductName;
257
    if ( $product_name =~ m/^(.*),/ )
258
    {
259
        $product_name = $1;
260
    }
261
    $product_name .= ', ' . $opt_version . '.' . $opt_suffix;
262
    $dev->SetProperty('ProductName', $product_name );
1532 dpurdie 263
}
264
Message( "ProductName   :" . $dev->ProductName);
265
 
266
#
267
#   Massage the ProjectVersion
268
#   This will not have the project suffix on it
269
#
270
Verbose( "Update ProductVersion" );
271
Verbose( "Original ProductVersion:" . $dev->ProductVersion);
272
$dev->SetProperty('ProductVersion', $opt_version );
273
Message ("ProductVersion:" . $dev->ProductVersion);
274
 
275
#
276
#   If we need to generate new codes
277
#
278
if ( $opt_new_codes )
279
{
280
    Message ("Update GUIDs");
281
    $dev->SetProperty('PackageCode', $dev->GenerateGUID() );
282
    $dev->SetProperty('ProductCode', $dev->GenerateGUID() );
283
    $dev->SetProperty('UpgradeCode', $dev->GenerateGUID() );
284
}
285
Message ("PackageCode   :" . $dev->PackageCode );
286
Message ("ProductCode   :" . $dev->ProductCode );
287
Message ("UpgradeCode   :" . $dev->UpgradeCode );
288
 
289
#
290
#   Examine all components and display the files within each
291
#   The files are a collection and need to be processed in a special manner
292
#
293
if ( $opt_verbose )
294
{
295
    Verbose ("InstallShield Components");
296
    my $mycomps = $dev->ISWiComponents;
297
    foreach my $comp (in $mycomps)
298
    {
299
        Verbose ("Component: " . $comp->Name, ": ", $comp->Destination );
300
 
301
        my $files = $comp->ISWiFiles;
302
        my $fileCount = $files->Count;
303
        Verbose ("Number of Files: $fileCount");
304
 
305
        foreach my $index ( 1 .. $fileCount )
306
        {
307
            Verbose ("           Name: " . $files->Item($index)->Name );
308
            Verbose ("    DisplayName: " . $files->Item($index)->DisplayName );
309
            Verbose ("       FullPath: " .  $files->Item($index)->FullPath );
310
        }
311
    }
312
}
313
 
314
#
315
#   Examine all the Features
316
#
317
if ( $opt_verbose  )
318
{
319
    Verbose ("InstallShield Features");
320
    my $myfeature = $dev->ISWiFeatures;
321
    foreach my $feat (in $myfeature)
322
    {
323
        Verbose ("Feature: " . $feat->Name, ": ", $feat->Description );
324
    }
325
}
326
 
327
#
328
#   Display Releases
329
#   These are found within the product config
330
#   We need to locate the Release in order to build it
331
#
332
Verbose ("InstallShield Products");
333
my $products = $dev->ISWiProductConfigs;
1564 dpurdie 334
 
335
# if we are building check to make sure -multiprod is enabled if more than 1 product configuration is configured
336
# and/or more than 1 release per product configuration
337
if ( $opt_build )
338
{
339
    Error("Multiple Product Configurations found, -multiprod must be specified to build them all") 
340
        if ( $products->Count > 1 && !$opt_multi_prod );
341
 
342
    foreach my $p ( 1 .. $products->Count )
343
    {
344
        Error("Multiple Releases found for a Product Configuration, -multirel must be specified to build them all") 
345
            if ( $products->Item($p)->ISWiReleases->Count > 1 && !$opt_multi_rel );
346
    }
347
}
348
 
349
 
1532 dpurdie 350
foreach my $index ( 1 .. $products->Count )
351
{
352
    my $product = $products->Item($index);
353
 
354
    Verbose ("Product Index  : " . $index );
355
    Verbose ("  Product Name : " . $product->Name );
356
    Verbose ("  SetupFileName: " . $product->SetupFileName );
357
 
358
    my $releases = $product->ISWiReleases;
359
    foreach my $index ( 1 .. $releases->Count )
360
    {
361
        my $release = $releases->Item($index);
362
 
363
        Verbose ("Release Index      : " . $index );
364
        Verbose ("  Name             : " . $release->Name );
365
        Verbose ("  BuildLocation    : " . $release->BuildLocation );
366
        Verbose ("  SingleEXEFileName: " . ( $release->SingleEXEFileName || 'None Specified' ) );
367
 
368
        #
369
        #   Build the Project
370
        #   Not working at the moment !!!!
371
        #
372
        if ( $opt_build )
373
        {
374
            Message ("Building...");
375
 
376
            #
377
            #   Set build location
378
            #
379
            my $location = $opt_workdir . '/Media';
380
            $location =~ s~/~\\~g;
381
            $release->SetProperty('BuildLocation', $location );
1564 dpurdie 382
            Message ("New BuildLocation: " . $release->BuildLocation );
1532 dpurdie 383
 
1564 dpurdie 384
            #
385
            #   Massage the ProductName [ if required ]
386
            #   Only update ProductName for this product Configuration if nameversion is supplied and the
387
            #   product Configuration has a product Name.  
388
            #   This overrides the default project product name for this product Configuration.
389
            #   Should contain a comma<space><version>
390
            #
391
            if ( $opt_name_version && $product->ProductName ne "" )
392
            {
393
                Verbose( "Update ProductName for this Product Configuration" );
394
                Verbose( "Originial ProductName   :" . $product->ProductName);
395
                my $product_name = $product->ProductName;
396
                if ( $product_name =~ m/^(.*),/ )
397
                {
398
                    $product_name = $1;
399
                }
400
                $product_name .= ', ' . $opt_version . '.' . $opt_suffix;
401
                $product->SetProperty('ProductName', $product_name );
402
                Message( "New ProductName   :" . $product->ProductName);
403
            }
1532 dpurdie 404
 
405
            #
1564 dpurdie 406
            #   Update the Product version [ if required ]
407
            #   Only update Product Version for this Product Configuration if the current Product 
408
            #   Version has a value.  
409
            #   This overrides the default project version for this product Configuration.
410
            #
411
            if ( $product->ProductVersion ne "" )
412
            {
413
                Verbose( "Update ProductVersion for this Product Configuration" );
414
                Verbose( "Original ProductVersion:" . $product->ProductVersion);
415
                $product->SetProperty('ProductVersion', $opt_version );
416
                Message ("New ProductVersion:" . $product->ProductVersion);
417
            }
418
 
419
            #
1532 dpurdie 420
            #   If building with the Standalone interface will need to set
421
            #   up the merge module paths
422
            #
423
            if ( $opt_use_sa )
424
            {
425
                foreach my $dir ( @opt_mergemodule )
426
                {
427
                    Error ("MergeModule Directory not found: $dir") unless ( -d $dir );
428
                    Verbose( "Merge Module Search Path:", $dir );
429
                }
430
                $dev->SetProperty('MergeModuleSearchPath', join (',', @opt_mergemodule));
431
                Verbose2 ( "MergeModulePath: " . $dev->MergeModuleSearchPath );
432
 
433
                #
434
                #   See comments in this function
435
                #
436
                kludge_merge_module_stuff(@opt_mergemodule);
437
            }
438
 
439
            #
440
            #   Set thename of the setup file
441
            #   This contains the build name and number
442
            #
443
            Verbose ("Setting Setup Filename");
444
            Verbose2 ( "Initial SetupFileName: " . $product->SetupFileName );
1564 dpurdie 445
            my $setup_name  = $opt_name . '-';
446
               $setup_name .= $product->Name . '-' if ($opt_multi_prod);
447
               $setup_name .= $release->Name . '-' if ($opt_multi_rel);
448
               $setup_name .= $dev->ProductVersion
449
                           .  '.'
450
                           .  $opt_suffix
451
                           .  '-WIN32';
1532 dpurdie 452
 
453
            $product->SetProperty('SetupFileName', $setup_name );
454
            Message( "SetupFileName: " . $product->SetupFileName );
455
 
456
            #
1566 dpurdie 457
            #   Determine the directory IS will use for logging
458
            #   Note: $logdir has spaces in the name and requires special care
459
            #
460
            my $logdir = $release->BuildLocation . "/ishield package/Release/LogFiles";
461
            $logdir =~ tr~\\/~/~s;
462
 
463
            #
464
            #   Delete old log files
465
            #
466
            if ( opendir (my $ld, $logdir) )
467
            {
468
                my @dirlist = readdir $ld;
469
                closedir $ld;
470
 
471
                foreach my $logfile ( @dirlist )
472
                {
473
                    next unless ( $logfile =~ m~\.txt$~i );
474
                    unlink  $logdir . '/' . $logfile;
475
                }
476
            }
477
 
478
            #
1532 dpurdie 479
            #   Perform the build and report errors and warnings
480
            #
481
            $release->Build;
482
            $result_code = $release->BuildErrorCount;
483
            Message ("Build Error Count  : " . $release->BuildErrorCount );
484
            Message ("Build Warning Count: " . $release->BuildWarningCount );
485
 
486
            #
1566 dpurdie 487
            #   Display log file ( if an error has been seen )
488
            #   There should be only ONE log file
489
            #   Reconfigure error reporting system to simplify logging
490
            #
491
            if ( $result_code || IsVerbose(1) )
492
            {
493
                if ( opendir (my $ld, $logdir) )
494
                {
495
                    my @dirlist = readdir $ld;
496
                    closedir $ld;
497
 
498
                    foreach my $logfile ( @dirlist )
499
                    {
500
                        next unless ( $logfile =~ m~\.txt$~i );
501
                        Message ("Dumping InstallShield Log File: $logfile");
502
                        my $estate = ErrorReConfig ('name' => 'ISLOG');
503
                        if ( open (my $lf, "<", $logdir . '/' . $logfile) )
504
                        {
505
                            while ( <$lf> )
506
                            {
507
                                $_ =~ s~\s+$~~;
508
                                Message ( $_ );
509
                            }
510
                            close $lf;
511
                        }
512
                        else
513
                        {
514
                            Warning ("Can't open file: $logfile",  "Reason: $!" );
515
                        }
516
                    }
517
                }
518
                else
519
                {
520
                    Warning( "InstallShield Log dir not found: $logdir")
521
                }
522
            }
523
 
524
            #
1532 dpurdie 525
            #   Transfer the result file to the user
526
            #
527
            if ( $result_code == 0 && $opt_outpath )
528
            {
529
                Message("Transfer output file: $opt_outpath");
1564 dpurdie 530
                my $ofile = $location . "/" . $product->Name . "/" . $release->Name . "/DiskImages/DISK1/" . $setup_name . '.exe';
1532 dpurdie 531
                Error ("Build output file not found", "Expected: $ofile" ) unless ( -f $ofile );
532
 
533
                File::Copy::copy( $ofile, $opt_outpath) ||
534
                    Error ("Did not transfer InstallShield output file", $ofile, $opt_outpath);
535
            }
536
        }
537
    }
538
}
539
 
540
#
541
#   Save and Close the project
542
#   Release the OLE data
543
#
544
$dev->SaveProject( ) unless ($opt_read_only);
545
$dev->CloseProject( );
546
undef $dev;
547
 
548
#
549
#   Return build result to the user
550
#
551
exit $result_code;
552
 
553
#-------------------------------------------------------------------------------
6481 dpurdie 554
# Function        : LocateInstallShield  
555
#
556
# Description     : Locate the InstallShield installation
557
#
558
# Inputs          : $dirList        - List of potential installation locations
559
#                   $tFile          - File to locate 
560
#
561
# Returns         : First installed path
562
#                   Will not return on error
563
#
564
sub LocateInstallShield {
565
    my ($dirList, $tFile) = @_;
566
 
567
    #
568
    #   Use EnvVar if it has been provided
569
    #
570
    if (exists $ENV{GBE_INSTALLSHIELD}) {
571
        $AutoBuilder = $ENV{GBE_INSTALLSHIELD};
572
        Error ("EnvVar GBE_INSTALLSHIELD does not address valid directory") unless -d $AutoBuilder;
573
 
574
        my $tPath = join ('\\', $AutoBuilder, $tFile );
575
        Error ("EnvVar GBE_INSTALLSHIELD does not reference a suitable directory") unless -f $tPath;
576
 
577
        return $AutoBuilder; 
578
    }
579
 
580
    #
581
    #   Locate the installed program in the list of user paths
582
    #
583
    foreach my $AutoBuilder (@{$dirList})
584
    {
585
        my $tPath = join ('\\', $AutoBuilder, $tFile );
586
        if (-f $tPath) {
587
            return $AutoBuilder; 
588
        }
589
    }
590
 
591
    Error('Cannot find InstallShield. You need to install either',
592
          'InstallShieldStandAloneBuilder',
593
          'InstallShield 11.5 Pro');
594
}
595
 
596
 
597
#-------------------------------------------------------------------------------
1532 dpurdie 598
# Function        : kludge_merge_module_stuff
599
#
600
# Description     : Handle BUG in the SA builder
601
#
602
#   The current version of InstallShield StandAlone Builder has a bug associated
603
#   with the processing of Merge Modules
604
#
605
#   It would appear that the search path is not fully used
606
#   There is a interaction between the ObjectGallery directory and
607
#   the processing of Merge modules.
608
#
609
#   The problem (that I see) is solved by deleting the ObjectGallery
610
#   but InstallShield do not recomment this solution.
611
#
612
#   They recommend that the Object and Modules be copied into the
613
#   'C:\Program Files\Macrovision\IS 11.5 StandaloneBuild' directory
614
#   There are a few bug reports out for this one.
615
#   With luck this problem will be solved and this code can be removed
616
#
617
#   The solution that I have taken is to transfer the Object and
618
#   Modules directories as suggseted. This is UGLY:
619
#       Makes the build single user
620
#       Modifies the build environment
621
#       Time consuming
622
#
623
#
624
#
625
# Inputs          : List of Merge Module paths
626
#
627
# Returns         : Nothing
628
#
629
my $kludge_copy_dir_len;
630
my $kludge_copy_dir;
631
 
632
sub kludge_merge_module_stuff
633
{
634
    my (@mergemodules) = @_;
635
    foreach my $dir ( @mergemodules )
636
    {
637
        next if ( $dir =~ m/Merge Modules$/ );
638
        Message("KLUDGE copy: [$dir] to [$AutoBuilder]");
639
        $kludge_copy_dir = $dir;
640
        $kludge_copy_dir =~ s~\\+~/~g;
641
        $kludge_copy_dir =~ s~/$~~;
1556 lkelly 642
        $kludge_copy_dir =~ m~(.+/MergeModules)/~;
643
        $kludge_copy_dir_len = length($1);
1532 dpurdie 644
 
645
        File::Find::find( \&kludge_copy, $dir);
646
    }
647
}
648
 
649
sub kludge_copy
650
{
651
    my $item = $File::Find::name;
652
    my $base = $_;
653
    my $tpath =  $AutoBuilder . substr( $item, $kludge_copy_dir_len );
654
 
655
    if ( -d $item )
656
    {
657
        unless ( -d $tpath )
658
        {
659
            Verbose( "Create Directory: $tpath");
660
            mkpath("$tpath", 1, 0775) || Error ("Cannot mkdir: $tpath");
661
        }
662
    }
663
    else
664
    {
665
        if ( FileIsNewer( $item, $tpath ) )
666
        {
667
            Verbose ("Copy File: tpath");
668
            File::Copy::copy($item, $tpath) || Error("Copying: $tpath");
669
        }
670
    }
671
}
672
 
673
#-------------------------------------------------------------------------------
674
#   Documentation
675
#
676
 
677
=pod
678
 
679
=head1 NAME
680
 
681
isbuild - Build an Install Shield Project
682
 
683
=head1 SYNOPSIS
684
 
685
jats eprog isbuild.pl [options]
686
 
687
 Options:
688
    -help              - brief help message
689
    -help -help        - Detailed help message
690
    -man               - Full documentation
691
    -version=version   - Specify build version
692
    -project=name      - Specifies the project to process
693
    -out=path          - Output directory (optional)
694
    -mergemodule=path  - Path to one or more merge modules
695
    -workdir=path      - Path to working directory base
696
    -[no]readonly      - Open project in readonly mode
697
    -[no]standalone    - Use SA or IS automation interface
698
    -[no]build         - Build project
699
    -[no]codes         - Modify GUID codes in release
1538 dpurdie 700
    -[no]nameversion   - Add Version info to ProductName (default)
1564 dpurdie 701
    -[no]multiprod     - Builds multiple product configurations (off by default)
702
    -[no]multirel      - Builds multiple releases per product configuration (off by default)
1532 dpurdie 703
 
704
=head1 OPTIONS
705
 
706
=over 8
707
 
708
=item B<-help>
709
 
710
Print a brief help message and exits.
711
 
712
=item B<-help -help>
713
 
714
Print a detailed help message with an explanation for each option.
715
 
716
=item B<-man>
717
 
718
Prints the manual page and exits.
719
 
720
=item B<-version=version>
721
 
722
This option is essential. It is used to specify the output package version.
723
The version information will be inserted in the InstallShield project before
724
it is compiled.
725
 
726
=item B<-project=name>
727
 
728
This option specifies the InstallShield project to be processed. If not project
729
name is specified then this script will locate an '.ism' file in the current
730
directory and use it. Multiple '.ism' files are not supported.
731
 
732
=item B<-out=path>
733
 
734
Specifies the output path. If specified the InstallShield project will by
735
moved to this directory, if it is build successfully.
736
 
737
The path must exist and it must be a directory.
738
 
739
=item B<-mergemodule=path>
740
 
741
This option specifies one or more merge module paths to be used by the Install
742
Shield compiler. Multiple paths may be specified with multiple directives or
743
as a comma seperated list.
744
 
745
=item B<-workdir=path>
746
 
747
This option specifies the path of a directory in which this program will create
748
its working directory. If not specified then the current directory will be
749
used.
750
 
751
=item B<-readony>
752
 
753
Open the project in readonly mode. This is the default
754
Changes to the project are not written back.
755
 
756
=item B<-standalone>
757
 
758
Invoke the StandAlone Install Shield builder. This is the default.
759
 
760
If B<-nostandalone> is specified then the InstallShield IDE Automation interface
761
is used. This may not be the same as that on the build machine.
762
 
763
=item B<-build>
764
 
765
Build the project. This is the default mode of operation.
766
 
767
If B<-nobuild> is specified then the project will not be built. All other
768
operations will be performed.
769
 
770
 
771
=item B<-codes>
772
 
773
If specified then the following GUID elements are rolled:
774
 
775
=over 8
776
 
777
=item * PackageCode
778
 
779
=item * ProductCode
780
 
781
=item * UpgradeCode
782
 
783
=back
784
 
785
The default operation is to NOT roll the specified GUID elements.
786
 
1538 dpurdie 787
=item B<-nameversion>
788
 
789
This option Add Version information to the Product Name.
790
 
1564 dpurdie 791
Additionally now if there are any Product Configurations in the Release view
792
of the project that have a value in the Product Name for that configuration then
793
they to will be modified in the same way.
794
 
1538 dpurdie 795
The default operation will add Version Information. Use -nonameversion to disable
796
this operation.
797
 
1564 dpurdie 798
=item B<-multiprod>
799
 
800
This option builds multiple product configurations from the single IS project.
801
 
802
The Releases view in Installshield allows multiple Product Configurations to 
803
be configured and built. This must be specified if the project contains more 
804
than 1 Product Configuration, but can also be used with a single configuration.
805
If there are multiple release for any Product Configuration then -multirel must
806
be specified as well.
807
 
808
This uses the Product Configuration Name, that is the name given to this Product
809
Configuration that appears in the Releases tree view of Installshield.
810
 
811
This name is used to modify the name to the final setup executable and is
812
appended to the Project Name.  For example each product configuration will
813
have a setup exe named 
814
   <ProjectName>-<ProductConfigName>-<Version>.<Suffix>-WIN32
815
 
816
Additionally if nameversion is active and a product configuration has a Product Name
817
then it to will be updated as per -nameversion option.
818
 
819
=item B<-multirel>
820
 
821
This option builds multiple releases per product configuration from the single 
822
IS project.
823
 
824
The Releases view in Installshield allows multiple releases per product 
825
configuration to be configured and built. This must be specified if the project 
826
contains more than 1 release per product configuration, but can also be used 
827
with a single release per product configuration.
828
 
829
This uses the Release Name, that is the name given to this Release for this Product
830
Configuration and appears under the Product Configuration in the Releases tree view 
831
of Installshield.
832
 
833
This name is used to modify the name to the final setup executable and is appended to 
834
the Project Name or Product Configuration name if -multiprod is enabled.  For example
835
If -multiprod is specified as well, each release of each product configuration
836
will have a setup exe named
837
   <ProjectName>-<ProductConfigName>-<ReleaseName>-<Version>.<Suffix>-WIN32
838
If -multiprod is Not specified, each release of the single product configuration
839
will have a setup exe named
840
   <ProjectName>-<ReleaseName>-<Version>.<Suffix>-WIN32
841
 
1532 dpurdie 842
=back
843
 
844
=head1 DESCRIPTION
845
 
846
This program is used within the ERG deployment process to build up an Install
847
Shield project.
848
 
849
=head1 EXAMPLE
850
 
851
 
852
=cut
853