⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 liccfg.tcl

📁 WindML3.0补丁 WIND MEDIA LIBRARY 3.0.3 (CP3) for Tornado 2.2.0 and Tornado 2.2.1 Up-to-date produc
💻 TCL
📖 第 1 页 / 共 5 页
字号:

                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
}

#############################################################################
#
# rmPageList() - helper function to remove autoInst or nodeLock page list, 
#                depends on setupVals(lmInstType)
#
# This procedure will remove the autoInst or nodeLocke page list
#
# SYNOPSIS
# .tS
# rmPageList
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc rmPageList {} {
        global setupVals

        if {$setupVals(lmInstType) == "nodeLocked"} {
                pageListRemove dbQuery
                pageListRemove lmOptions
                pageListRemove nodeLock
        } elseif {$setupVals(lmInstType) == "floating"} {
                pageListRemove autoInst
        }

}

#############################################################################
#
# licenseConfirmInit() - Display License Summary information
#
# This procedure will display license summary
#
# SYNOPSIS
# .tS
# licenseConfirmInit(isFloatLic)
# .tE
#
# PARAMETERS: isFloatLic - 1 if floating license, else 0
#
# RETURNS:  1 if ok or 0 if cancel
#
# ERRORS: N/A
#

proc licConfirmDlgInit {} {
    global lmVals ctrlVals lmHostFeaturesNum

    set hostIndex [lsearch $lmVals(lmHosts) $lmVals(lmHostName)]
    if {$hostIndex == -1} {
        set numberOfFeatures 0
    } else {
        set numberOfFeatures [lindex $lmHostFeaturesNum $hostIndex]
    }

    # Fill in the informational text box for the users

    if {$lmVals(lmLicMode) == "floating"} {
        for {set ix 0} {$ix < [llength $lmVals(lmFeaturesTotal)]} {incr ix} {
            set feature [lindex $lmVals(lmFeaturesTotal) $ix]
            set featureName [lindex $feature 0]
            set fHostAllocated 0

            for {set ixf 0} {$ixf < $numberOfFeatures} {incr ixf} {

                # only if the feature is previously allocated on this host
                # (name match), retrieve allocated value

                if { $featureName == [lmLicProdInfoGet prodName $lmVals(lmHostName) $ixf] } {
                    set fHostAllocated \
                        [lmLicProdInfoGet licFLAllocated $lmVals(lmHostName) $ixf]
                }
            }

            set featureName [lindex $lmVals(lmLicensedProductNames) $ix]
            set featureTotal [expr [lindex $lmVals(lmFeaturesRequested) $ix] + $fHostAllocated]
            set featureOutput [list $featureName $featureTotal]
            lappend featureOutputList $featureOutput
        }

        controlPropertySet licConfirmDlg.floatSummaryTable -columnwidths {100 75} 
        controlValuesSet licConfirmDlg.floatSummaryTable $featureOutputList
    } else { # node locked

        # for Reload, display all feature names retrieved from database

        if {$lmVals(reload)} {
            for {set ix 0} {$ix < [llength $lmVals(lmFeaturesTotal)]} {incr ix} {
                set feature [lindex $lmVals(lmFeaturesTotal) $ix]
                set featureName [lindex $feature 0]
                set fHostAllocated 0

                for {set ixf 0} {$ixf < $numberOfFeatures} {incr ixf} {

                    # only if the feature is previously allocated on this host
                    # (name match), display that feature name
 
                    if { $featureName == [lmLicProdInfoGet prodName $lmVals(lmHostName) $ixf] } {
                        set fHostAllocated \
                            [lmLicProdInfoGet licNLAllocated $lmVals(lmHostName) $ixf]
                    }
                }
                if { $fHostAllocated != 0 } {
                    set line [format "%s\r\n" [lindex $lmVals(lmLicensedProductNames) $ix]]
                    append output $line
                }
            }

        } else { # otherwise, display features selected

            for {set ix 0} {$ix < [llength $lmVals(lmLicensedProductNames)]} {incr ix} {
                if {[lindex $lmVals(lmFeaturesRequested) $ix] == 1} {
                    set line [format "%s\r\n" [lindex $lmVals(lmLicensedProductNames) $ix]]
                    append output $line
                }
            }
        }

        controlPropertySet licConfirmDlg.nodelockSummaryTable -columnwidths {180} 
        controlValuesSet licConfirmDlg.nodelockSummaryTable $output
    }
}


#############################################################################
#
# licenseConfirm() - Display License Summary
#
# This procedure will display license summary
#
# SYNOPSIS
# .tS
# licenseConfirm()
# .tE
#
# PARAMETERS: N/A
#
# RETURNS:  1 if ok or 0 if cancel
#
# ERRORS: N/A
#
proc licenseConfirm {} {
    global ctrlVals setupVals lmVals lmHostFeaturesNum

    set ctrlVals(dlgRetVal) 0

    if { $setupVals(lmInstType) == "floating" } {
        set isFloatLic 1
    } else {
        set isFloatLic 0
    }

    set hostIndex [lsearch $lmVals(lmHosts) $lmVals(lmHostName)]

    if { [isGUImode] } {
 
        # Automation: skip display summary and populate autoSetupLog

        if { $ctrlVals(useInputScript) } {
            set ctrlVals(dlgRetVal) 1

            if {$lmVals(reload)} {
                autoSetupLog "Reload Existing License File Summary Page: skipped"
                autoSetupLog "[strTableGet LICCFG_DLGRLD_1]"

            } elseif {$lmVals(lmLicMode) == "floating"} {
                autoSetupLog "Floating License Configuration Summary Page: skipped"
                autoSetupLog "[strTableGet LICCFG_DLGMSG_1]"

            } else {
                autoSetupLog "NodeLocked License Configuration Summary Page: skipped"
                autoSetupLog "[strTableGet LICCFG_NODELOCK_DLGMSG_1]"
            } 

            # display values

            set hostIndex [lsearch $lmVals(lmHosts) $lmVals(lmHostName)]
            if {$hostIndex == -1} {
                set numberOfFeatures 0
            } else {
                set numberOfFeatures [lindex $lmHostFeaturesNum $hostIndex]
            }

            for {set ix 0} {$ix < [llength $lmVals(lmFeaturesTotal)]} {incr ix} {
                set feature [lindex $lmVals(lmFeaturesTotal) $ix]
                set featureName [lindex $feature 0]
                set fHostAllocated 0

                for {set ixf 0} {$ixf

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -