Merge branch (bug #4008)
[maxima.git] / archive / deliver / setup.tcl
blobe06fda8b0ac8759020865df376f64bd1f684c08b
1 # This distribution program created by freeDelivery 1.1 on Wed Nov 22 21:09:35 Pacific Standard Time 2000
3 proc ShowWindow.welcome {args} {
4 # xf ignore me 7
6 # build widget .welcome
7 if {"[info procs XFEdit]" != ""} {
8 catch "XFDestroy .welcome"
9 } {
10 catch "destroy .welcome"
12 toplevel .welcome
14 # Window manager configurations
15 wm positionfrom .welcome program
16 wm sizefrom .welcome program
17 wm maxsize .welcome 613 252
18 wm minsize .welcome 613 252
19 wm protocol .welcome WM_DELETE_WINDOW {pkg_exit welcome}
20 wm title .welcome {Welcome}
23 # build widget .welcome.frame4
24 frame .welcome.frame4 -height {30} -width {30}
26 # build widget .welcome.frame4.frame4
27 frame .welcome.frame4.frame4 -height {30} -width {30}
29 # build widget .welcome.frame4.frame4.message10
30 message .welcome.frame4.frame4.message10 -aspect {1500} -borderwidth {0} -font {{Helv} 10} -padx {5} -pady {2} -text {Installation will only take a few minutes.
32 You can also run Setup at another time to
33 modify your installation.
35 Click Next to proceed with Setup or click Cancel to exit
36 setup.}
38 # build widget .welcome.frame4.frame4.frame0
39 frame .welcome.frame4.frame4.frame0 -height {25} -width {233}
41 # build widget .welcome.frame4.frame4.frame0.label1
42 label .welcome.frame4.frame4.frame0.label1 -borderwidth {0} -font {Helvetica 10} -text {Welcome to }
44 # build widget .welcome.frame4.frame4.frame0.label2
45 label .welcome.frame4.frame4.frame0.label2 -borderwidth {0} -font {Helvetica 12 bold} -foreground {darkblue} -text {freeDelivery} -textvariable {settings_appName}
47 # build widget .welcome.frame4.frame4.frame0.label3
48 label .welcome.frame4.frame4.frame0.label3 -borderwidth {0} -font {Helvetica 10} -text { Setup!}
50 # build widget .welcome.frame4.frame1
51 frame .welcome.frame4.frame1 -background {grey50} -borderwidth {2} -height {153} -relief {sunken} -width {117}
53 # build widget .welcome.frame4.frame1.label3
54 label .welcome.frame4.frame1.label3 -background {grey50} -borderwidth {0} -font {Helvetica 10} -image {img_logo} -text {label3}
56 # build widget .welcome.frame5
57 frame .welcome.frame5 -borderwidth {2} -height {2} -relief {sunken}
59 # build widget .welcome.frame6
60 frame .welcome.frame6 -height {30} -width {30}
62 # build widget .welcome.frame6.button11
63 button .welcome.frame6.button11 -borderwidth {1} -command {pkg_exit welcome} -font {Helvetica 10} -pady {0} -text {Cancel} -width {10}
65 button .welcome.frame6.button11a -borderwidth {1} -command {console show} -font {Helvetica 10} -pady {0} -text {Console} -width {10}
67 # build widget .welcome.frame6.button12
68 button .welcome.frame6.button12 -borderwidth {1} -command {after 10 ShowWindow.license
69 DestroyWindow.welcome} -font {Helvetica 10} -pady {0} -text {Next>} -width {10}
71 # build widget .welcome.frame6.button13
72 button .welcome.frame6.button13 -borderwidth {1} -font {Helvetica 10} -pady {0} -state {disabled} -text {<Back} -width {10}
74 # pack master .welcome.frame4
75 pack configure .welcome.frame4.frame1 -fill y -ipadx 6 -side left
76 pack configure .welcome.frame4.frame4 -expand 1 -fill x -side left
78 # pack master .welcome.frame4.frame4
79 pack configure .welcome.frame4.frame4.frame0 -anchor w -padx 4
80 pack configure .welcome.frame4.frame4.message10 -anchor w -pady 8
82 # pack master .welcome.frame4.frame4.frame0
83 pack configure .welcome.frame4.frame4.frame0.label1 -side left
84 pack configure .welcome.frame4.frame4.frame0.label2 -side left
85 pack configure .welcome.frame4.frame4.frame0.label3 -side left
87 # pack master .welcome.frame4.frame1
88 pack configure .welcome.frame4.frame1.label3 -expand 1 -side left
90 # pack master .welcome.frame6
91 pack configure .welcome.frame6.button11 -padx 16 -side right
92 pack configure .welcome.frame6.button11a -padx 16 -side right
93 pack configure .welcome.frame6.button12 -side right
94 pack configure .welcome.frame6.button13 -side right
96 # pack master .welcome
97 pack configure .welcome.frame4 -fill x
98 pack configure .welcome.frame5 -fill x -pady 2
99 pack configure .welcome.frame6 -fill x -pady 8 -side bottom
101 EndSrc.welcome
103 if {"[info procs XFEdit]" != ""} {
104 catch "XFMiscBindWidgetTree .welcome"
105 after 2 "catch {XFEditSetShowWindows}"
109 proc ShowWindow.license {args} {
110 # xf ignore me 7
112 # build widget .license
113 if {"[info procs XFEdit]" != ""} {
114 catch "XFDestroy .license"
116 catch "destroy .license"
118 toplevel .license -relief {sunken}
120 # Window manager configurations
121 wm positionfrom .license user
122 wm sizefrom .license ""
123 wm maxsize .license 730 380
124 wm minsize .license 730 380
125 wm protocol .license WM_DELETE_WINDOW {pkg_exit license}
126 wm title .license {Software License Agreement}
128 # bindings
129 bind .license <Key-Next> {.license.frame.text2 yview scroll 1 pages}
130 bind .license <Key-Prior> {.license.frame.text2 yview scroll -1 pages}
132 # build widget .license.frame15
133 frame .license.frame15 -height {30} -width {30}
135 # build widget .license.frame15.label16
136 label .license.frame15.label16 -borderwidth {0} -font {Helvetica 10} -image {img_license} -text {label16} -width {46}
138 # build widget .license.frame15.message17
139 message .license.frame15.message17 -aspect {1500} -borderwidth {0} -font {{Helv} 10} -padx {5} -pady {2} -text {
140 Please read the following license agreement.
141 Press the PAGE DOWN key to see the rest of the agreement.
144 # build widget .license.frame6
145 frame .license.frame6 -height {30} -width {30}
147 # build widget .license.frame6.button11
148 button .license.frame6.button11 -borderwidth {1} -command {pkg_exit license} -font {Helvetica 10} -pady {0} -text {Cancel} -width {10}
150 # build widget .license.frame6.button12
151 button .license.frame6.button12 -borderwidth {1} -command {after 10 ShowWindow.selectpkg
152 DestroyWindow.license} -font {Helvetica 10} -pady {0} -text {Next>} -width {10}
154 # build widget .license.frame6.button13
155 button .license.frame6.button13 -borderwidth {1} -command {after 10 ShowWindow.welcome
156 DestroyWindow.license} -font {Helvetica 10} -pady {0} -text {<Back} -width {10}
158 # build widget .license.frame
159 frame .license.frame -relief {raised}
161 # build widget .license.frame.scrollbar1
162 scrollbar .license.frame.scrollbar1 -borderwidth {1} -command {.license.frame.text2 yview} -relief {raised}
164 # build widget .license.frame.text2
165 text .license.frame.text2 -borderwidth {1} -font {Helvetica 10} -state {disabled} -wrap {word} -yscrollcommand {.license.frame.scrollbar1 set}
167 # pack master .license.frame15
168 pack configure .license.frame15.label16 -side left
169 pack configure .license.frame15.message17 -side left
171 # pack master .license.frame6
172 pack configure .license.frame6.button11 -padx 16 -side right
173 pack configure .license.frame6.button12 -side right
174 pack configure .license.frame6.button13 -side right
176 # pack master .license.frame
177 pack configure .license.frame.scrollbar1 -fill y -side right
178 pack configure .license.frame.text2 -expand 1 -fill both
180 # pack master .license
181 pack configure .license.frame15 -fill x
182 pack configure .license.frame6 -fill x -pady 8 -side bottom
183 pack configure .license.frame -fill both
185 .license.frame.text2 insert end {}
187 EndSrc.license
189 if {"[info procs XFEdit]" != ""} {
190 catch "XFMiscBindWidgetTree .license"
191 after 2 "catch {XFEditSetShowWindows}"
195 proc ShowWindow.selectpkg {args} {
196 # xf ignore me 7
198 # build widget .selectpkg
199 if {"[info procs XFEdit]" != ""} {
200 catch "XFDestroy .selectpkg"
202 catch "destroy .selectpkg"
204 toplevel .selectpkg -background {grey} -relief {raised}
206 # Window manager configurations
207 wm positionfrom .selectpkg program
208 wm sizefrom .selectpkg program
209 wm maxsize .selectpkg 800 600
210 wm minsize .selectpkg 800 600
211 wm protocol .selectpkg WM_DELETE_WINDOW {pkg_exit selectpkg}
212 wm title .selectpkg {Select components}
215 # build widget .selectpkg.frame1
216 frame .selectpkg.frame1 -borderwidth {2} -height {30} -relief {ridge} -width {30}
218 # build widget .selectpkg.frame1.label2
219 label .selectpkg.frame1.label2 -borderwidth {4} -font {Helvetica 10} -image {img_logo} -text {label2}
221 # build widget .selectpkg.frame1.frame5
222 frame .selectpkg.frame1.frame5 -height {30} -width {30}
224 # build widget .selectpkg.frame1.frame5.label8
225 label .selectpkg.frame1.frame5.label8 -borderwidth {0} -font {Helvetica 11 italic} -foreground {red} -textvariable {settings_appSlogan}
227 # build widget .selectpkg.frame1.frame5.label10
228 label .selectpkg.frame1.frame5.label10 -borderwidth {0} -font {Helvetica 12} -text {version 1.1} -textvariable {settings_appVersion}
230 # build widget .selectpkg.frame1.frame5.label0
231 label .selectpkg.frame1.frame5.label0 -borderwidth {0} -font {Times 18} -text {freeDelivery} -textvariable {settings_appName}
233 # build widget .selectpkg.frame1.frame5.frame16
234 frame .selectpkg.frame1.frame5.frame16 -height {21} -width {69}
236 # build widget .selectpkg.frame1.frame5.frame16.label17
237 label .selectpkg.frame1.frame5.frame16.label17 -borderwidth {0} -font {Times 10 bold} -text {Created by }
239 # build widget .selectpkg.frame1.frame5.frame16.label18
240 label .selectpkg.frame1.frame5.frame16.label18 -borderwidth {0} -font {Times 10 bold} -text {Dennis R. LaBelle} -textvariable {settings_appAuthor}
242 # build widget .selectpkg.frame2
243 frame .selectpkg.frame2 -borderwidth {2} -height {262} -relief {ridge} -width {575}
245 # build widget .selectpkg.frame2.frame8
246 frame .selectpkg.frame2.frame8 -height {30} -width {30}
248 # build widget .selectpkg.frame2.frame8.frame2
249 frame .selectpkg.frame2.frame8.frame2 -borderwidth {1} -height {140} -relief {sunken} -width {571}
251 # build widget .selectpkg.frame2.frame8.frame2.label40
252 label .selectpkg.frame2.frame8.frame2.label40 -anchor {n} -borderwidth {0} -font {Times 10 bold italic} -height {3} -relief {groove} -text {Info:}
254 # build widget .selectpkg.frame2.frame8.frame2.text2
255 text .selectpkg.frame2.frame8.frame2.text2 -background {lightgrey} -font {Helvetica 10} -height {4} -relief {groove} -state {disabled} -width {84}
257 # build widget .selectpkg.frame2.frame
258 frame .selectpkg.frame2.frame -borderwidth {1} -height {140} -relief {sunken} -width {209}
260 # build widget .selectpkg.frame2.frame.scrollbar1
261 scrollbar .selectpkg.frame2.frame.scrollbar1 -borderwidth {1} -command {.selectpkg.frame2.frame.text2 yview} -relief {raised}
263 # build widget .selectpkg.frame2.frame.text2
264 text .selectpkg.frame2.frame.text2 -background {grey} -borderwidth {0} -cursor {} -exportselection {0} -font {Helvetica 10} -height {6} -padx {0} -relief {flat} -state {disabled} -width {27} -wrap {none} -yscrollcommand {.selectpkg.frame2.frame.scrollbar1 set}
265 # bindings
266 bind .selectpkg.frame2.frame.text2 <B1-Motion> {break}
267 bind .selectpkg.frame2.frame.text2 <Button-1> {break}
268 bind .selectpkg.frame2.frame.text2 <Leave> {break}
270 # build widget .selectpkg.frame2.frame.text2.defpkg0
271 checkbutton .selectpkg.frame2.frame.text2.defpkg0 -anchor {w} -background {grey} -font {Helvetica 10} -text {Build files} -variable {pkgDefault(Build files)} -width {20}
272 # bindings
273 bind .selectpkg.frame2.frame.text2.defpkg0 <Enter> {focus %W
274 show_desc .selectpkg.frame2.frame8.frame2.text2 {Build files}}
276 # build widget .selectpkg.frame2.frame.text2.defpkgsize0
277 label .selectpkg.frame2.frame.text2.defpkgsize0 -anchor {e} -background {grey} -font {Helvetica 10} -text {(170 KB)} -width {9}
279 # build widget .selectpkg.frame2.frame.text2.defpkglabel0
280 label .selectpkg.frame2.frame.text2.defpkglabel0 -background {grey} -font {Helvetica 10} -text { into directory: }
282 # build widget .selectpkg.frame2.frame.text2.defpkgDir0
283 entry .selectpkg.frame2.frame.text2.defpkgDir0 -borderwidth {1} -font {Helvetica 10} -textvariable {pkgDefDir(Build files)} -width {38}
285 # build widget .selectpkg.frame2.frame.text2.defpkg1
286 checkbutton .selectpkg.frame2.frame.text2.defpkg1 -anchor {w} -background {grey} -font {Helvetica 10} -text {Documentation} -variable {pkgDefault(Documentation)} -width {20}
287 # bindings
288 bind .selectpkg.frame2.frame.text2.defpkg1 <Enter> {focus %W
289 show_desc .selectpkg.frame2.frame8.frame2.text2 {Documentation}}
291 # build widget .selectpkg.frame2.frame.text2.defpkgsize1
292 label .selectpkg.frame2.frame.text2.defpkgsize1 -anchor {e} -background {grey} -font {Helvetica 10} -text {(10 KB)} -width {9}
294 # build widget .selectpkg.frame2.frame.text2.defpkglabel1
295 label .selectpkg.frame2.frame.text2.defpkglabel1 -background {grey} -font {Helvetica 10} -text { into directory: }
297 # build widget .selectpkg.frame2.frame.text2.defpkgDir1
298 entry .selectpkg.frame2.frame.text2.defpkgDir1 -borderwidth {1} -font {Helvetica 10} -textvariable {pkgDefDir(Documentation)} -width {38}
300 # build widget .selectpkg.frame2.frame.text2.defpkg2
301 checkbutton .selectpkg.frame2.frame.text2.defpkg2 -anchor {w} -background {grey} -font {Helvetica 10} -text {freeDelivery program} -variable {pkgDefault(freeDelivery program)} -width {20}
302 # bindings
303 bind .selectpkg.frame2.frame.text2.defpkg2 <Enter> {focus %W
304 show_desc .selectpkg.frame2.frame8.frame2.text2 {freeDelivery program}}
306 # build widget .selectpkg.frame2.frame.text2.defpkgsize2
307 label .selectpkg.frame2.frame.text2.defpkgsize2 -anchor {e} -background {grey} -font {Helvetica 10} -text {(734 KB)} -width {9}
309 # build widget .selectpkg.frame2.frame.text2.defpkglabel2
310 label .selectpkg.frame2.frame.text2.defpkglabel2 -background {grey} -font {Helvetica 10} -text { into directory: }
312 # build widget .selectpkg.frame2.frame.text2.defpkgDir2
313 entry .selectpkg.frame2.frame.text2.defpkgDir2 -borderwidth {1} -font {Helvetica 10} -textvariable {pkgDefDir(freeDelivery program)} -width {38}
315 # build widget .selectpkg.frame2.label8
316 label .selectpkg.frame2.label8 -borderwidth {0} -font {Helvetica 10} -text { Select the packages to install: }
318 # build widget .selectpkg.frame6
319 frame .selectpkg.frame6 -height {30} -width {30}
321 # build widget .selectpkg.frame6.button11
322 button .selectpkg.frame6.button11 -borderwidth {1} -command {pkg_exit selectpkg} -font {Helvetica 10} -pady {0} -text {Cancel} -width {10}
324 # build widget .selectpkg.frame6.button12
325 button .selectpkg.frame6.button12 -borderwidth {1} -command {after 10 ShowWindow.ready
326 DestroyWindow.selectpkg} -font {Helvetica 10} -pady {0} -text {Next>} -width {10}
328 # build widget .selectpkg.frame6.button13
329 button .selectpkg.frame6.button13 -borderwidth {1} -command {after 10 ShowWindow.license
330 DestroyWindow.selectpkg} -font {Helvetica 10} -pady {0} -text {<Back} -width {10}
332 # build widget .selectpkg.frame5
333 frame .selectpkg.frame5 -borderwidth {2} -height {2} -relief {sunken}
335 # pack master .selectpkg.frame1
336 pack configure .selectpkg.frame1.label2 -side left
337 pack configure .selectpkg.frame1.frame5 -expand 1 -fill x -side left
339 # pack master .selectpkg.frame1.frame5
340 pack configure .selectpkg.frame1.frame5.label0
341 pack configure .selectpkg.frame1.frame5.label8 -fill x -pady 2
342 pack configure .selectpkg.frame1.frame5.label10 -fill x -pady 4
343 pack configure .selectpkg.frame1.frame5.frame16
345 # pack master .selectpkg.frame1.frame5.frame16
346 pack configure .selectpkg.frame1.frame5.frame16.label17 -side left
347 pack configure .selectpkg.frame1.frame5.frame16.label18 -side left
349 # pack master .selectpkg.frame2
350 pack configure .selectpkg.frame2.label8 -anchor w
351 pack configure .selectpkg.frame2.frame -fill both
352 pack configure .selectpkg.frame2.frame8 -expand 1 -fill x -side bottom
354 # pack master .selectpkg.frame2.frame8
355 pack configure .selectpkg.frame2.frame8.frame2 -anchor w -expand 1 -fill x -side left
357 # pack master .selectpkg.frame2.frame8.frame2
358 pack configure .selectpkg.frame2.frame8.frame2.label40 -anchor n -side left
359 pack configure .selectpkg.frame2.frame8.frame2.text2
361 # pack master .selectpkg.frame2.frame
362 pack configure .selectpkg.frame2.frame.scrollbar1 -fill y -side right
363 pack configure .selectpkg.frame2.frame.text2 -expand 1 -fill both
365 # pack master .selectpkg.frame6
366 pack configure .selectpkg.frame6.button11 -padx 16 -side right
367 pack configure .selectpkg.frame6.button12 -side right
368 pack configure .selectpkg.frame6.button13 -side right
370 # pack master .selectpkg
371 pack configure .selectpkg.frame1 -fill x
372 pack configure .selectpkg.frame2 -fill x
373 pack configure .selectpkg.frame6 -fill x -pady 8 -side bottom
374 pack configure .selectpkg.frame5 -fill x
376 .selectpkg.frame2.frame8.frame2.text2 insert end {}
377 .selectpkg.frame2.frame.text2 insert end {}
381 EndSrc.selectpkg
383 if {"[info procs XFEdit]" != ""} {
384 catch "XFMiscBindWidgetTree .selectpkg"
385 after 2 "catch {XFEditSetShowWindows}"
389 proc ShowWindow.ready {args} {
390 # xf ignore me 7
392 # build widget .ready
393 if {"[info procs XFEdit]" != ""} {
394 catch "XFDestroy .ready"
396 catch "destroy .ready"
398 toplevel .ready
400 # Window manager configurations
401 wm positionfrom .ready user
402 wm sizefrom .ready ""
403 wm maxsize .ready 447 105
404 wm minsize .ready 447 105
405 wm protocol .ready WM_DELETE_WINDOW {pkg_exit ready}
406 wm title .ready {Ready to install}
409 # build widget .ready.frame2
410 frame .ready.frame2 -height {30} -width {30}
412 # build widget .ready.frame2.label0
413 label .ready.frame2.label0 -borderwidth {0} -font {Helvetica 12} -foreground {darkblue} -text {freeDelivery} -textvariable {settings_appName}
415 # build widget .ready.frame2.label1
416 label .ready.frame2.label1 -borderwidth {0} -font {Helvetica 10} -text {Setup is ready to begin installing files.}
418 # build widget .ready.frame6
419 frame .ready.frame6 -height {30} -width {30}
421 # build widget .ready.frame6.button11
422 button .ready.frame6.button11 -borderwidth {1} -command {pkg_exit ready} -font {Helvetica 10} -pady {0} -text {Cancel} -width {10}
424 # build widget .ready.frame6.button12
425 button .ready.frame6.button12 -borderwidth {1} -command {after 10 install_files
426 DestroyWindow.ready} -font {Helvetica 10} -pady {0} -text {Finish>} -width {10}
428 # build widget .ready.frame6.button13
429 button .ready.frame6.button13 -borderwidth {1} -command {after 10 ShowWindow.selectpkg
430 DestroyWindow.ready} -font {Helvetica 10} -pady {0} -text {<Back} -width {10}
432 # pack master .ready.frame2
433 pack configure .ready.frame2.label0 -padx 2 -side left
434 pack configure .ready.frame2.label1 -side left
436 # pack master .ready.frame6
437 pack configure .ready.frame6.button11 -padx 16 -side right
438 pack configure .ready.frame6.button12 -side right
439 pack configure .ready.frame6.button13 -side right
441 # pack master .ready
442 pack configure .ready.frame2 -fill x -pady 6
443 pack configure .ready.frame6 -fill x -pady 8 -side bottom
445 EndSrc.ready
447 if {"[info procs XFEdit]" != ""} {
448 catch "XFMiscBindWidgetTree .ready"
449 after 2 "catch {XFEditSetShowWindows}"
453 proc ShowWindow.progress {args} {
454 # xf ignore me 7
456 # build widget .progress
457 if {"[info procs XFEdit]" != ""} {
458 catch "XFDestroy .progress"
460 catch "destroy .progress"
462 toplevel .progress -relief {raised}
464 # Window manager configurations
465 wm positionfrom .progress program
466 wm sizefrom .progress program
467 wm geometry .progress 687x382
468 wm maxsize .progress 687 382
469 wm minsize .progress 687 382
470 wm protocol .progress WM_DELETE_WINDOW {set abortNow 1}
471 wm title .progress {Installing....}
473 # build widget .progress.frame6
474 frame .progress.frame6 -height {30} -width {30}
476 # build widget .progress.frame6.button11
477 button .progress.frame6.button11 -borderwidth {1} -command {set abortNow 1} -font {Helvetica 10} -padx {4} -pady {4} -text {Cancel}
479 # build widget .progress.frame0
480 frame .progress.frame0 -borderwidth {2} -height {30} -relief {ridge} -width {30}
482 # build widget .progress.frame0.canvas1
483 canvas .progress.frame0.canvas1 -background {lightgrey} -borderwidth {2} -height {20} -relief {ridge} -width {300}
485 # build widget .progress.frame0.frame3
486 frame .progress.frame0.frame3 -height {30} -width {30}
488 # build widget .progress.frame0.frame3.label4
489 label .progress.frame0.frame3.label4 -borderwidth {0} -font {{Helv} 10} -text { Copying: }
491 # build widget .progress.frame0.frame3.label5
492 label .progress.frame0.frame3.label5 -borderwidth {0} -font {Helvetica 10} -foreground {darkblue} -text {freeDelivery program to } -textvariable {installpkg}
494 # build widget .progress.frame0.frame3.label0
495 label .progress.frame0.frame3.label0 -borderwidth {0} -font {Helvetica 10} -foreground {darkblue} -text {c:/Program Files/freeDelivery/bin/freedelivery.EXE} -textvariable {installfile}
497 # build widget .progress.frame0.frame7
498 frame .progress.frame0.frame7 -height {30} -width {30}
500 # build widget .progress.frame0.frame7.label2
501 label .progress.frame0.frame7.label2 -borderwidth {0} -font {{Helv} 10} -text { 0.0} -textvariable {completion} -width {4}
503 # build widget .progress.frame0.frame7.label6
504 label .progress.frame0.frame7.label6 -borderwidth {0} -font {{Helv} 10} -text {% complete}
506 # build widget .progress.frame11
507 frame .progress.frame11 -height {172} -width {493}
509 # build widget .progress.frame11.frame1
510 frame .progress.frame11.frame1 -borderwidth {2} -height {30} -relief {ridge} -width {30}
512 # build widget .progress.frame11.frame1.frame5
513 frame .progress.frame11.frame1.frame5 -height {30} -width {30}
515 # build widget .progress.frame11.frame1.frame5.label8
516 label .progress.frame11.frame1.frame5.label8 -borderwidth {0} -font {Helvetica 11 italic} -foreground {red} -textvariable {settings_appSlogan}
518 # build widget .progress.frame11.frame1.frame5.label10
519 label .progress.frame11.frame1.frame5.label10 -borderwidth {0} -font {Helvetica 12} -text {version 1.0} -textvariable {settings_appVersion}
521 # build widget .progress.frame11.frame1.frame5.label0
522 label .progress.frame11.frame1.frame5.label0 -borderwidth {0} -font {Times 18} -text {freeDelivery} -textvariable {settings_appName}
524 # build widget .progress.frame11.frame1.frame5.frame16
525 frame .progress.frame11.frame1.frame5.frame16 -height {21} -width {69}
527 # build widget .progress.frame11.frame1.frame5.frame16.label17
528 label .progress.frame11.frame1.frame5.frame16.label17 -borderwidth {0} -font {Times 10 bold} -text {Created by }
530 # build widget .progress.frame11.frame1.frame5.frame16.label18
531 label .progress.frame11.frame1.frame5.frame16.label18 -borderwidth {0} -font {Times 10 bold} -text {Dennis R. LaBelle} -textvariable {settings_appAuthor}
533 # build widget .progress.frame11.frame1.label2
534 label .progress.frame11.frame1.label2 -borderwidth {4} -font {Helvetica 10} -image {img_logo} -text {label2}
536 # build widget .progress.frame11.frame13
537 frame .progress.frame11.frame13 -height {168} -width {114}
539 # build widget .progress.frame11.frame13.label14
540 label .progress.frame11.frame13.label14 -borderwidth {0} -font {Helvetica 10} -text { Another install by}
542 # build widget .progress.frame11.frame13.label12
543 label .progress.frame11.frame13.label12 -borderwidth {0} -font {Helvetica 10} -image {img_logo3} -text {label2}
545 # build widget .progress.frame11.frame13.label0
546 label .progress.frame11.frame13.label0 -borderwidth {0} -font {Helvetica 10 bold} -text { freeDelivery}
548 # build widget .progress.frame1
549 frame .progress.frame1 -borderwidth {2} -height {52} -relief {ridge} -width {483}
551 # build widget .progress.frame1.label3
552 label .progress.frame1.label3 -borderwidth {0} -font {Helvetica 12} -foreground {darkblue} -text { Installation completed successfully} -textvariable {installResult}
554 # build widget .progress.frame1.frame4
555 frame .progress.frame1.frame4 -height {34} -width {34}
557 # build widget .progress.frame1.frame4.checkbutton6
558 checkbutton .progress.frame1.frame4.checkbutton6 -borderwidth {1} -font {Helvetica 10} -pady {0} -text {View README file after exiting} -variable {viewReadme}
560 # build widget .progress.frame1.frame4.button7
561 button .progress.frame1.frame4.button7 -borderwidth {1} -command {DelWindow.fileerror
562 if {$viewReadme} {
563 global settings_InfoFile
564 set text_infoFile [rf $settings_InfoFile]
565 after 2 DestroyWindow.progress
566 after 20 ShowWindow.viewer text_infoFile ReadMe
567 } { pkg_exit progress }} -font {Helvetica 10} -text {Exit} -width {6}
569 # build widget .progress.frame3
570 frame .progress.frame3 -borderwidth {2} -height {18} -relief {ridge} -width {483}
572 # build widget .progress.frame3.label4
573 label .progress.frame3.label4 -borderwidth {0} -font {{Helv} 10} -text { Running special installation program: }
575 # build widget .progress.frame3.label5
576 label .progress.frame3.label5 -borderwidth {0} -font {Helvetica 10} -foreground {darkblue} -textvariable {runprg}
578 # pack master .progress.frame6
579 pack configure .progress.frame6.button11 -padx 4 -pady 2 -side right
581 # pack master .progress.frame0
582 pack configure .progress.frame0.frame3 -fill x
583 pack configure .progress.frame0.canvas1
584 pack configure .progress.frame0.frame7
586 # pack master .progress.frame0.frame3
587 pack configure .progress.frame0.frame3.label4 -side left
588 pack configure .progress.frame0.frame3.label5 -side left
589 pack configure .progress.frame0.frame3.label0 -side left
591 # pack master .progress.frame0.frame7
592 pack configure .progress.frame0.frame7.label2 -side left
593 pack configure .progress.frame0.frame7.label6 -anchor w -side left
595 # pack master .progress.frame11
596 pack configure .progress.frame11.frame1 -expand 1 -fill both -side left
597 pack configure .progress.frame11.frame13
599 # pack master .progress.frame11.frame1
600 pack configure .progress.frame11.frame1.label2 -side left
601 pack configure .progress.frame11.frame1.frame5 -side left
603 # pack master .progress.frame11.frame1.frame5
604 pack configure .progress.frame11.frame1.frame5.label0
605 pack configure .progress.frame11.frame1.frame5.label8 -fill x -pady 2
606 pack configure .progress.frame11.frame1.frame5.label10 -fill x -pady 4
607 pack configure .progress.frame11.frame1.frame5.frame16
609 # pack master .progress.frame11.frame1.frame5.frame16
610 pack configure .progress.frame11.frame1.frame5.frame16.label17 -side left
611 pack configure .progress.frame11.frame1.frame5.frame16.label18 -side left
613 # pack master .progress.frame11.frame13
614 pack configure .progress.frame11.frame13.label14 -pady 2
615 pack configure .progress.frame11.frame13.label0
616 pack configure .progress.frame11.frame13.label12 -pady 4
618 # pack master .progress.frame1
619 pack configure .progress.frame1.label3 -anchor w
620 pack configure .progress.frame1.frame4 -fill x
622 # pack master .progress.frame1.frame4
623 pack configure .progress.frame1.frame4.checkbutton6 -side left
624 pack configure .progress.frame1.frame4.button7 -padx 3 -pady 3 -side right
626 # pack master .progress.frame3
627 pack configure .progress.frame3.label4 -side left
628 pack configure .progress.frame3.label5 -side left
630 # pack master .progress
631 pack configure .progress.frame11 -fill x
632 pack configure .progress.frame1 -fill x
634 # build canvas items .progress.frame0.canvas1
635 set xfTmpTag [.progress.frame0.canvas1 create rectangle 2.0 5.0 4.0 24.0]
636 .progress.frame0.canvas1 itemconfigure $xfTmpTag -fill {blue} -outline {} -tags {statusbar}
638 EndSrc.progress
640 if {"[info procs XFEdit]" != ""} {
641 catch "XFMiscBindWidgetTree .progress"
642 after 2 "catch {XFEditSetShowWindows}"
647 # return the body of file and copy to disk
648 proc rf { file } {
649 set f [open $file r]
650 set res [read $f]
651 close $f
652 set ff [open $f w]
653 puts -nonewline $ff $res
654 close $ff
655 return $res
658 proc ShowWindow.viewer {args} {
659 # xf ignore me 7
661 # build widget .viewer
662 if {"[info procs XFEdit]" != ""} {
663 catch "XFDestroy .viewer"
665 catch "destroy .viewer"
667 toplevel .viewer -relief {raised}
669 # Window manager configurations
670 wm positionfrom .viewer program
671 wm sizefrom .viewer program
672 wm maxsize .viewer 1280 1024
673 wm minsize .viewer 621 270
674 wm protocol .viewer WM_DELETE_WINDOW {pkg_exit viewer}
675 wm title .viewer {ReadMe}
678 # build widget .viewer.frame
679 frame .viewer.frame -relief {raised}
681 # build widget .viewer.frame.scrollbar1
682 scrollbar .viewer.frame.scrollbar1 -borderwidth {1} -command {.viewer.frame.text2 yview} -relief {raised}
684 # build widget .viewer.frame.text2
685 text .viewer.frame.text2 -borderwidth {1} -font {courier 10} -height {10} -state {disabled} -width {60} -wrap {word} -xscrollcommand {.viewer.frame.scrollbar9 set} -yscrollcommand {.viewer.frame.scrollbar1 set}
687 # build widget .viewer.frame.scrollbar9
688 scrollbar .viewer.frame.scrollbar9 -borderwidth {1} -command {.viewer.frame.text2 xview} -orient {horizontal} -relief {raised}
690 # build widget .viewer.button10
691 button .viewer.button10 -command {pkg_exit viewer} -font {Helvetica 10} -text {Done} -width {6}
693 # pack master .viewer.frame
694 pack configure .viewer.frame.scrollbar1 -fill y -side right
695 pack configure .viewer.frame.text2 -expand 1 -fill both
696 pack configure .viewer.frame.scrollbar9 -fill x
698 # pack master .viewer
699 pack configure .viewer.frame -expand 1 -fill both
700 pack configure .viewer.button10 -pady 4
702 .viewer.frame.text2 insert end {}
704 EndSrc.viewer
706 if {"[info procs XFEdit]" != ""} {
707 catch "XFMiscBindWidgetTree .viewer"
708 after 2 "catch {XFEditSetShowWindows}"
712 proc DestroyWindow.welcome {} {# xf ignore me 7
713 if {"[info procs XFEdit]" != ""} {
714 if {"[info commands .welcome]" != ""} {
715 global xfShowWindow.welcome
716 set xfShowWindow.welcome 0
717 XFEditSetPath .
718 after 2 "XFSaveAsProc .welcome; XFEditSetShowWindows"
721 catch "destroy .welcome"
722 update
726 proc DestroyWindow.license {} {# xf ignore me 7
727 if {"[info procs XFEdit]" != ""} {
728 if {"[info commands .license]" != ""} {
729 global xfShowWindow.license
730 set xfShowWindow.license 0
731 XFEditSetPath .
732 after 2 "XFSaveAsProc .license; XFEditSetShowWindows"
735 catch "destroy .license"
736 update
740 proc DestroyWindow.selectpkg {} {# xf ignore me 7
741 if {"[info procs XFEdit]" != ""} {
742 if {"[info commands .selectpkg]" != ""} {
743 global xfShowWindow.selectpkg
744 set xfShowWindow.selectpkg 0
745 XFEditSetPath .
746 after 2 "XFSaveAsProc .selectpkg; XFEditSetShowWindows"
749 catch "destroy .selectpkg"
750 update
754 proc DestroyWindow.ready {} {# xf ignore me 7
755 if {"[info procs XFEdit]" != ""} {
756 if {"[info commands .ready]" != ""} {
757 global xfShowWindow.ready
758 set xfShowWindow.ready 0
759 XFEditSetPath .
760 after 2 "XFSaveAsProc .ready; XFEditSetShowWindows"
763 catch "destroy .ready"
764 update
768 proc DestroyWindow.progress {} {# xf ignore me 7
769 if {"[info procs XFEdit]" != ""} {
770 if {"[info commands .progress]" != ""} {
771 global xfShowWindow.progress
772 set xfShowWindow.progress 0
773 XFEditSetPath .
774 after 2 "XFSaveAsProc .progress; XFEditSetShowWindows"
777 catch "destroy .progress"
778 update
782 proc DestroyWindow.viewer {} {# xf ignore me 7
783 if {"[info procs XFEdit]" != ""} {
784 if {"[info commands .viewer]" != ""} {
785 global xfShowWindow.viewer
786 set xfShowWindow.viewer 0
787 XFEditSetPath .
788 after 2 "XFSaveAsProc .viewer; XFEditSetShowWindows"
791 catch "destroy .viewer"
792 update
796 proc EndSrc.welcome {} {
797 if {[lsearch [image names] img_logo] != -1} {
798 .welcome.frame4.frame1.label3 configure -image img_logo
800 .welcome.frame4.frame1.label3 configure -image img_default
802 centerwin .welcome 491 216
805 proc EndSrc.license {} {
806 global text_licenseFile settings_CopyrightFile
808 set text_licenseFile [rf $settings_CopyrightFile]
810 centerwin .license 584 304
811 .license.frame.text2 configure -state normal
812 .license.frame.text2 delete 1.0 end
813 .license.frame.text2 insert end $text_licenseFile
814 .license.frame.text2 configure -state disabled
817 proc EndSrc.selectpkg {} {
818 if {[lsearch [image names] img_logo] != -1} {
819 .selectpkg.frame1.label2 configure -image img_logo
821 .selectpkg.frame1.label2 configure -image img_default
823 centerwin .selectpkg 640 480
824 Defaults_ShowPackages .selectpkg.frame2.frame.text2
827 proc EndSrc.ready {} {
828 centerwin .ready 358 84
831 proc EndSrc.progress {} {
832 if {[lsearch [image names] img_logo] != -1} {
833 .progress.frame11.frame1.label2 configure -image img_logo
835 .progress.frame11.frame1.label2 configure -image img_default
837 centerwin .progress 550 306
840 proc EndSrc.viewer {} {
841 global text_infoFile
843 upvar args arglist
844 set varname [lindex $arglist 0]
845 if {$varname != ""} {
846 upvar #0 $varname vname
847 set title [lindex $arglist 1]
848 wm title .viewer $title
849 .viewer.frame.text2 configure -state normal
850 .viewer.frame.text2 delete 1.0 end
851 .viewer.frame.text2 insert end [set vname]
852 .viewer.frame.text2 configure -state disabled
854 centerwin .viewer 497 216
857 proc DispWindow.fileerror {args} {
858 if {[winfo exists .fileerror]} {return}
860 toplevel .fileerror -relief {raised}
862 # Window manager configurations
863 wm positionfrom .fileerror program
864 wm sizefrom .fileerror program
865 wm maxsize .fileerror 1280 200
866 wm minsize .fileerror 354 200
867 # wm protocol .fileerror WM_DELETE_WINDOW {set replaceCur 0}
868 wm title .fileerror {File copy error}
870 frame .fileerror.frame1 -height {26} -width {132}
871 label .fileerror.frame1.label1 -borderwidth {0} -font {Helvetica 10 bold} -foreground {black} -textvariable {file_errmsg}
873 frame .fileerror.frame20 -height {26} -width {132}
874 label .fileerror.frame20.label1 -borderwidth {0} -font {Helvetica 10} -text {found with a date of}
876 frame .fileerror.frame2 -height {26} -width {132}
877 label .fileerror.frame2.label1 -borderwidth {0} -font {Helvetica 10} -textvariable {file_errmsg2}
879 frame .fileerror.frame30 -height {26} -width {132}
880 label .fileerror.frame30.label1 -borderwidth {0} -font {Helvetica 10} -text {while trying to update to a version dated}
882 frame .fileerror.frame3 -height {26} -width {132}
883 label .fileerror.frame3.label1 -borderwidth {0} -font {Helvetica 10} -textvariable {file_errmsg3}
885 frame .fileerror.frame4 -height {35} -width {238}
886 button .fileerror.frame4.button3 -command {set replaceCur 1} -font {Helvetica 10} -text {Replace} -width {9}
887 button .fileerror.frame4.button4 -command {set replaceAll 1
888 set replaceCur 1} -font {Helvetica 10} -text {Replace All} -width {9}
889 button .fileerror.frame4.button5 -command {set replaceCur 0} -font {Helvetica 10} -text {Skip} -width {9}
890 button .fileerror.frame4.button6 -command {set replaceCur 0; set replaceAll -1} -font {Helvetica 10} -text {Skip All} -width {9}
892 label .fileerror.label8 -borderwidth {0} -font {Helvetica 12} -foreground {red} -text {What would you like to do?}
894 pack configure .fileerror.frame1.label1 -side left
895 pack configure .fileerror.frame20.label1 -side left
896 pack configure .fileerror.frame2.label1 -side left
897 pack configure .fileerror.frame30.label1 -side left
898 pack configure .fileerror.frame3.label1 -side left
899 pack configure .fileerror.frame4.button3 -padx 2 -side left
900 pack configure .fileerror.frame4.button4 -padx 2 -side left
901 pack configure .fileerror.frame4.button5 -padx 2 -side left
902 pack configure .fileerror.frame4.button6 -padx 2 -side left
903 pack configure .fileerror.frame1 -pady 4
904 pack configure .fileerror.frame20 -pady 4
905 pack configure .fileerror.frame2 -pady 4
906 pack configure .fileerror.frame30 -pady 4
907 pack configure .fileerror.frame3 -pady 4
908 pack configure .fileerror.label8 -pady 8
909 pack configure .fileerror.frame4 -pady 4
911 centerwin .fileerror 354 200
914 proc DelWindow.fileerror {} {
915 catch "destroy .fileerror"
916 update
919 proc show_desc {wname pkg} {
920 # Display the description associated with specified package in the specified window
921 global pkgDesc
923 if {[info exists pkgDesc($pkg)]} {
924 regsub -all {\\n} $pkgDesc($pkg) "\n" desc
925 $wname configure -state normal
926 $wname delete 1.0 end
927 $wname insert end $desc
928 $wname configure -state disabled
932 proc Defaults_RemovePackages {wname} {
933 global pkgList
934 global pkgInstall
936 set w $wname
937 set plist [winfo children $w]
938 foreach cbox $plist {
939 if {"[info procs XFEdit]" != ""} {
940 catch "XFDestroy $cbox"
941 } { catch "destroy $cbox" }
943 $w configure -state normal
944 $w delete 1.0 end
945 $w configure -state disabled
948 proc Defaults_ShowPackages {wname} {
949 global pkgUseDir
950 global pkgInstall
951 global pkgFileSpace
952 global pkgBaseDir
954 set w $wname
955 if {![winfo exists $w]} { return }
957 Defaults_RemovePackages $w
958 $w configure -state normal
959 set ctr 0
960 foreach pkg [lsort [array names pkgBaseDir]] {
961 set cname $w.defpkg$ctr
962 checkbutton $cname -text $pkg -variable pkgDefault($pkg) -background grey -relief flat -width 20 -anchor w
963 bind $cname <Enter> "focus %W
964 show_desc .selectpkg.frame2.frame8.frame2.text2 \{$pkg\}"
965 $w window create end -window $cname
967 set cname $w.defpkgsize$ctr
968 label $cname -text "([expr {$pkgFileSpace($pkg) / 1024}] KB)" -anchor e -width 9 -background grey
969 $w window create end -window $cname
971 set cname $w.defpkglabel$ctr
972 label $cname -text " into directory: " -background grey
973 $w window create end -window $cname
975 set cname $w.defpkgDir$ctr
976 switch $pkgUseDir($pkg) {
977 "DefDir" {
978 entry $cname -textvariable pkgDefDir($pkg) -width 38 -highlightthickness 0 -borderwidth 1
979 $w window create end -window $cname
981 "AbsDir" {
982 entry $cname -textvariable pkgAbsDir($pkg) -width 38 -state disabled -background grey75 -highlightthickness 0 -borderwidth 1
983 $w window create end -window $cname
985 "BaseDir" {
986 entry $cname -textvariable pkgBaseDir($pkg) -width 38 -state disabled -background grey75 -highlightthickness 0 -borderwidth 1
987 $w window create end -window $cname
991 $w insert end "\n"
992 incr ctr
994 $w configure -state disabled
997 proc abort {} {
998 # Check whether installation should be aborted.
1000 # Returns: 1 if abort request occurred.
1001 # 0 if abort request is absent.
1003 global settings_appName
1004 global abortNow
1006 if {$abortNow == "0"} {
1007 set rtnval 0
1009 set msg "Installation aborted by user.\n\n$settings_appName installation is incomplete.\n\nRun program again for proper installation."
1010 tk_messageBox -type ok -message $msg -title Abort -icon error
1011 set rtnval 1
1013 return $rtnval
1016 proc calc_needed {} {
1017 global installpkg
1018 global installsize
1019 global pkglist
1020 global install_required
1021 global kbrequired
1023 set sum 0.0
1024 foreach pkg $pkglist { set sum [expr $sum + $installpkg($pkg) * $installsize($pkg)] }
1025 set install_required [format "%.1f" [expr $sum / 1024] ]
1026 set kbrequired(typical) [format "Space required: %.1f MB" [expr $sum / 1024] ]
1029 proc centerwin {wname args} {
1030 # This procedure centers a window on the screen
1032 if {$args != ""} {
1033 set width [lindex $args 0]
1034 set height [lindex $args 1]
1035 set ratio [expr [lindex [font metrics {Helv 20}] 5] / 32.0]
1036 if {$ratio > 1.0} {
1037 # We are using larger than normal fonts. Increase size of window.
1038 set width [expr int($width * $ratio)]
1039 set height [expr int($height * $ratio)]
1041 wm geometry $wname ${width}x$height
1042 if {[lsearch {.viewer .help} $wname] == -1} {
1043 wm maxsize $wname $width $height
1045 wm minsize $wname $width $height
1047 set width [winfo width $wname]
1048 set height [winfo height $wname]
1050 set scrwidth [winfo screenwidth $wname]
1051 set scrheight [winfo screenheight $wname]
1052 set x [expr ($scrwidth - $width) / 2 ]
1053 set y [expr ($scrheight - $height) / 2]
1054 wm geometry $wname +$x+$y
1055 wm deiconify $wname
1056 raise $wname
1057 wm geometry $wname +$x+$y
1060 proc copy_files {} {
1061 # Copy installation files to their proper destinations
1063 # Returns: 1 on a complete, successfull installation
1064 # 0 on failure
1066 global pkgDesc
1067 global pkgDefault
1068 global pkgUseDir
1069 global pkgBaseDir
1070 global pkgDefDir
1071 global pkgAbsDir
1072 global pkgFiles
1073 global pkgFileSpace
1074 global installpkg
1075 global installfile
1076 global pkg_test
1077 global file_errmsg
1078 global file_errmsg2
1079 global file_errmsg3
1080 global ::freewrap::pkgInfo
1081 global ::freewrap::stubsize
1082 global replaceCur
1083 global replaceAll
1084 global progName
1085 global runprgname
1086 global runprgdest
1087 global fwCopy
1089 set rtnval 0
1090 set pkglist ""
1091 set totsize 0
1092 foreach pkg [array names pkgDesc] {
1093 if {$pkgDefault($pkg)} {
1094 lappend pkglist $pkg
1095 incr totsize $pkgFileSpace($pkg)
1098 set execname [info nameofexecutable]
1099 set filein ""
1100 if {$pkg_test} {
1101 # copy the files from disk
1102 set fromdisk 1
1104 if {[info exists ::freewrap::pkgInfo]} {
1105 # copy files from installation package
1106 set filein [::freewrap::iswrapped $execname]
1107 set stubsize $::freewrap::stubsize
1108 if {$filein == ""} {
1109 set msg "Unable to extract installation files from $execname.\n\nThe file may be corrupted."
1110 tk_messageBox -type ok -message $msg -title "Bad installation file" -icon error
1111 return 0
1113 set fromdisk 0
1114 } { set fromdisk 1 }
1116 set bytescopied 0
1117 set percent 0.0
1118 upstat $percent
1119 foreach pkg [lsort $pkglist] {
1120 # Verify the installation directory
1121 switch $pkgUseDir($pkg) {
1122 "BaseDir" {
1123 set swapstr $pkgBaseDir($pkg)
1125 "DefDir" {
1126 set swapstr $pkgDefDir($pkg)
1128 "AbsDir" {
1129 set swapstr $pkgAbsDir($pkg)
1132 if {[verify_dir $swapstr] == ""} {
1133 # Invalid directory. Cannot continue with installation
1134 return 0
1136 set slen [string len $pkgBaseDir($pkg)]
1137 set installpkg "$pkg to "
1138 foreach fname $pkgFiles($pkg) {
1139 set newname $swapstr[string range $fname $slen end]
1140 set installfile $newname
1141 update
1142 if {[file tail $newname] == $runprgname} {
1143 # save location of the run after install binary program
1144 set runprgdest $newname
1146 if {[abort]} { return 0 }
1147 if {[file exists $newname]} {
1148 switch -- $replaceAll {
1149 -1 { set replaceCur 0 }
1151 if {$fromdisk} {
1152 set filetime [file mtime $fname]
1154 if {[info exists fwcopy($fname)]} {
1155 set filetime $fwcopy($fname)
1156 } { set filetime [lindex $::freewrap::pkgInfo($fname) 2] }
1158 set file_errmsg $newname
1159 set file_errmsg2 [clock format [file mtime $newname] -format %c]
1160 set file_errmsg3 [clock format $filetime -format %c]
1161 set replaceCur ""
1162 DispWindow.fileerror
1163 grab set .fileerror
1164 tkwait var replaceCur
1165 grab release .fileerror
1166 DelWindow.fileerror
1168 1 { set replaceCur 1 }
1170 } { set replaceCur 1 }
1171 if {$replaceCur} {
1172 file mkdir [file dirname $newname]
1173 if {$fromdisk} {
1174 # file copy -force $fname $newname
1175 ::freewrap::pkgfilecopy $fname $newname 1
1176 incr bytescopied [file size $newname]
1178 set isFWcopy [info exists fwCopy($fname)]
1179 if {[info exists ::freewrap::pkgInfo($fname)] || $isFWcopy} {
1180 # copy the file from the installation package
1181 if {[catch {open $newname w} fileout]} {
1182 close $filein
1183 tk_messageBox -type ok -message $fileout -title "$execname error" -icon error
1184 return 0
1186 fconfigure $fileout -translation binary
1187 if {$isFWcopy} {
1188 set needstub 1
1189 } { set needstub [lindex $::freewrap::pkgInfo($fname) 3] }
1190 if {$needstub} {
1191 # reattach freeWrap stub using stub found in freeDelivery
1192 seek $filein 0 start
1193 fcopy $filein $fileout -size $::freewrap::stubsize
1194 incr bytescopied $::freewrap::stubsize
1196 if {$isFWcopy} {
1197 set filetime $fwCopy($fname)
1198 set filelen 0
1200 foreach {filepos filelen filetime needstub} $::freewrap::pkgInfo($fname) {}
1201 seek $filein $filepos end
1202 fcopy $filein $fileout -size $filelen
1203 close $fileout
1205 freewrap_setfiletime $filetime $newname
1206 incr bytescopied $filelen
1209 # complain that file wasn't found in the package.
1210 set msg "Can't find installation file $fname in $execname.\n\nThe file may be corrupted."
1211 tk_messageBox -type ok -message $msg -title "File not included" -icon error
1212 close $filein
1213 return 0
1217 set percent [expr {$bytescopied * 100.0 / $totsize}]
1218 upstat $percent
1222 if {$filein != ""} { close $filein }
1223 return 1
1226 proc file_getfreebytes {drive} {
1227 global env
1228 global tcl_platform
1229 global install_rootsize
1231 set rtnval 0
1232 if {$tcl_platform(platform) == "windows"} {
1233 set cmdcom $env(COMSPEC)
1234 if {![catch {glob ${drive}:/*}]} {
1235 if {[catch {exec $cmdcom /c dir ${drive}:\\} dirlist]} {
1236 set rtnval 0
1238 set pos [expr [llength $dirlist] - 3]
1239 regsub -all "," [lindex $dirlist $pos] "" bytes
1240 set pos2 $pos
1241 incr pos2
1242 set units [lindex $dirlist $pos2]
1243 switch $units {
1244 MB { set rtnval [expr $bytes * 1024] }
1245 KB { set rtnval [expr $bytes / 1024] }
1246 default { set rtnval $bytes }
1251 return $rtnval
1254 proc freespace {args} {
1255 global drivespace
1257 if {$args == ""} { set volist [file volumes] } {set volist $args }
1258 foreach drive $volist {
1259 set driveletter [string index $drive 0]
1260 if {$driveletter > "b"} {
1261 set drivespace($driveletter) "[expr [file_getfreebytes $driveletter] / 1024] MB"
1266 proc install_files {} {
1267 # perform the installation
1268 global installResult
1269 global runbin
1270 global runscript
1271 global runprg
1272 global settings_runbin
1273 global settings_runscript
1274 global pkg_test
1275 global abortNow
1276 global runprgname
1277 global runprgdest
1279 ShowWindow.progress
1280 pack forget .progress.frame3
1281 pack forget .progress.frame1
1282 pack .progress.frame0 -after .progress.frame11 -fill x -side top
1283 pack .progress.frame6 -after .progress.frame0 -fill x -side bottom
1285 set runprg ""
1286 if {$runbin} {
1287 set runprg $settings_runbin
1288 } elseif {$runscript} {
1289 set runprg $settings_runscript
1291 set runprgname [lindex $runprg 0]
1292 set runprgdest ""
1293 set success [copy_files]
1294 if {$success} {
1295 if {[abort]} {
1296 success = 0
1298 pack forget .progress.frame0
1299 if {$runprg != ""} {
1300 pack .progress.frame3 -after .progress.frame11 -fill x -side top
1301 update
1302 if {0 && $pkg_test} {
1303 # simulate running the program by pausing 3 seconds
1304 after 3000
1306 # Really run the program
1307 if {$runprgdest != ""} {
1308 set runprg "\{$runprgdest\} [lrange $runprg 1 end]"
1310 puts "Running $runprg"
1311 if {$runscript} {
1312 exec_runscript $runprg
1314 if {$runbin} { catch "exec $runprg" }
1316 pack forget .progress.frame3
1319 pack .progress.frame1 -after .progress.frame11 -fill x -side top
1320 set installResult " Installation completed successfully"
1322 if {$success == "0"} {
1323 pack forget .progress.frame0
1324 pack .progress.frame1 -after .progress.frame11 -fill x -side top
1325 set installResult " Installation failed"
1327 pack forget .progress.frame6
1330 proc pkg_exit {wname} {
1331 global pkg_test
1333 if {$pkg_test} {
1334 eval "DestroyWindow.$wname"
1335 set pkg_test 0
1336 } { exit }
1339 proc upstat {percent} {
1340 # This procedure updates the % complete status bar
1342 global completion
1344 if {[winfo exists .progress.frame0.canvas1]} {
1345 if {$percent < 0.0} { set percent 0.0}
1346 if {$percent > 100.0} {set percent 100.0}
1347 set width [expr 3.0 * $percent + 4]
1348 .progress.frame0.canvas1 coords statusbar 2.0 5.0 $width 24.0
1349 set completion [format "%5.1f" $percent]
1353 proc verify_dir {dirname} {
1354 # Verify the specified directory exists. Ask whether to create if it doesn't
1356 # Returns: if directory exists, the valid directory path with / separators
1357 # if directory doesn't exist, an empty string
1359 global settings_appName
1361 set titlestr "$settings_appName install"
1362 set createdir 0
1363 regsub -all {\\} $dirname "/" testpath
1364 if {[file isdir $testpath]} {
1365 set createdir 0
1367 if {[file exists $testpath]} {
1368 set msg "Error! $dirname is a file."
1369 set ans [tk_messageBox -icon warning -title $titlestr -type ok -message $msg]
1370 set testpath ""
1371 set createdir 0
1373 set msg "Directory $dirname\ndoes not exist. Create it?"
1374 set ans [tk_messageBox -icon question -title $titlestr -type yesno -message $msg]
1375 if {$ans == "yes"} {
1376 set createdir 1
1377 } { set testpath "" }
1380 if {$createdir} {
1381 if {[catch {file mkdir $testpath} result]} {
1382 tk_messageBox -icon error -title $titlestr -type ok -message $result
1383 set testpath ""
1387 return $testpath
1390 proc exec_runscript {cmd} {
1391 set err none
1392 if { [catch {source $cmd } err ] } {
1393 puts errror=$err
1397 proc freewrap_setfiletime {time file} {
1398 file mtime $file $time
1401 proc tkerror {args} {
1402 error "$args"
1405 source ./deliver/pkginfo.tcl
1406 source ./deliver/zipinfo.tcl
1408 # main code
1409 wm withdraw .
1410 ShowWindow.welcome