📄 instw32.tcl
字号:
# INSTW32.TCL - UITcl script for Windows Installation scheme
#
# Copyright 1996 Wind River Systems, Inc.
#
# modification history
# -----------------------
# 02g,01jul97,pdn fixed the available diskspace problem.
# 02f,13jun97,pdn added error handling in case key vendor mismatch.
# 02e,08apr97,pdn fixed remote icon install problem, fixed mail sending
# problem, copied *.TXT from root of CDROM to root of
# tornado tree.
# 02d,28mar97,pdn fixed the problem that torVarCreate get call too early
# 02c,25mar97,pdn asigned 'localHost' to WIND_REGISTRY if user chooses to
# run wtxregd.exe locally.
# 02b,17mar97,pdn used "WindLM" instead of "Wind License Manager" for
# service name on NT.
# 02a,12mar97,pdn fixed setup problem when portMapper is running.
# 01z,07mar97,pdn fixed the resource logging problem.
# 01y,05mar97,pdn sorted the product list.
# 01w,03mar97,pdn added the minimize flag when creating icons in the startup
# group. created uninstall icon for all Window hosts.
# added -p option for patch installation.
# 01v,13feb97,pdn improved license installation steps.
# 01u,09feb97,pdn added option to configure a floating license server
# 01t,04feb97,pdn filted out unused messages from checklist box.
# 01s,24jan97,pdn cleanup
# 01r,24jan97,pdn adjusted welcome, and component select dialog.
# 01q,22jan97,pdn fixed folder install bug.
# 01p,21jan97,pdn saved the last Tornado group, fixed license install
# 01o,20jan97,pdn used backslashes where possible, saved installation key
# 01n,16jan97,pdn surrounded the if conditions w/ braces
# 01m,13jan97,pdn fixed WIND_REGISTRY location, fixed checklist logic,
# moved uninstBinCopy() to INSTALL.TCL, and clean up.
# 01l,06jan97,pdn updated billboard cyling by product. cleanup text.
# 01k,18dec96,sks cleaned up; better error handling on startup; rearranged code
# a bit; create & destroy TMP dir.; change location of "TCL" &
# "BITMAPS" directories; renamed "TEXT.TCL" to "MESSAGES.TCL"
# 01j,12dec96,pdn added BAD_CD_REVISION check
# 01i,11dec96,pdn displayed the feature id/description
# 01h,24nov96,sj eliminated premature returns.
# 01g,18nov96,sj replaced global variables with functions
# from GLOBAL.TCL
# 01f,14nov96,sj moved all text messages to TEXT.TCL
# 01e,08nov96,sj queued up all registry key and value
# writes until the end of uninstBinCopy.
# 01d,06nov96,sj setup now works on 95 and NTs.
# 01c,30oct96,sj completed the license setup
# 01b,10may96,pdn adding setup wizard.
# 01a,19apr96,sks written.
#
###########################################################################
#
# Setup Wizard Processing Routines
proc pageCreate(welcome) {} {
global ctrlVals
global setupVals
set ctrlVals(volatileFrm) [list \
[list bitmap -name bmp -title \
"[cdromRootDirGet]\\RESOURCE\\BITMAPS\\SETUP.ICO"\
-x 101 -y 10] \
[list label -name msg1 \
-title [strTableGet 1000_WELCOME1]\
-x 135 -y 10 -w 169 -h 24] \
[list label -name msg2 \
-title [strTableGet 1010_WELCOME2]\
-x 101 -y 43 -w 204 -h 16] \
[list label -name msg3 \
-title [strTableGet 1020_WELCOME3]\
-x 101 -y 69 -w 204 -h 40] \
[list label -name msg4 \
-title [strTableGet 1030_WELCOME4]\
-x 100 -y 119 -w 205 -h 16] \
[list label -name msg5 \
-title [strTableGet 1040_WELCOME5]\
-x 100 -y 145 -w 205 -h 24] \
]
set w [dlgFrmCreate [strTableGet 1410_TITLE_WELCOME]]
# Disable the Back button since this is the first page
controlEnable $w.backButt 0
controlEnable $w.nextButt 1
controlFocusSet $w.nextButt
}
proc pageProcess(welcome) {} {
global ctrlVals
controlEnable $ctrlVals(mainWindow).backButt 1
return 1
}
proc pageCreate(privilege) {} {
global ctrlVals
set ctrlVals(volatileFrm) [list \
[list label -name message \
-title [strTableGet 1051_ROOT_WARN]\
-x 100 -y 10 -w 193 -h 100] \
]
set w [dlgFrmCreate [strTableGet 1420_TITLE_WARNING]]
}
proc pageProcess(privilege) {} {
return 1
}
proc pageCreate(registration) {} {
global ctrlVals
global setupVals
set ctrlVals(volatileFrm) [list \
[list label -name message1 \
-title [strTableGet 1060_REGISTRATION] \
-x 99 -y 10 -w 206 -h 27] \
[list label -name message2 \
-title "Name" \
-x 99 -y 56 -w 32 -h 10] \
[list label -name message3 \
-title "Company" \
-x 99 -y 80 -w 35 -h 10] \
[list label -name message4 \
-title "Key" \
-x 99 -y 104 -w 29 -h 8] \
[list text -name nameText -x 139 -y 56 -w 166 -h 13 \
-callback {onTextChange nameText name}] \
[list text -name companyText -x 139 -y 79 -w 166 -h 13 \
-callback {onTextChange companyText company}] \
[list text -name keyText -x 139 -y 102 -w 166 -h 13 \
-callback {onTextChange keyText key}] \
]
set w [dlgFrmCreate [strTableGet 1430_TITLE_REGISTRATION]]
registrationValuesReadFromRegistry
controlValuesSet $w.keyText [instKeyGet]
if {[instKeyGet] == "none"} {
controlEnable $w.keyText 0
}
controlValuesSet $w.companyText [companyNameGet]
controlValuesSet $w.nameText [userNameGet]
if {"[userNameGet]" == ""} {
controlFocusSet $w.nameText
} elseif {"[companyNameGet]" == ""} {
controlFocusSet $w.companyText
} else {
controlFocusSet $w.keyText
}
}
proc pageProcess(registration) {} {
global setupVals
global ctrlVals
beginWaitCursor
instKeySet [controlValuesGet $ctrlVals(mainWindow).keyText]
set retVal 0
if {![catch {setupKeyValidate [instKeyGet]} error]} {
companyNameSet [controlValuesGet $ctrlVals(mainWindow).companyText]
userNameSet [controlValuesGet $ctrlVals(mainWindow).nameText]
if {![regexp {^[ ]*$} [companyNameGet] junk] && \
![regexp {^[ ]*$} [userNameGet] junk]} {
# change dir to avoid pwd being a UNC directory which
# fails under Win95
cd c:/
if ![catch {setupInit [cdromZipDirGet]} error] {
# Store the user's name and company in the registry
storeUserDataIntoRegistry
set retVal 1
} {
if {"$error" == "BAD_CD_KEY"} {
messageBox [strTableGet 1080_WARN_2]
set retVal 0
} elseif {"$error" == "BAD_CD_REVISION"} {
exitWithMessage [strTableGet 1080_WARN_4]
} elseif {"$error" == "BAD_CD_VENDOR_ID"} {
messageBox [strTableGet 1080_WARN_3]
set retVal 0
} {
exitWithMessage [strTableGet 1090_WARN_3 $error]
}
}
} {
messageBox [strTableGet 1071_WARN_1]
}
} {
messageBox [strTableGet 1070_WARN_1]
}
objectConstruct
endWaitCursor
return $retVal
}
proc pageCreate(destDir) {} {
global ctrlVals
global setupVals
if {[instTypeGet] == "icon"} {
set msg [strTableGet 1100_REMOTE_DIR]
set labelText "Remote Directory"
} {
set msg [strTableGet 1100_DEST_DIR]
set labelText "Destination Directory"
}
set ctrlVals(volatileFrm) [list \
[list label -name dirLabel \
-title $msg \
-x 100 -y 10 \
-w 186 -h 80] \
[list group -name dirGroup \
-title $labelText \
-x 100 -y 141 -w 205 -h 29] \
[list text -name dirText \
-x 104 -y 151 \
-w 140 -h 14] \
[list button -name browse -title "Browse" \
-callback {onBrowse dirText} \
-x 249 -y 151 -w 50 -h 14] \
]
windBaseReadFromRegistry
set w [dlgFrmCreate [strTableGet 1440_TITLE_DESTDIR]]
controlValuesSet $w.dirText [destDirGet]
controlFocusSet $w.dirText
}
proc pageProcess(destDir) {} {
global setupVals
global ctrlVals
set retVal 1
set changeDir 0
destDirSet \
[string trim [controlValuesGet $ctrlVals(mainWindow).dirText] " "]
if {[regexp {^[a-zA-Z]:[\\|\/]*$} [destDirGet] junk]} {
if {![dialog yes_no "Setup" [strTableGet 1111_DEST_DIR_WARN]]} {
set retVal 0
}
}
if {![file isdirectory [destDirGet]] && "$retVal" == "1"} {
set i [dialog yes_no "Setup" [strTableGet 1110_DEST_DIR_WARN]]
switch $i {
0 {
if {![file exists [destDirGet]]} {
if {[catch {file mkdir [destDirGet]} error]} {
if {![file writable [destDirGet]]} {
messageBox [strTableGet 1130_DEST_DIR_WARN3]
} {
messageBox [strTableGet 1122_DEST_DIR_WARN2]
}
set retVal 0
}
} {
messageBox [strTableGet 1120_DEST_DIR_WARN2]
set retVal 0
}
}
1 {set retVal 0}
}
}
# Initiate the logging process
if {"$retVal" == "1"} {
if {[instTypeGet] != ""} {
uninstStart [instTypeGet]
} {
uninstStart
}
}
licenseHomeDirSet "[destDirGet]\\.wind\\license"
storeWindbaseIntoRegistry
return $retVal
}
proc pageCreate(compSelect) {} {
global ctrlVals
global setupVals
set ctrlVals(volatileFrm) [list \
[list label -name msg \
-title [strTableGet 1140_COMP_SELECT]\
-x 100 -y 9 -w 205 -h 24] \
[list label -name message2 \
-title "&Products" \
-x 100 -y 35 -w 198 -h 8] \
[list checklist -name optionList \
-callback onClickProdCheckList \
-x 100 -y 46 -w 207 -h 80] \
[list label -name reqText \
-title "Space Required:" \
-x 107 -y 145 -w 55 -h 8] \
[list label -name reqSpace \
-title "Unknown" \
-x 165 -y 145 -w 43 -h 8] \
[list label -name availText \
-title "Space Available:" \
-x 107 -y 157 -w 55 -h 8] \
[list label -name availSpace \
-title "Unknown" \
-x 165 -y 157 -w 43 -h 8] \
[list group -name frm1 -title "Information" \
-xpos 100 -ypos 133 -width 207 -height 37] \
[list button -title "&Details..." -name partDetailButt \
-xpos 249 -ypos 150 -width 50 -height 14 \
-callback partListDlg] \
]
set w [dlgFrmCreate [strTableGet 1450_TITLE_OPTION]]
productGuiChkLstCreate
productGuiSizeUpdate
}
proc pageProcess(compSelect) {} {
global ctrlVals
global setupVals
set retVal 1
set reqSpace [controlValuesGet $ctrlVals(mainWindow).reqSpace]
set availSpace [controlValuesGet $ctrlVals(mainWindow).availSpace]
if {[llength [cdInfoGet selectedProdIndexList]] == 0} {
messageBox [strTableGet 1151_COMP_SELECT_WARN]
set retVal 0
}
if {$reqSpace > $availSpace} {
set i [dialog yes_no "Setup" [strTableGet 1150_COMP_SELECT_WARN]]
switch $i {
0 { set retVal 0 }
1 { set retVal 1 }
}
}
return $retVal
}
proc pageCreate(folderSelect) {} {
global ctrlVals
global setupVals
set ctrlVals(volatileFrm) [list \
[list label -name msg1 \
-title [strTableGet 1161_FOLDER_SELECT]\
-x 100 -y 10 -w 205 -h 27] \
[list label -name msg2 -title "&Program Folder:" \
-x 100 -y 43 -w 85 -h 10] \
[list text -name folderName \
-callback onFolderName \
-x 100 -y 53 -w 205 -h 12] \
[list label -name msg3 -title "E&xisting Folders:" \
-x 100 -y 73 -w 85 -h 10] \
[list list -name folderList \
-callback onFolderSelect \
-x 100 -y 83 -w 205 -h 87] \
]
set w [dlgFrmCreate [strTableGet 1560_TITLE_FOLDER]]
controlValuesSet $w.folderName [folderValueReadFromRegistry]
controlValuesSet $w.folderList $ctrlVals(folders)
controlFocusSet $w.folderName
}
proc pageProcess(folderSelect) {} {
global ctrlVals
global setupVals
set retVal 0
defGroupSet [controlValuesGet $ctrlVals(mainWindow).folderName]
if {[regexp {^[ ]*$} [defGroupGet] junk]} {
messageBox [strTableGet 1162_FOLDER_SELECT]
} {
storeFolderIntoRegistry
set retVal 1
}
return $retVal
}
proc pageCreate(licenseChoice) {} {
global ctrlVals
global setupVals
set setupVals(licComp) ""
set ctrlVals(pageList) $ctrlVals(pageListBack)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -