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

📄 register.tcl

📁 windml3.0.3
💻 TCL
📖 第 1 页 / 共 4 页
字号:

    if {"[userNameGet]" == ""} {
        if {![catch {sysRegistryValueRead HKEY_CURRENT_USER \
                 "Software\\$setupVals(WRS)" "name"} name]} {

            userNameSet $name

        } elseif {![catch {sysRegistryValueRead HKEY_LOCAL_MACHINE \
                 "SOFTWARE\\$setupVals(WRS)" "name"} name]} {

            userNameSet $name
        } else {
            userNameSet ""
        }
    }

    # Load company name from the previous installation if any

    if {"[companyNameGet]" == ""} {
        if {![catch {sysRegistryValueRead HKEY_CURRENT_USER \
                 "Software\\$setupVals(WRS)" "company"} company]} {

            companyNameSet $company

        } elseif {![catch {sysRegistryValueRead HKEY_LOCAL_MACHINE \
                 "SOFTWARE\\$setupVals(WRS)" "company"} company]} {

            companyNameSet $company
        } else {
            companyNameSet ""
        }
    }

    # Load installation key from the previous installation if any

    if {![catch {sysRegistryValueRead HKEY_CURRENT_USER \
                     "Software\\$setupVals(WRS)" "keyData"} keyString]} {
        instKeyDataSet [getKeyData $keyString $setupVals(CDnumber) list]

    } elseif {![catch {sysRegistryValueRead HKEY_LOCAL_MACHINE \
                     "SOFTWARE\\$setupVals(WRS)" "keyData"} keyString]} {
        instKeyDataSet [getKeyData $keyString $setupVals(CDnumber) list]

    } else {
        instKeyDataSet ""
    }
}

#############################################################################
#
# getKeyData - search for the requested CD number in string of keys and
#              CD numbers and return either the installation key or the
#              combination of key and the CD number
#
# This procedure will search for the requested CD number in string of keys and
# CD numbers and return either the installation key or the combination of
# key and the CD number
#
# SYNOPSIS
# .tS
# getKeyData <keyString> <CDnumber> <data>
# .tE
#
# PARAMETERS:
# .IP keyString
# the entire list of keys and CD number read from the registry
# .IP CDnumber
# the CD number (TDK-XXXXX-XX-XX) to look for in keyString
# .IP data
# data to be fetched - key  -- installation key
#                    - list -- combination of key and CD number
#
# RETURNS: either the installation key or the combination of
#          key and the CD number
#
# ERRORS: N/A
#

proc getKeyData {keyString CDnumber {data {key list}}} {


    for {set idx 0} {$idx < [llength $keyString]} {incr idx} {
        set combo [lindex $keyString $idx]
        set found [lsearch $combo $CDnumber]
        if {$found != -1} {
            switch -exact $data {
                key     { return [lindex $combo 1]}
                list    { return [lrange $combo 1 end]}
                default { dbgputs "getKeyData: bad argument: $data"
                          return ""
                }
            }
        }
    }

    return ""
}

