os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tools/genWinImage.tcl
Update contrib.
3 # This script generates the Windows installer.
5 # Copyright (c) 1999 by Scriptics Corporation.
8 # RCS: @(#) $Id: genWinImage.tcl,v 1.5 2000/04/25 22:29:21 hobbs Exp $
11 # This file is insensitive to the directory from which it is invoked.
13 namespace eval genWinImage {
16 # This variable points to the platform specific tools directory.
22 # This variable points to the directory containing the Tcl built tree.
28 # This variable points to the directory containing the Tk built tree.
32 # our script name at runtime
33 variable script [info script]
36 # genWinImage::init --
38 # This is the main entry point.
46 proc genWinImage::init {} {
47 global tcl_platform argv argv0
53 puts "\n--- $script started: \
54 [clock format [clock seconds] -format "%Y%m%d-%H:%M"] --\n"
56 if {$tcl_platform(platform) != "windows"} {
57 puts stderr "ERROR: Cannot build TCL.EXE on Unix systems"
61 if {[llength $argv] != 3} {
62 puts stderr "usage: $argv0 <tclBuildDir> <tkBuildDir> <toolsDir>"
66 set tclBuildDir [lindex $argv 0]
67 set tkBuildDir [lindex $argv 1]
68 set toolsDir [lindex $argv 2]
72 puts "\n--- $script finished: \
73 [clock format [clock seconds] -format "%Y%m%d-%H:%M"] --\n\n"
76 # genWinImage::makeTextFile --
78 # Convert the input file into a CRLF terminated text file.
81 # infile The input file to convert.
82 # outfile The location where the text file should be stored.
87 proc genWinImage::makeTextFile {infile outfile} {
88 set f [open $infile r]
91 set f [open $outfile w]
92 fconfigure $f -translation crlf
93 puts -nonewline $f $text
97 # genWinImage::generateInstallers --
99 # Perform substitutions on the pro.wse.in file and then
100 # invoke the WSE script twice; once for CD and once for web.
106 # Leaves proweb.exe and procd.exe sitting in the curent directory.
108 proc genWinImage::generateInstallers {} {
113 # Now read the "pro/srcs/install/pro.wse.in" file, have Tcl make
114 # appropriate substitutions, write out the resulting file in a
115 # current-working-directory. Use this new file to perform installation
116 # image creation. Note that we have to use this technique to set
117 # the value of _WISE_ because wise32 won't use a /d switch for this
120 set __TCLBASEDIR__ [file native $tclBuildDir]
121 set __TKBASEDIR__ [file native $tkBuildDir]
122 set __WISE__ [file native [file join $toolsDir wise]]
124 set f [open [file join $__TCLBASEDIR__ generic/tcl.h] r]
127 regexp {TCL_PATCH_LEVEL\s*\"([^\"]*)\"} $s dummy __TCL_PATCH_LEVEL__
129 set f [open tcl.wse.in r]
132 set s [subst -nocommands -nobackslashes $s]
133 set f [open tcl.wse w]
137 # Ensure the text files are CRLF terminated
139 makeTextFile [file join $tclBuildDir win/README.binary] \
140 [file join $tclBuildDir win/readme.txt]
141 makeTextFile [file join $tclBuildDir license.terms] \
142 [file join $tclBuildDir license.txt]
144 set wise32ProgFilePath [file native [file join $__WISE__ wise32.exe]]
146 # Run the Wise installer to create the Windows install images.
148 if {[catch {exec [file native $wise32ProgFilePath] /c tcl.wse} errMsg]} {
149 puts stderr "ERROR: $errMsg"
151 puts "\"TCL.EXE\" created."