📄 register.tcl
字号:
}
set ret [prompt]
switch -regexp -- $ret {
"^-$" { set question "company" }
"^$" {
instKeySet [lindex [instKeyDataGet] 0]
set question "done"
}
"^[0-9]+" {
if { $ret > 0 && $ret <= $length } {
set index [expr $ret - 1]
instKeySet [lindex [instKeyDataGet] $index]
set question "done"
} else {
puts "Error: Invalid input: $ret\n"
set question "key"
}
}
"[eE][xX][iI][tT]" { return 0 }
default {
instKeySet $ret
set question "done"
}
}
} else {
set ret [prompt "Enter your key:"]
switch -regexp -- $ret {
"^-$" { set question "company" }
"[eE][xX][iI][tT]" { return 0 }
default {
if { $ret == "" } {
set question "key"
} else {
instKeySet $ret
set question "done"
}
}
}
}
}
}
}
nextCallback
return 0
}
}
#############################################################################
#
# onFindZipFileDlgCancel - close the findZipFileDlg dialog box
#
# This procedure will close the findZipFileDlg dialog box when the cancel
# button is pushed
#
# SYNOPSIS
# .tS
# onFindZipFileDlgCancel
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc onFindZipFileDlgCancel {} {
if [catch {windowClose findZipFileDlgHnd} error] {
puts "Error: $error"
}
}
#############################################################################
#
# onFindZipFileDlgOK - close the findZipFileDlg dialog box
#
# This procedure will save the zip directory and close the findZipFileDlg
# dialog box when the cancel button is pushed
#
# SYNOPSIS
# .tS
# onFindZipFileDlgOK
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc onFindZipFileDlgOK {} {
set dir [string trim [controlValuesGet findZipFileDlgHnd.zipDirText]]
cdromZipDirSet [file join $dir WIND]
windowClose findZipFileDlgHnd
}
#############################################################################
#
# findZipFileDlgInit - place default zip directory in zipDirText edit box
#
# This procedure will place default zip directory in zipDirText edit box
#
# SYNOPSIS
# .tS
# findZipFileDlgInit
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc findZipFileDlgInit {} {
controlValuesSet findZipFileDlgHnd.zipDirText [cdromZipDirGet]
controlFocusSet findZipFileDlgHnd.zipDirText
}
#############################################################################
#
# findZipFileDlg - create dialog box for finding WIND zip files
#
# This procedure will create dialog box for finding WIND zip files
#
# SYNOPSIS
# .tS
# findZipFileDlg
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc findZipFileDlg {} {
global ctrlVals
global setupVals
if { [isGUImode] } {
set controls [list \
[list label -title \
[strTableGet REGISTRATION_NO_ZIP_FILE] \
-name zipDirLabel \
-xpos 7 -ypos 10 -width 186 -height 80] \
[list label -name windLabel \
-title "archive directory" \
-xpos 12 -ypos 134 -w 100 -h 8] \
[list frame -name zipDirFrame \
-xpos 7 -ypos 144 -width 198 -height 24] \
[list text -name zipDirText -border \
-xpos 11 -ypos 149 -width 133 -height 14 ] \
[list button -title "&Browse" -name browse \
-xpos 150 -ypos 149 -width 50 -height 14 \
-callback {onFindZipFileBrowse zipDirText} ] \
[list button -title "&Cancel" -name cancelButt \
-xpos 150 -ypos 173 -width 50 -height 14 \
-callback onFindZipFileDlgCancel ] \
[list button -title "&OK" -name okButt -default \
-xpos 94 -ypos 173 -width 50 -height 14 \
-callback onFindZipFileDlgOK] \
]
dialogCreate \
-name findZipFileDlgHnd \
-title "Locating archive files" \
-width 212 -height 195 \
-parent $ctrlVals(mainWindow) \
-init findZipFileDlgInit \
-controls $controls \
-helpfile $setupVals(setupHelp)
}
}
#############################################################################
#
# pageProcess(registration) - process inputs from registration page
#
# This procedure will process inputs from registration page
#
# SYNOPSIS
# .tS
# pageProcess(registration)
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc pageProcess(registration) {} {
global setupVals
global ctrlVals
global infVals
global patchPath skipInstalloverCheck
global env TORNADO_PRODUCT
global projLic
global projName
global projLicUsers
set MAX_KEY_LENGTH 45
if { [isStandAlone] } { pageRemove projectInfo }
if { [isGUImode] } {
beginWaitCursor
if {[string compare "none" [instKeyGet]] != 0} {
instKeySet [controlValuesGet $ctrlVals(mainWindow).keyText -edit]
}
}
# parse to find if patch
if {[string first "PATCH" [instKeyGet]] == 0} {
set patchPath [string range [instKeyGet] 6 end]
set patchPath [string trim $patchPath]
instKeySet none
} elseif { [string length [instKeyGet]] > $MAX_KEY_LENGTH } {
if { [isGUImode] } {
messageBox "[strTableGet REGISTRATION_WARN_6]"
} else {
puts "[strTableGet REGISTRATION_WARN_6]"
}
return 0
}
set retVal 1
if {![catch {setupKeyValidate [instKeyGet]} error]} {
set setupVals(WRSLicense) [setupLicenseNumGet]
set projLic $setupVals(WRSLicense)
# For NON-BSP CD ONLY:
# DO NOT save install key containing license number 0
if { $setupVals(WRSLicense) == 0 && ![isBSPcd] } {
set setupVals(instKeyNotSaved) 1
dbgputs "Non-BSP CD with license 0: install key NOT saved"
} else {
if { [info exists setupVals(instKeyNotSaved)] } {
unset setupVals(instKeyNotSaved)
}
}
if { [isGUImode] } {
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
catch {cd c:/}
if {[instTypeGet] != "licenseError"} {
if ![catch {setupInit [cdromZipDirGet]} error] {
# user has a new location for ZIP files, and
# installation key may not match the CD id in DISK_ID
# so we don't write the key to registry
if ![info exists setupVals(noZipDir)] {
# do not write to the registry if hidden box is checked
# for WRS products only
if { ![isStandAlone] } {
if { ![info exists setupVals(instKeyNotSaved)] } {
# Set keyData to be written to the registry.
setKeyDataRegistryValue
} else {
# remove the key if found in registry
modKeyDataRegistryValue
}
}
}
} else {
if { [isGUImode] } {
# test automation
if { $ctrlVals(useInputScript) } {
autoSetupLog "\tError in CD: $error\n"
autoSetupLog "Application Exit\n"
set setupVals(cancel) 1
applicationExit
return 0
}
switch -exact -- $error {
BAD_CD_KEY {
messageBox [strTableGet REGISTRATION_WARN_2]
return 0
}
BAD_CD_REVISION {
#messageBox [strTableGet REGISTRATION_WARN_4]
# do not write to the registry if hidden box
# is checked
# for WRS products only
if { ![isStandAlone] } {
if ![info exists setupVals(instKeyNotSaved)] {
setKeyDataRegistryValue
} else {
# remove the key if found in registry
modKeyDataRegistryValue
}
}
set retVal 1
}
BAD_CD_VENDOR_ID {
messageBox [strTableGet REGISTRATION_WARN_3]
return 0
}
NO_ZIP_FILE {
# if NO LM error, display NO_ZIP error message
# First check to see if patch path present
if {$patchPath != ""} {
set env(CD_ROOT) $patchPath
cdromZipDirSet [file join $patchPath WIND]
checkBSPcd
set skipInstalloverCheck 1
if [catch {setupInit [cdromZipDirGet]} error] {
return 0
}
} elseif {$setupVals(lmError) == "" && [instTypeGet] != "licenseSetup"} {
set setupVals(noZipDir) 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -