Menu

[r3]: / trunk / Src / InstallHelper / Build.bat  Maximize  Restore  History

Download this file

203 lines (151 with data), 5.6 kB

  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
@rem ---------------------------------------------------------------------------
@rem Script used to build the DelphiDabbler CodeSnip Install Helper.
@rem
@rem Copyright (C) Peter Johnson (www.delphidabbler.com), 2008.
@rem
@rem v1.0 of 14 Aug 2008 - First version.
@rem v1.1 of 24 Aug 2008 - Modified to work witrh Delphi 2006
@rem
@rem
@rem Requires:
@rem Borland Delphi 2006
@rem Borland BRCC32 from Delphi 2006 installation
@rem DelphiDabbler Version Information Editor from www.delphidabbler.com.
@rem
@rem Also requires the following environment variables:
@rem DELPHI2006 to be set to the install directory of Delphi 2006.
@rem
@rem Switches: there are no recognised switches
@rem
@rem ---------------------------------------------------------------------------
@echo off
setlocal
rem ----------------------------------------------------------------------------
rem Sign on
rem ----------------------------------------------------------------------------
title DelphiDabbler CodeSnip Install Helper Build Script
echo DelphiDabbler CodeSnip Install Helper Build Script
echo --------------------------------------------------
rem ----------------------------------------------------------------------------
rem Check that required environment variables exist
rem ----------------------------------------------------------------------------
:CheckEnvVars
echo Checking predefined environment environment variables
if not defined DELPHI2006 goto BadDELPHIEnv
echo Done.
echo.
goto SetEnvVars
:BadDELPHIEnv
set ErrorMsg=DELPHI2006 Environment variable not defined
goto Error
rem ----------------------------------------------------------------------------
rem Set up required environment variables
rem ----------------------------------------------------------------------------
:SetEnvVars
echo Setting Up Environment
rem set up environment for MS SDK
rem directories
rem source directory
set SrcDir=.\
rem binary files directory
set BinDir=..\..\Bin\InstallHelper\
rem executable files directory
set ExeDir=..\..\Exe\
rem executable programs
rem Delphi 7 - use full path since maybe multple installations
set DCC32Exe="%DELPHI2006%\Bin\DCC32.exe"
rem Borland Resource Compiler - use full path since maybe multple installations
set BRCC32Exe="%DELPHI2006%\Bin\BRCC32.exe"
rem DelphiDabbler Version Information Editor - assumed to be on the path
set VIEdExe=VIEd.exe
echo Done.
echo.
rem ----------------------------------------------------------------------------
rem Start of build process
rem ----------------------------------------------------------------------------
:Build
echo BUILDING ...
echo.
rem ----------------------------------------------------------------------------
rem Build resource files
rem ----------------------------------------------------------------------------
echo Building Resources
echo.
rem set required env vars
rem Ver info resource
set VerInfoBase=VCSSetupHelper
set VerInfoSrc=%SrcDir%%VerInfoBase%.vi
set VerInfoTmp=%SrcDir%%VerInfoBase%.rc
set VerInfoRes=%BinDir%%VerInfoBase%.res
rem General resource
set ResourcesBase=CSSetupHelperRes
set ResourcesSrc=%SrcDir%%ResourcesBase%.rc
set ResourcesRes=%BinDir%%ResourcesBase%.res
rem Compile version information resource
echo Compiling %VerInfoSrc% to %VerInfoRes%
rem VIedExe creates temp resource .rc file from .vi file
set ErrorMsg=
%VIEdExe% -makerc %VerInfoSrc%
if errorlevel 1 set ErrorMsg=Failed to compile %VerInfoSrc%
if not "%ErrorMsg%"=="" goto VerInfoRes_End
rem BRCC32Exe compiles temp resource .rc file to required .res
%BRCC32Exe% %VerInfoTmp% -fo%VerInfoRes%
if errorlevel 1 set ErrorMsg=Failed to compile %VerInfoTmp%
if not "%ErrorMsg%"=="" goto VerInfoRes_End
echo Done
echo.
:VerInfoRes_End
if exist %VerInfoTmp% del %VerInfoTmp%
if not "%ErrorMsg%"=="" goto Error
rem Compile general resource
echo Compiling %ResourcesSrc% to %ResourcesRes%
%BRCC32Exe% %ResourcesSrc% -fo%ResourcesRes%
if errorlevel 1 goto ResourcesRes_Error
echo Done
echo.
goto ResourcesRes_End
:ResourcesRes_Error
set ErrorMsg=Failed to compile %ResourcesSrc%
goto Error
:ResourcesRes_End
rem End of resource compilation
rem ----------------------------------------------------------------------------
rem Build Pascal project
rem ----------------------------------------------------------------------------
rem Set up required env vars
set PascalBase=CSSetupHelper
set PascalSrc=%SrcDir%%PascalBase%.dpr
set PascalExe=%ExeDir%%PascalBase%.exe
echo Building Pascal Project
%DCC32Exe% -B %PascalSrc%
if errorlevel 1 goto Pascal_Error
goto Pascal_End
:Pascal_Error
set ErrorMsg=Failed to compile %PascalSrc%
if exist %PascalExe% del %PascalExe%
goto Error
:Pascal_End
echo Done.
echo.
rem End of Pascal compilation
rem ----------------------------------------------------------------------------
rem Build completed
rem ----------------------------------------------------------------------------
:Build_End
echo BUILD COMPLETE
echo.
goto End
rem ----------------------------------------------------------------------------
rem Handle errors
rem ----------------------------------------------------------------------------
:Error
echo.
echo *** ERROR: %ErrorMsg%
echo.
rem ----------------------------------------------------------------------------
rem Finished
rem ----------------------------------------------------------------------------
:End
echo.
echo DONE.
endlocal
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.