📄 finish.tcl
字号:
if {$lmVals(lmHostOrder) == ""} {
set lmVals(lmHostOrder) $lmVals(lmHosts)
}
for {set ix 0} {$ix < [llength $lmVals(lmHostOrder)]} {incr ix} {
set hostName [lindex $lmVals(lmHostOrder) $ix]
set index [lmLicHostIndexGet $hostName]
set hostPort [lmLicHostInfoGet hostPort $index]
if {$hostPort == 0} {
set hostPort ""
}
if {$ix == 0} {
set hostInfo [format "%s@%s" $hostPort $hostName]
} else {
if { [isUnix] } {
set hostInfo [format ":%s@%s" $hostPort $hostName]
} else {
set hostInfo [format ";%s@%s" $hostPort $hostName]
}
}
append lmLicEnvVar $hostInfo
}
} else {
# manual
set hostInfo [format "%s@%s" $lmVals(lmPortManual) $lmVals(lmHostManual)]
append lmLicEnvVar $hostInfo
}
} else { # nodelocked
if { [isUnix] } {
set licPath "[destDirGet]/.wind/license/WRSLicense.lic"
} else {
set licPath "[destDirGet]\\.wind\\license\\WRSLicense.lic"
}
append lmLicEnvVar $licPath
}
if { ![isUnix] } {
if {![catch {sysRegistryValueRead HKEY_LOCAL_MACHINE \
"SOFTWARE\\FLEXlm License Manager"\
"LM_LICENSE_FILE"} lmLicFile]} {
# value exists, append to it and write it back out
set lmLicEnvVar "$lmLicEnvVar\;$lmLicFile"
# make sure license entries are unique
set tmp [split $lmLicEnvVar \;]
set lmLicEnvVar [lunique $tmp]
set lmLicEnvVar [join $lmLicEnvVar \;]
}
}
if { [isUnix] } {
if { [info exists env(LM_LICENSE_FILE)] } {
set lmLicEnvVarInfo [format "\n\ncsh:\nsetenv LM_LICENSE_FILE %s\
\n\nbash/sh/ksh:\nLM_LICENSE_FILE=%s\nexport\
LM_LICENSE_FILE\n" $lmLicEnvVar:\$\{LM_LICENSE_FILE\} $lmLicEnvVar:\$LM_LICENSE_FILE]
} else {
set lmLicEnvVarInfo [format "\n\ncsh:\nsetenv LM_LICENSE_FILE %s\
\n\nbash/sh/ksh:\nLM_LICENSE_FILE=%s\nexport\
LM_LICENSE_FILE\n" $lmLicEnvVar $lmLicEnvVar]
}
if { [isGUImode] } {
lappend ctrlVals(volatileFrm) \
[list text -name finishTextUnix -border -multiline\
-hscroll -vscroll -readonly\
-x 100 -y 23 -w 200 -h 150]
}
}
if { [isGUImode] } {
set w [dlgFrmCreate [strTableGet FINISH_TITLE]]
controlValuesSet $w.nextButt "Finish"
controlEnable $w.helpButt 0
controlEnable $w.backButt 0
controlEnable $w.nextButt 1
controlEnable $w.cancelButt 0
if { [isUnix] } {
controlTextSet $w.finishTextUnix "[strTableGet FINISH_MSG2]\
\n[destDirGet]/host/[windHostTypeGet]/bin/torVars.csh and\
\n[destDirGet]/host/[windHostTypeGet]/bin/torVars.sh.\
\n\n[string trimleft $lmLicEnvVarInfo]\
\n[strTableGet FINISH_MSG3]\
$outFileName."
# the following is to workaround a bug in UITclSh:
# if the user presses Return for the OK button,
# UITclSh does not exit.
if { !$ctrlVals(useInputScript) } {
set notice "[strTableGet FINISH_MSG_DIALOG]"
dialog ok_with_title \
"LM Environment Variables Setup" $notice
}
} else {
controlFocusSet $w.nextButt
}
# test automation
if { $ctrlVals(useInputScript) } {
autoSetupLog "License Management Finish Page: skipped"
autoSetupLog "[strTableGet FINISH_MSG1]"
if { [isUnix] } {
autoSetupLog "\n[strTableGet FINISH_MSG_COMMON]\
The information will be written to \
$outFileName for your convenience.\n"
}
nextCallback
}
} else { # TEXT mode
if { [isUnix] } {
puts "\n[strTableGet FINISH_MSG2]"
puts "\n[destDirGet]/host/[windHostTypeGet]/bin/torVars.csh and"
puts "\n[destDirGet]/host/[windHostTypeGet]/bin/torVars.sh.\n"
puts $lmLicEnvVarInfo
puts "[strTableGet FINISH_MSG3] $outFileName for your convenience.\n"
}
nextCallback
}
}
#############################################################################
#
# pageProcess(finish) - process inputs from LM finish page if any
#
# This procedure will process inputs from the license install finish page if
# any.
#
# SYNOPSIS
# .tS
# pageProcess(finish)
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: 1 when successful
#
# ERRORS: N/A
#
proc pageProcess(finish) {} {
global lmLicEnvVar lmLicEnvVarInfo
global env outFileName
global setupVals ctrlVals
if { [isGUImode] } {
# write the information to a file lmEnvVar.txt
if {[isUnix]} {
set outFileName "[destDirGet]/lmEnvVar.txt"
if {[catch {open $outFileName w} fd]} {
messageBox "Error opening output filename: $outFileName"
return
} else {
puts $fd [string trimleft $lmLicEnvVarInfo]
if {[catch {close $fd} err]} {
messageBox "Error closing file $outFileName"
}
}
# update torVars.sh and torVars.csh
updateTorVarsFiles
} else {
# check to see if the value exists:
# If not, create it. Otherwise, write to it.
if { ![catch {sysRegistryValueRead HKEY_LOCAL_MACHINE \
"SOFTWARE\\FLEXlm License Manager"\
"LM_LICENSE_FILE"} result] } {
# value exists, write to registry
regValueWriteLog HKEY_LOCAL_MACHINE \
"SOFTWARE\\FLEXlm License Manager" "LM_LICENSE_FILE" $lmLicEnvVar false
uninstLog setuplog "Wrote \"$lmLicEnvVar\" to \
HKEY_LOCAL_MACHINE\\SOFTWARE\\FLEXlm License Manager\\LM_LICENSE_FILE."
} else {
# the value doesn't exist, create and set value
regKeyCreateLog HKEY_LOCAL_MACHINE "SOFTWARE" "FLEXlm License Manager" false
regValueWriteLog HKEY_LOCAL_MACHINE \
"SOFTWARE\\FLEXlm License Manager" "LM_LICENSE_FILE" $lmLicEnvVar false
uninstLog setuplog "Created and wrote \"$lmLicEnvVar\" to \
HKEY_LOCAL_MACHINE\\SOFTWARE\\FLEXlm License Manager\\LM_LICENSE_FILE."
}
# flush the regKeyCreateLog and regValueWriteLog commands
queueExecute
}
} else { # text mode
# write the information to a file lmEnvVar.txt
if { [isUnix] } {
set outFileName "[destDirGet]/lmEnvVar.txt"
if {[catch {open $outFileName w} fd]} {
puts "Error opening output filename: $outFileName"
while { [prompt "Press <Enter> to Continue"] != "" } {
}
return
} else {
puts $fd [string trimleft $lmLicEnvVarInfo]
if {[catch {close $fd} err]} {
puts "Error closing file $outFileName"
while { [prompt "Press <Enter> to Continue"] != "" } {
}
}
}
# update torVars.sh and torVars.csh
updateTorVarsFiles
}
}
return 1
}
######################################################################
# Dialog Text Messages
######################################################################
set strTable(FINISH_TITLE) "Finish"
set strTable(FINISH_REBOOT) \
"You must reboot your machine in order to run [getProdInfo name]."
set strTable(FINISH_MSG_COMMON) \
"IMPORTANT:\n\
\nIn order to complete the installation, an environment variable\
LM_LICENSE_FILE has to be set or appended to the existing one for\
license management to work properly."
set strTable(FINISH_MSG_INSERT) \
"IMPORTANT:\n\
\nTo complete the installation, you must properly set the LM_LICENSE_FILE\
environment variable."
set strTable(FINISH_MSG_DIALOG) \
"[strTableGet FINISH_MSG_INSERT] \nPlease see the instructions on\
the Finish page."
set strTable(FINISH_MSG1) \
"License management has been successfully configured."
set strTable(FINISH_MSG2) \
"IMPORTANT:\n\
\nTo complete the installation, you must properly set the\
\nLM_LICENSE_FILE environment variable or append it to an\
\nexisting one. Add the following command to your startup\
\nscript and either reboot, re-execute the script, or enter the\
\ncommands manually.\
\n\nNote: The LM_LICENSE_FILE setting has also been\
\nadded to the Tornado environment scripts,"
set strTable(FINISH_MSG3) \
"You can use the copy\/paste keys to\
\ncopy this information from this page. The information\
\nis also in "
set strTable(FINISH_MSG4) \
"Please read the instructions on the Finish wizard page."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -