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

📄 lmoption.tcl

📁 vxworks WindML 3.0补丁包3 (CP3)
💻 TCL
📖 第 1 页 / 共 2 页
字号:
    if {[file exists $lmVals(lmLicenseFile)] } {
        set retVal 1
    } else {
        set retVal 0
    }

    return $retVal
}

#############################################################################
#
# NLlicFileValidCheck - validate the license file
#
# This routine validate the existing license file
# 
# SYNOPSIS
# .tS
# NLlicFileValidCheck
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: 0 if failed, non-zero if success. Return num is the setup page to
#          jump to
#
# ERRORS: N/A
#
proc NLlicFileValidCheck {} {
    global ctrlVals setupVals lmRetVal 

    if { [isGUImode] } {
        dialogCreate \
            -name NLlicFileValidCheckDlg \
            -notitle \
            -parent $ctrlVals(parentDialog) \
            -width 230 -height 32 \
            -init {
                controlPropertySet NLlicFileValidCheckDlg.message1 -bold 1; \
                windowTimerCallbackSet NLlicFileValidCheckDlg \
                -milliseconds 200 NLlicFileValidCheckCallback \
            } \
            -controls [list \
                [list bitmap -name bmp -stretch \
                             -title "[cdFileNameGet \
                                     [file join RESOURCE BITMAPS SETUPICO.BMP]]" \
                             -x 10 -y 5 -w 20 -h 20] \
                [list label -name "message1" \
                            -title [strTableGet LM_ANALYSIS_BANNER] \
                            -x 40 -y 12 -w 180 -h 10] ]
    } else { # TEXT mode       
        puts "[strTableGet LM_ANALYSIS_BANNER]\n"
        NLlicFileValidCheckCallback
    }

    # lmRetVal is set in NLlicFileValidCheckCallBack
    return $lmRetVal

}

#############################################################################
#
# NLlicFileValidCheckCallback - Call back function for NLlicFileValidCheck
#
# This routine validate the existing license file
# 
# SYNOPSIS
# .tS
# NLlicFileValidCheckCallback
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: 0 if failed, non-zero if success. Return num is the setup page to
#          jump to
#
# ERRORS: N/A
#
proc NLlicFileValidCheckCallback {} {
    global setupVals ctrlVals lmVals lmRetVal

    set retVal 1
    set errMsg ""
    set cannotOpen 0

    if { [isGUImode] } {
        windowTimerCallbackSet NLlicFileValidCheckDlg 0 ""
        beginWaitCursor
    }

    # check file opening and syntax

    if { [catch {open $lmVals(lmLicenseFile) r} fileId] } { 
        dbgputs "Cannot open license file"

        set cannotOpen 1
        set errMsg "Cannot open license file: $lmVals(lmLicenseFile)\
                    \nfor analysis." 
        uninstLog setup "Detected license file opening error."

        if { $ctrlVals(useInputScript) } {
            autoSetupLog "Cannot open license file: $lmVals(lmLicenseFile)."
        }
    } else {

        while { [gets $fileId line] >= 0 } {
            set line [string trim $line]

	    if { "$line" != "" && \
		 [regexp {^%.*} $line] } {
		 # found start of WR proprietary info, no more licensefile lines
		 break;
             }

            # check if the line has correct format
            if { "$line" != "" && \
                 [regexp {[SERVER|USE_SERVER|FEATURE|INCREMENT|BORROW|SIGN|VENDOR|HOSTID|DUP|PACKAGE].*} $line] } {
                dbgputs "License file can be opened and has a key word."

                uninstLog setup "License file can be opened and has a key word."

                if { $ctrlVals(useInputScript) } {
                    autoSetupLog "SETUP has detected that your license file \
                                  can be opened for analysis."
                }
                break
            } 
	        
        }
        close $fileId
    }

    if { $cannotOpen == 1} {
        # error with license file, skip current license info page
        pageRemove currLicInfo

    }

    set lmRetVal $retVal

    if { [isGUImode] } {
        endWaitCursor
        windowClose NLlicFileValidCheckDlg
    }
}

proc onReloadLicNL {} {
    global lmVals ctrlVals

    if {[isGUImode]} {
        set w $ctrlVals(mainWindow)

        if {[controlChecked $w.reloadCkbox]} {
            set lmVals(reloadExistingLicense) 1
            set lmVals(reload) 1
        } else {
            set lmVals(reloadExistingLicense) 0
            set lmVals(reload) 0
        }
    } else {
        puts "Do you want to recapture your existing license file? (y/n) \[n\] "
        set ret [prompt]
        if {$ret == "y"} {
            set lmVals(reloadExistingLicense) 1
            set lmVals(reload) 1
        } else {
            set lmVals(reloadExistingLicense) 0
            set lmVals(reload) 0
        }
    }
    dbgputs "reloadExistingLicense: $lmVals(reloadExistingLicense)"
}


#############################################################################
#
# licServerDialog() - create "License Server Information" dialog for GUI mode
#
# This procedure will create the "License Server Information" dialog for
# the manual page sequence, that allows the user to to enter the license
# server and port number. 
#
# SYNOPSIS
# .tS
# licServerDialog()
# .tE
#
# PARAMETERS: N/A
#
# RETURNS:  1 if successful
#
# ERRORS: N/A
#

proc licServerDialog {} {
    global ctrlVals
    global setupVals

    dialogCreate -nocontexthelp \
        -name licServerDlg \
        -parent $ctrlVals(mainWindow) \
        -title "Enter License Server Information" \
        -width 181 -height 133 \
        -controls [list \
            [list text -name serverNameEdit \
                   -xpos 82 -ypos 68 -width 64 -height 12 ] \
            [list text -name portNumberEdit  \
                   -xpos 82 -ypos 88 -width 64 -height 12 ] \
            [list button -title "OK" -name okButt -default \
	             -xpos 30 -ypos 112 -width 50 -height 14  \
                     -callback onLicServerOK ] \
            [list button -title "Cancel" -name cancelButt  \
                     -xpos 104 -ypos 112 -width 50 -height 14  \
                     -callback onLicServerCancel ] \
            [list label -title "Port number:" -name portNumberLabel  \
                    -xpos 30 -ypos 88 -width 48 -height 8 ] \
            [list label -title "Server name:" -name serverNameLabel  \
                    -xpos 30 -ypos 68 -width 48 -height 8 ] \
            [list label -title [strTableGet LM_OPTIONS_DIALOG_MANUAL] \
                   -name licInfoLabel -xpos 8 -ypos 4 -width 165 \
                   -height 60 ]
            ]	    
    return $setupVals(licDlgRet)
}

#############################################################################
#
# onLicServerOK() - OK callback for licServerDialog
#
# This procedure is the OK callback for the license server information 
# dialog.  The dialog values are read and verified to be valid, and
# the global lm manual variables are set to those values.  
#
# SYNOPSIS
# .tS
# onLicServerOK()
# .tE
#
# PARAMETERS: N/A
#
# RETURNS:  1 if successful, 0 otherwise.
#
# ERRORS: N/A
#

proc onLicServerOK {} {
    global setupVals lmVals
    
    set lmVals(lmPortManual) ""
    set lmVals(lmHostManual) ""    

    set lmVals(lmPortManual) [controlValuesGet licServerDlg.portNumberEdit]
    set lmVals(lmHostManual) [controlValuesGet licServerDlg.serverNameEdit]

    if {$lmVals(lmPortManual) == ""} {
        messageBox "Please enter a port number."
        controlFocusSet licServerDlg.portNumberEdit
        return 0
    }

    if {$lmVals(lmHostManual) == ""} {
        messageBox "Please enter a server name."
        controlFocusSet licServerDlg.serverNameEdit
        return 0
    }

    # check port number, should be numbers only

    if {[regexp {[^0-9]} $lmVals(lmPortManual)] == 1} {
        messageBox "Please enter a valid port number."
        controlFocusSet licServerDlg.portNumberEdit
        return 0
    } 

    # check server name, should have no spaces

    if {[regexp {[ ]} $lmVals(lmHostManual)] == 1} {
        messageBox "Please enter a valid server name."
        controlFocusSet licServerDlg.serverNameEdit
        return 0
    }
    
    set lmVals(lmHostOrder) $lmVals(lmHostManual)
    windowClose licServerDlg
    set setupVals(licDlgRet) 1    
}

#############################################################################
#
# onLicServerCancel() - cancel callback for licServerDialog
#
# This procedure is the cancel callback for the license server information 
# dialog.  
#
# SYNOPSIS
# .tS
# onLicServerCancel()
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A 
#
# ERRORS: N/A
#

proc onLicServerCancel {} {
    global setupVals

    windowClose licServerDlg

    # have to remove endUser pages in case user switches to 
    # nodelock

    pageListRemove endUser

    set setupVals(licDlgRet) 0
}

######################################################################
# Dialog Text Messages
######################################################################

set strTable(LM_OPTIONS_TITLE) "License Management Configuration"

set strTable(LM_OPTIONS_MSG_1) \
    "SETUP has detected that one or more products are\
    license managed.\
    Choose one of the license management configuration\
    options listed below, then click the Next button to\
    continue the installation:"

set strTable(LM_OPTIONS_MSG_1_TEXT) \
    "Setup has detected that one or more products require\
    license management configuration.\
    Choose one of the license management configuration\
    options listed below to continue the installation:\n"

set strTable(LM_OPTIONS_MSG_1_MANUAL) \
    "Setup has detected that one or more products are\
     license managed. A license server name must be provided,\
     or a node-locked license file must be obtained from\
     Wind River."

set strTable(LM_OPTIONS_BTN_1) \
    "Configure to use a floating license"

set strTable(LM_OPTIONS_BTN_1_MANUAL) \
    "Configure to use a local license server"

set strTable(LM_OPTIONS_BTN_1_DESC) \
    "Configure this machine to use a license from an\
     existing license server on the network."

set strTable(LM_OPTIONS_BTN_1_DESC_MANUAL) \
    "Configure this machine to use a license from an existing\
     license server on your local network.  The name of this\
     license server must be provided."  

set strTable(LM_OPTIONS_BTN_2) \
    "Request a node-locked license file"

set strTable(LM_OPTIONS_BTN_2_MANUAL) \
    "Request a node-locked license file"

set strTable(LM_OPTIONS_BTN_3) \
        "Recapture license previously configured for this machine."

set strTable(LM_OPTIONS_BTN_2_DESC) \
    "Request a node-locked license file for use by this machine only."

set strTable(LM_OPTIONS_BTN_2_DESC_MANUAL) \
    "Request a node-locked license file for use by this machine only."

set strTable(LM_OPTIONS_DIALOG_MANUAL) \
    "Enter the license server name and port number (default\
     value is 27000). Please check with your system administrator\
     for the correct values before you enter them."

set strTable(LM_ANALYSIS_BANNER) \
    "Analyzing License File. Please wait..."

set strTable(LM_FILE_INVALID) \
    "SETUP has detected that your license file has an invalid format.\
    Would you like to replace it?"

set strTable(LM_LIC_FILE_NOT_REPLACE) \
    "You have choosen not to replace your license file.\nPlease select another\
    License Management options."

⌨️ 快捷键说明

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