📄 liccfg.tcl
字号:
if {[isNumeric $reply]} { if {$reply == 1} { return -1 } } } } # No error, the reply is a valid token to be saved for the commit request set lmVals(token) [string trim $reply] set retVal [licenseConfirm] # check to make sure directory paths exists and is writable set path [destDirGet] set outFileName [file join $path .wind license WRSLicense.lic] set path1 [file join $path .wind license] while {![file isdirectory $path1]} { if {[catch [file mkdir $path1] err]} { # invalid path...exit SETUP if { [isGUImode] } { if { $ctrlVals(useInputScript) } { autoSetupLog "[strTableGet CANNOT_CREATE_PATH_1_TEXT]" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit set returnValue 0 return $returnValue } else { set ans [dialog resume_exit \ "License Management Configuration" \ [strTableGet CANNOT_CREATE_PATH_1]] dbgputs "Cannot create $path1" if {$ans == "1"} { applicationExit } } } else { dbgputs "Cannot create $path1" puts [strTableGet CANNOT_CREATE_PATH_1_TEXT] set msg "\nPress 1 to retry , 2 to exit SETUP\n" while (1) { switch -regexp -- [prompt $msg] { "^1$" { break } "^2$" { return 0 } } } } } } # update the return value to user's input (OK or CANCEL) set returnValue $retVal if {$retVal} { # OK on Summary page...commit # send the commit command and save the license file into the # licensefile dir [destDirGet]/.wind/license dbgputs "Commit: hostRec" set hostRec \ "$lmVals(lmHostName)|$lmVals(lmHostId)|$lmVals(lmPort)|$configList" set params [format "%s|%s|%s|%s|%s|%s|%s|%s|%s" \ $setupVals(WRSLicense) $setupVals(prodVer) \ $lmVals(token) $setupVals(sysAdminName) \ $setupVals(userPhone) $setupVals(userEmail) \ "SETUP" $setupVals(lmInstType) \ $hostRec] set reply 0 while {$reply == 0} { set reply [sendToALD $CommitRequest $params] if { [isGUImode] } { # if an error occurs either retry or go to lm options # if test automation, exit and put error log if {[isNumeric $reply]} { if {$reply == 1} { if { $ctrlVals(useInputScript) } { autoSetupLog "ERROR in sendToALD: $CommitRequest $params" autoSetupLog "Reply: $reply" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit set returnValue 0 return $returnValue } else { controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 windowClose licConfigDlg # remove autoInst or nodeLock page list rmPageList if {[instTypeGet] == "license"} { # Return to lmInstOptions page and set to email option set setupVals(lmInstOptions) "onEmail" set returnValue [calcPage lmInstOptions] } else { # Return to lmAutoManChoice page and set to manual # option set setupVals(lmAutoManChoice) "onManual" set returnValue [calcPage lmAutoManChoice] controlHide $ctrlVals(mainWindow).bitmap 0 } return $returnValue } } } } else { # TEXT MODE # if an error occurs, go to lm options if {[isNumeric $reply]} { if {$reply == 1} { return -1 } } } } if { [isGUImode] } { beginWaitCursor } # opening license file to update if {[catch {open $outFileName w} fd]} { # If errror, prompt message and exit SETUP set msg "Error opening license file output filename: $outFileName" uninstLog setup $msg dbgputs $msg if { $ctrlVals(useInputScript) } { autoSetupLog "$msg" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit set returnValue 0 return $returnValue } if { [isGUImode] } { endWaitCursor windowClose licConfigDlg set returnValue 0 return $returnValue } else { set msg "Press <Enter> to Continue" while { [prompt $msg] != "" } { } return 0 } } else { puts $fd $reply # closing license file if {[catch {close $fd} err]} { set msg "Error closing file $outFileName" uninstLog setup $msg dbgputs msg if { $ctrlVals(useInputScript) } { autoSetupLog "$msg" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit set returnValue 0 return $returnValue } } uninstLog setup "Setup wrote \"$reply\" to $outFileName" if { $ctrlVals(useInputScript) } { autoSetupLog "Setup wrote the following information\ to $outFileName:\n\"$reply\"" } } # success in updating the license file # proceed to next page if { [isGUImode] } { endWaitCursor # turn on the setup bitmap for next page controlHide $ctrlVals(mainWindow).bitmap 0 windowClose licConfigDlg } } else { # user click Cancel on Summary page (retVal=0) # Return to License Configuration page if { [isGUImode] } { windowClose licConfigDlg } else { # return to LICCFG page return 2 } } return $returnValue}############################################################################### pageProcess(licConfig) - process inputs from the licConfig page## This procedure will process inputs from the licConfig page## SYNOPSIS# .tS# pageProcess(licConfig)# .tE## PARAMETERS: N/A## RETURNS: 1 if successful## ERRORS: N/A#proc pageProcess(licConfig) {} { global ctrlVals setupVals lmVals global returnValue global licConfigReturn if { [isGUImode] } { controlEnable wizardDialog.nextButt 0 controlEnable wizardDialog.backButt 0 # test automation...store licenses information if { $ctrlVals(useInputScript) } { for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} { set featureName [lindex $lmVals(lmLicensedProductNames) $ix] set fAvailable [lmFeaturesValueGet lmFeaturesAvailable $featureName] if {$lmVals(lmLicMode) == "floating"} { set fAvailable [lmFeaturesValueGet lmFLFeaturesAvailable $featureName] set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix $fAvailable] } else { set fAvailable [lmFeaturesValueGet lmNLFeaturesAvailable $featureName] set lmVals(lmFeaturesRequested) \ [lreplace $lmVals(lmFeaturesRequested) $ix $ix 1] } } } # GUI mode: for update, prompt error if user entered all 0 for requests if { !$lmVals(reload) } { set isAllZero 1 for {set ix 0} {$ix < [llength $lmVals(lmFeaturesRequested)]} {incr ix} { if { [lindex $lmVals(lmFeaturesRequested) $ix] != 0 } { set isAllZero 0 } } if { $isAllZero } { dialog ok_with_title "ERROR: License Request" \ [strTableGet LICCFG_ZERO_ERROR] controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 return 0 } # SPR 76046 # detect if the host has been configured previously if { $setupVals(lmInstType) == "nodeLocked" } { if { [hasExistingNL] } { set ans [dialog yes_no_cancel "NodeLocked license" \ [strTableGet LICCFG_TO_RELOAD]] if { $ans == 0 } { # yes set lmVals(reload) 1 updateToNLRequest } elseif {$ans == 1} { # no set lmVals(reload) 0 } else { # cancel controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 return 0 } } } } licConfigDlgCreate if {[isUnix]} { pageRemove lmStartupOptions } controlEnable wizardDialog.nextButt 1 controlEnable wizardDialog.backButt 1 } else { # text mode # return to lmOptions if an error occurs in licConfigCallBack if { $licConfigReturn } { # remove autoInst or nodeLock page list rmPageList # Return to lmInstOptions page and set to email option set setupVals(lmInstOptions) "onEmail" return [calcPage lmInstOptions] } if {[isUnix]} { pageRemove lmStartupOptions } } return $returnValue}##############################################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -