Subversion Repositories DevTools

Rev

Rev 2434 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2434 Rev 6419
Line 45... Line 45...
45
#                       --Package=Name          - Use this package name instead
45
#                       --Package=Name          - Use this package name instead
46
#                                                 of the build's name.
46
#                                                 of the build's name.
47
#                                                 Not suggested
47
#                                                 Not suggested
48
#                       --Plain                 - No frills
48
#                       --Plain                 - No frills
49
#                       --NoPackage             - Do not package the installer
49
#                       --NoPackage             - Do not package the installer
-
 
50
#                       --RecipeTag=name        - Tag this recipe
-
 
51
#                       --PkgArch=arch          - Override default architecture
-
 
52
#                                                 Default WIN32 or X64
50
#
53
#
51
#
54
#
52
# Returns         : Will not return on error
55
# Returns         : Will not return on error
53
#
56
#
54
 
57
 
Line 60... Line 63...
60
    my $ofile;
63
    my $ofile;
61
    my @defines;
64
    my @defines;
62
    my @genargs;
65
    my @genargs;
63
    my $package = $ScmBuildPackage;
66
    my $package = $ScmBuildPackage;
64
    my $noPackage;
67
    my $noPackage;
-
 
68
    my @passThroughArgs;
-
 
69
    my $pkgArch = GetGlobalOption('PACKAGE_ARCH', 'WIN32');
65
 
70
 
66
    return if ( ! ActivePlatform($platforms) );
71
    return if ( ! ActivePlatform($platforms) );
67
 
72
 
68
    #
73
    #
69
    #   Parse the command line arguments
74
    #   Parse the command line arguments
Line 90... Line 95...
90
            $package = $1;
95
            $package = $1;
91
 
96
 
92
        } elsif  ( m~^--NoPackage~i ) {
97
        } elsif  ( m~^--NoPackage~i ) {
93
            $noPackage = 1;
98
            $noPackage = 1;
94
            
99
            
-
 
100
        } elsif  ( m~^--RecipeTag=~i ) {
-
 
101
            push @passThroughArgs, $_;
-
 
102
 
-
 
103
        } elsif  ( m~^--PkgArch=(.+)~i ) {
-
 
104
            $pkgArch = $1;
-
 
105
 
-
 
106
 
95
        } else {
107
        } else {
96
            Warning ("nsisDirective: Unknown option ignored: $_");
108
            Warning ("nsisDirective: Unknown option ignored: $_");
97
        }
109
        }
98
    }
110
    }
99
 
111
 
100
    #
112
    #
101
    #   Sanity Tests
113
    #   Sanity Tests
102
    #
114
    #
103
    Error ("nsisDirective: No script specified" ) unless ( @scripts );
115
    Error ("nsisDirective: No script specified" ) unless ( @scripts );
-
 
116
    Error ("PkgArch is not specified") unless (defined $pkgArch && (length($pkgArch)  > 0));
104
    $vlevel = 4 if ( $vlevel > 4 );
117
    $vlevel = 4 if ( $vlevel > 4 );
105
    $vlevel = 0 if ( $vlevel < 0 );
118
    $vlevel = 0 if ( $vlevel < 0 );
106
 
119
 
107
    #
120
    #
108
    #   Create a 'nice' executable name, unless one has been provided
121
    #   Create a 'nice' executable name, unless one has been provided
Line 110... Line 123...
110
    #
123
    #
111
    #   Note: Fix platform to WIN32 incase the installer is based on other
124
    #   Note: Fix platform to WIN32 incase the installer is based on other
112
    #         platforms (ie: VS2005) as that would be most confusing.
125
    #         platforms (ie: VS2005) as that would be most confusing.
113
    #         Could be based on machine type.
126
    #         Could be based on machine type.
114
    #
127
    #
115
    $ofile = "$package-$ScmBuildVersion.$ScmBuildProject-WIN32"
128
    $ofile = "$package-$ScmBuildVersion.$ScmBuildProject-$pkgArch"
116
        unless ( $ofile );
129
        unless ( $ofile );
117
    $ofile .= '.exe'
130
    $ofile .= '.exe'
118
        unless ( $ofile =~ m~\.exe$~i );
131
        unless ( $ofile =~ m~\.exe$~i );
119
    Error ("MakeNsisPackage. Multiple packages with the same name: $ofile")
132
    Error ("MakeNsisPackage. Multiple packages with the same name: $ofile")
120
        if ( exists $MakeNsisPackage_names{$ofile} );
133
        if ( exists $MakeNsisPackage_names{$ofile} );
Line 130... Line 143...
130
    $MakeNsisPackage_names{$ofile} = $dfile;
143
    $MakeNsisPackage_names{$ofile} = $dfile;
131
 
144
 
132
    #
145
    #
133
    #   Create build time values in a file suitable for NSIS to include
146
    #   Create build time values in a file suitable for NSIS to include
134
    #
147
    #
-
 
148
    push @genargs, '-PkgArch=' . $pkgArch;
135
    GenerateFiles ('*', '--Tool=MakeNsisDefs.pl',
149
    GenerateFiles ('*', '--Tool=MakeNsisDefs.pl',
136
                   '-installer=' . $ofile,
150
                   '-installer=' . $ofile,
137
                   @genargs,
151
                   @genargs,
138
                   '-out=--Generated('.$dfile.')' );
152
                   '-out=--Generated('.$dfile.')' );
139
 
153
 
Line 141... Line 155...
141
    #   Invoke 'makensis' to do the hard work
155
    #   Invoke 'makensis' to do the hard work
142
    #
156
    #
143
    GenerateFiles ('*', 'makensis' ,
157
    GenerateFiles ('*', 'makensis' ,
144
                        $noPackage ? '--NoGenerate' : '--AutoGenerate',
158
                        $noPackage ? '--NoGenerate' : '--AutoGenerate',
145
                        '--Text=' . $ofile,
159
                        '--Text=' . $ofile,
-
 
160
                        @passThroughArgs,
146
                        '--NoVarTag',
161
                        '--NoVarTag',
147
                        '--UnknownPreq',
162
                        '--UnknownPreq',
148
                        '--CreatedProg='. $ofile,
163
                        '--CreatedProg='. $ofile,
149
                        '/NOCONFIG',
164
                        '/NOCONFIG',
150
                        '/NOCD',
165
                        '/NOCD',