4 set here
$pkgDefDir(maxima
)
5 # replace the backslashess..
6 regsub -all "\\\\" $here / here
10 source .
/deliver
/zipinfo.tcl
13 proc setPercent
{ n
} {
17 proc joe
{ f zipfile
} {
18 global installResult done unzipped
19 set tem
[string trim
[read $f] \n]
21 if { "$tem" == "" && [eof $f] } {
22 if { [file exists src
/max.ico
] } {
23 set installResult
"Installation Completed Successfully"
27 set installResult
"Installation Failed"
35 append unzipped
($zipfile) \n$tem
37 set tem
[split [string trim
$tem \n] \n]
39 setPercent
[expr [llength $unzipped($zipfile)] *100.0 / [lindex $zipinfo($zipfile) 1]]
40 set installResult
[lindex $tem end
]
46 if { "[array names zipinfo]" != "" } {
48 .progress.frame0.frame3.label4 config
-text {Unzipping
: }
49 .progress.frame0.frame3.label5 config
-textvariable zipfile
-text {}
50 .progress.frame0.frame3.label0 config
-textvariable {} -text {}
55 foreach v
[array names zipinfo
] {
59 set f
[open "| unzip -o $zipfile" r
]
60 fconfigure $f -blocking 0
62 fileevent $f readable
"joe $f $zipfile"
67 proc backslash
{ s
} {
68 regsub -all "/" $s "\\" s
72 # wait to do these till the icons and stuff are there..
73 after 200 installShortcuts
75 proc installShortcuts
{ } {
78 if { [tk_dialog .jim ask
{Add xmaxima to the Start Menu under Programs
} {} yes no yes
] } {
79 set programDir
[file join [::freewrap::getSpecialDir PROGRAMS
]]
80 catch { file delete
[file join $programDir Maxima.lnk
] }
81 ::freewrap::shortcut [file join $programDir Maxima.lnk
] \
82 -objectPath [backslash
[file join $here src xmaxima.exe
]] \
83 -workingDirectory [backslash
$here] \
84 -icon [backslash
[file join $here src max.ico
]] 0
86 ::freewrap::shortcut [file join $here Maxima.lnk
] \
87 -objectPath [backslash
[file join $here src xmaxima.exe
]] \
88 -workingDirectory [backslash
$here] \
89 -icon [backslash
[file join $here src max.ico
]] 0
90 file delete maxima.zip
91 file delete unpack.tcl
92 set f
[open init.lsp w
]
93 puts $f "(si::setenv \"PATH\" (concatenate 'string (substitute #\\\\ #\\/ \"$here/gcc/bin;\") (si::getenv \"PATH\")))"
100 # file delete unzip.exe