##############################################################################
#
# objectConstruct - creates objects to store all information about the unlocked
#                   products.
#
# This function must be called prior to the following functions: cdInfoGet/Set
# SYNOPSIS
# objectConstruct
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc objectConstruct {} {
    global productObj partObj featureObj cdObj
    global constructed
    global setupVals


    if {![info exists constructed([instKeyGet])]} {

        catch {
            unset constructed
            unset productObj
            unset partObj
            unset featureObj
            unset setupVals(tornadoIndex)
            unset setupVals(drvIndex)
        }

        set constructed([instKeyGet]) 1
        set productDescList {}
        set setupVals(drvIndex) -1

        foreach prodIndex [setupProductIndexListGet] {

            set productObj($prodIndex,instFlag) 0
            set productObj($prodIndex,prevInstFlag) 0
            set productObj($prodIndex,partIndexList) {}

            set partIndexList [setupPartIndexListGet $prodIndex]

            foreach partIndex $partIndexList {

                set infoList [setupPartInfoGet $partIndex]

                set productNum    [lindex $infoList 0]
                set productName   [lindex $infoList 1]
                set productDesc   [lindex $infoList 2]
                set partName      [lindex $infoList 3]
                set partDesc      [lindex $infoList 4]
                set productIndex  [lindex $infoList 5]
                set defInstFlag   [lindex $infoList 6]
                set totalFile     [lindex $infoList 7]
                set featureDesc   [lindex $infoList 8]
                set featureId     [lindex $infoList 9]
                set size          [lindex $infoList 10]
                set coreProd      [lindex $infoList 12]

                # WORKAROUND to solve the problem of the double
                # quote at the end of product and part descriptions

                set productDesc [string trimright $productDesc \"]
                set partDesc [string trimright $partDesc \"]

                # record the prodIndex of the drivers product

                if {[string compare $productName "tornado-comp-drv"] == 0} {
                    if {[lindex $setupVals(drvIndex) 0] == -1} {
                        set setupVals(drvIndex) \
                            [lreplace $setupVals(drvIndex) 0 0]
                    }
                    set lineIx [string last ":" $productDesc]
                    set lineLen [string length $productDesc]
                    set arch [string range $productDesc \
                             [expr $lineIx+2] $lineLen]
                    lappend setupVals(drvIndex) [list $prodIndex $arch]
                }

                if {[string compare $productName "tornado"] == 0} {
                    set lineIx [string last "x" $productDesc]
                    set lineLen [string length $productDesc]
                    set arch [string range $productDesc \
                             [expr $lineIx+2] $lineLen]
                    lappend setupVals(tornadoIndex) [list $prodIndex $arch]
                }


                if {[string compare $productName "tornado-vxsim"] == 0 } {
                    set lineIx [string last ":" $productDesc]
                    set lineLen [string length $productDesc]
                    set arch [string range $productDesc \
                             [expr $lineIx+2] $lineLen]
                    switch -exact -- $arch {
                        hp9700          { set arch simhppa }
                        x86-winNT       { set arch simnt }
                        solaris         { set arch simsolaris }
                    }
                    lappend setupVals(tornadoIndex) [list $prodIndex $arch]
                }

                # construct CD object

                if {![info exists cdObj(number)]} {
                    set cdObj(number) [lindex $infoList 11]
                }

                # construct product objects

                set productObj($prodIndex,number) $productNum
                set productObj($prodIndex,name) $productName
                set productObj($prodIndex,desc) $productDesc
                set productObj($prodIndex,featureId) $featureId
                set productObj($prodIndex,coreProd) $coreProd
                lappend productObj($prodIndex,partIndexList) $partIndex
 
                # construct part objects

                set partObj($partIndex,instFlag) $defInstFlag
                set partObj($partIndex,prevInstFlag) $defInstFlag
                set partObj($partIndex,desc) $partDesc
                set partObj($partIndex,size) $size
                set partObj($partIndex,totalFile) $totalFile
                set partObj($partIndex,parent) $prodIndex
                set partObj($partIndex,coreProd) $coreProd

                set featureObj($featureId) $featureDesc

                if {"$defInstFlag" == "1"} {
                    set productObj($prodIndex,instFlag) 1
                    set productObj($prodIndex,prevInstFlag) 1
                }
            }

            if {[llength $partIndexList] == 1} {
                set partObj([lindex $partIndexList 0],instFlag) 1
                set partObj([lindex $partIndexList 0],prevInstFlag) 1
            }

            lappend productDescList \
                    [list $productObj($prodIndex,desc) $prodIndex]
        }

        set cdObj(productIndexList) {}
        foreach pair [lsort $productDescList] {
            lappend cdObj(productIndexList) [lindex $pair 1]
        }
    } 

    # make the list of tornado indices unique

    if {[info exists setupVals(tornadoIndex)]} {
        set setupVals(tornadoIndex) [lunique $setupVals(tornadoIndex)]
    }

    dbgputs "finish constructing the products array"


}

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

set strTable(REGISTRATION_TITLE) "User Registration"

set strTable(REGISTRATION_FAE_WARN_1) \
    "The installation key you are about to enter will NOT\
     be saved in the system registry.\nIs this what you want?"

set strTable(REGISTRATION_MSG_1) \
    "Your installation key is provided on the\
     [string toupper [getProdInfo name]] Installation Keys sheet\
     that accompanies your product CDs.  If you have already installed\
     other products from the same CD, you can select the key from the\
     drop-down list."

set strTable(REGISTRATION_MSG_1_BSP) \
    "Below, type your name, the name of your company, and the BSP\
     installation key."

set strTable(REGISTRATION_MSG_2) "Name"

set strTable(REGISTRATION_MSG_3) "Company"

set strTable(REGISTRATION_MSG_4) "Install Key"

set strTable(REGISTRATION_MSG_5) "Information"

set strTable(REGISTRATION_NO_ZIP_FILE_TITLE) \
    "Locating Archive Files"

set strTable(REGISTRATION_NO_ZIP_FILE) \
    "format %s \"SETUP cannot find the ZIP files for installing\
    \[cdromDescGet\] in the default directory.\n\n\
    Please type the root of the\
    path containing the ZIP files.\n\nClick the\
    <Browse> button to choose the directory interactively.\""

set strTable(REGISTRATION_NO_ZIP_FILE_TEXT) \
    "format %s \"SETUP cannot find the ZIP files for installing\
    \[cdromDescGet\] in the default directory.\n\n\
    Please type the root of the\
    path containing the ZIP files.\n\""

set strTable(REGISTRATION_WARN_1) \
    "This CD-ROM does not require an installation key.  Click the \"Next\"\
     button to continue the installation."

set strTable(REGISTRATION_WARN_2) \
    "You entered a key that was not created for this CD-ROM.  Please verify\
     that you are using the appropriate key.  If this problem persists, contact\
     Wind River Systems Sales department for help."

set strTable(REGISTRATION_WARN_3) \
    "The installation key you entered is meant for other vendor's CD-ROM.\
     Please contact the vendor who issued the CD-ROM for a proper key."

set strTable(REGISTRATION_WARN_4) \
    "This CD-ROM does not require an installation key.  Click the \"Next\"\
     button to continue the installation."

set strTable(REGISTRATION_WARN_4_TEXT) \
    "This CD-ROM does not require an installation key.  Click the \"Next\"\n\
     button to continue the installation."

set strTable(REGISTRATION_WARN_5) \
    "format %s \"Can\'t initiate SETUP: \[lindex \$args 0\].  Please correct\
                 the problem then run SETUP again, exit SETUP when prompted.\""

set strTable(REGISTRATION_WARN_6) \
    "The installation key you entered is invalid - please re-check it.\
     Note that the key must be entered exactly as shown, including\
     capitalization and dashes."

set strTable(REGISTRATION_WARN_7) \
    "Please enter the requested information."

# DELETE? no longer used
set strTable(4030_NO_ZIP_FILE) \
    "format %s \"SETUP cannot find the ZIP files for installing\
               \[cdromDescGet\] in the default directory.\n\n\
               Please type the root of the\
               path containing the ZIP files.\n\nClick the\
               <Browse> button to choose the directory interactively.\""

⌨️ 快捷键说明

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