2 Rem Make an Inno Setup distribution list, where files and dirs are represented by
3 Rem sections like this:
8 Rem Source: c:\wx2stable\wxWindows\deliver2\docs\readme.txt; DestDir: {app}\docs\; DestName: readme.txt
12 Rem Generate a list of all files in the distribution.
13 Rem We have to be in the right directory already.
14 dir /BS
>& %TEMP
\files
1.tmp
16 Rem Now we iterate through the list of files, writing out the middle section of
18 Rem We have to remove the first part of the path,
19 Rem by truncating the start by the size of the current directory.
21 set sz
=%@EVAL
[%@LEN
[%_CWD
]+1]
22 set len
=%@LINES
[%TEMP
\files
1.tmp
]
24 erase /Y
%TEMP
\files
2.tmp
28 echo.
>> %temp
\files
2.tmp
29 echo [Dirs
] >> %temp
\files
2.tmp
32 set line
=%@LINE
[%TEMP
\files
1.tmp
,%i
]
34 if not isdir
%line enddo
36 set n
=%@EVAL
[%sz2
-%sz
]
37 set line2
=%@SUBSTR
[%line
,%sz
,%n
]
38 if "%line2%" == "" enddo
40 echo Name
: {app
}\
%line2
>> %TEMP
\files
2.tmp
43 echo.
>>%TEMP
\files
2.tmp
47 echo.
>> %temp
\files
2.tmp
48 echo [Files] >> %temp
\files
2.tmp
51 set line
=%@LINE
[%TEMP
\files
1.tmp
,%i
]
55 set n
=%@EVAL
[%sz2
-%sz
]
56 set line2
=%@SUBSTR
[%line
,%sz
,%n
]
57 set filename
=%@FILENAME
[%line2
]
58 set dirname
=%@
PATH[%line2
]
60 echo Source
: %line
; DestDir
: {app
}\
%dirname
; DestName
: %filename
>> %TEMP
\files
2.tmp
63 Rem Concatenate the 3 sections
64 cat
%wxwindir\distrib\msw\innotop.txt
%TEMP
\files
2.tmp
%wxwindir\distrib\msw\innobott.txt
> %wxwindir\distrib\msw\wxwin2.iss
66 erase /Y
%TEMP
\files
1.tmp
67 rem erase /Y %TEMP\files2.tmp