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

📄 install.tcl

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

    if [catch {file copy -force $sourceFilePath $destFilePath} error] {
        set msg [strTableGet 1370_FILE_ACCESS_ERROR $destFilePath $error]

        if { $ctrlVals(useInputScript) } {
            autoSetupLog "$msg"
            autoSetupLog "Application Exit\n"
            set setupVals(cancel) 1                
            applicationExit
            return 0
        } else {    

            switch [dialog re_ig_cancel "Setup" $msg question 0] {
                0 {return [fileDup $sourceFilePath $destFilePath $option]}
                1 {
                    set msg "\tcannot create $destFilePath: $error"
                    lastErrorSet $msg
                    uninstLog setup $msg
                    return 0
                }
                default {quitCallback}
            }
        }
    }

    if {[info exists setupVals(fileMode)] && [windHostTypeGet] != "x86-win32"} {
        catch {exec chmod $setupVals(fileMode) $destFilePath}
    }

    # logging for later uninstall

    if ![info exists noLog] {
        uninstLog file "wind_base\t$relDestFilePathUnix"
    }
    return 1
}

##############################################################################
#
# pageRemove - removes an installation step
#
# This routine removes an element from the pageList which control the flow of
# the setup script.  Once an element is removed from the list, their associate
# functions, pageCreate() and pageProcess() will be skipped.
#
# SYNOPSIS
# pageRemove <pageName>
#
# PARAMETERS:
#    <pageName> : an element in the pageList
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc pageRemove {page} {
    global ctrlVals

    if {[lsearch $ctrlVals(pageList) $page] == "-1"} {
        dbgputs "cannot find page $page to remove"
    } else {
        set tempList ""

        foreach p $ctrlVals(pageList) {
            if {"$p" != "$page"} {
                lappend tempList $p
            }
        }
        set ctrlVals(pageList) $tempList
    }
}

##############################################################################
#
# cdInfoGet - returns the requested information
#
# Following is the list of available commands:
#
# Command                 Meaning
# -------                 -------
# number                  the name of the CDROM
# size                    the total size of unlocked products
# totalFile               the total files of unlocked products
# stateInfo               the global selection information
# featureIdList           the feature list of unlocked products
# productIndexList        the index list of unlocked products
# selectedProdIndexList   the selected products index list
# selectedProdNameList    the selected products name list
# installedFeatureIdList  the selected feature id list
#
# SYNOPSIS
# cdInfoGet <command>
#
# PARAMETERS:
#    <command> : one of the above commands
#
# RETURNS: the requested information
#
# ERRORS: N/A
#

proc cdInfoGet {info} {
    global cdObj

    switch $info {
        number { return $cdObj(number) }

        productIndexList { return $cdObj(productIndexList) }

        selectedProdIndexList {
            set retVal {}

            foreach prodIndex $cdObj(productIndexList) {
                if {[productInfoGet instFlag $prodIndex]} {
                    lappend retVal $prodIndex
                }
            }

            return $retVal
        }

        selectedProdNameList {
            set retVal {}

            foreach prodIndex [cdInfoGet selectedProdIndexList] {
                set prodName [productInfoGet name $prodIndex]

                if {[lsearch $retVal "$prodName"] == "-1"} {
                    lappend retVal $prodName
                }
            }

            return $retVal
        }

        size {
            set retVal 0

            foreach selProdIndex [cdInfoGet selectedProdIndexList] {
                incr retVal [productInfoGet size $selProdIndex]
            }

            return $retVal
        }

        totalFile {
            set retVal 0

            foreach selProdIndex [cdInfoGet selectedProdIndexList] {
                incr retVal [productInfoGet totalFile $selProdIndex]
            }

            return $retVal
        }

        installedFeatureIdList {
            set retVal {}

            foreach selProdIndex [cdInfoGet selectedProdIndexList] {
                set fId [productInfoGet featureId $selProdIndex]

                if {($fId > 0) && ([lsearch $retVal $fId] == -1)} {
                    lappend retVal $fId
                }
            }
            return $retVal
        }

        featureIdList {
            set retVal {}

            foreach prodIndex [cdInfoGet productIndexList] {
                set fId [productInfoGet featureId $prodIndex]

                if {($fId > 0) && ([lsearch $retVal $fId] == -1)} {
                    lappend retVal $fId
                }
            }

            return $retVal
        }

        stateInfo {
            set totalPrev 0
            set totalCurr 0
            set state "unchanged"

            foreach prodIndex [cdInfoGet productIndexList] {

                set prev [productInfoGet prevInstFlag $prodIndex]
                set curr [productInfoGet instFlag  $prodIndex]

                incr totalPrev $prev
                incr totalCurr $curr

                if {"$prev" != "$curr"} {
                    set state "changed"
                }
            }

            return [stateInfoHelper $state $totalCurr $totalPrev]
        }

        default { puts "cdInfoGet: unknown command: $info" }
    }
}

##############################################################################
#
# featureDescGet - returns the feature name given the feature id
#
# SYNOPSIS
# featureDescGet <featureId>
#
# PARAMETERS:
#    <featureId> : an integer
#
# RETURNS: the associated feature description or unknown if not exists.
#
# ERRORS: N/A
#

proc featureDescGet {featureId} {
    global featureObj

    if [info exists featureObj($featureId)] {
        return $featureObj($featureId)
    } else {
        return "unknown"
    }
}

##############################################################################
#
# productInfoGet - returns the requested info of a product.
#
# Attribute               Meaning
# ---------               -------
# partIndexList           a list of integer indentifies parts
# number                  a string that represents a product, sale perpective
# name                    a string that represents a product, mfg perpective
# desc                    a string that describes a product
# instFlag                a toggle flag that tells if a product is selected
# prevInstFlag            a previous stage of the above flag
# size                    a total size of a product
# totalFile               a total files of a product
# selectedPartIndexList   a list of selected part of a product
# featureId               a feature id of a product
# stateInfo               a selection state of a product
# coreProd                a product is a core product flag
#
# SYNOPSIS
# productInfoGet <attrib> <productId>
#
# PARAMETERS:
#    <attrib> : one of the above attributes
#    <productId> : a uniq integer that identifies the product.
#
# RETURNS: the requested information.
#
# ERRORS: N/A
#

proc productInfoGet {info prodIndex} {
    global productObj

    switch $info {
        partIndexList { return $productObj($prodIndex,partIndexList) }

        number { return $productObj($prodIndex,number) }

        name { return $productObj($prodIndex,name) }

        desc { return $productObj($prodIndex,desc) }

        instFlag { return $productObj($prodIndex,instFlag) }

        prevInstFlag { return $productObj($prodIndex,prevInstFlag) }

        size {
            set retVal 0

            foreach partIndex [productInfoGet selectedPartIndexList $prodIndex] {
                incr retVal [partInfoGet size $partIndex]
            }

            if {($retVal < 104858) && ($retVal > 0)} { set retVal 104858 }

            return $retVal
        }

        totalFile {
            set retVal 0

            foreach partIndex [productInfoGet selectedPartIndexList $prodIndex] {
                incr retVal [partInfoGet totalFile $partIndex]
            }

            return $retVal
        }

        selectedPartIndexList {
            set retVal {}

            foreach partIndex $productObj($prodIndex,partIndexList) {

                if {"[partInfoGet instFlag $partIndex]" == "1"} {
                    lappend retVal $partIndex
                }
            }

            return $retVal
        }

        featureId {
            return $productObj($prodIndex,featureId)
        }

        coreProd {
            return $productObj($prodIndex,coreProd)
        }

        stateInfo {
            set totalPrev 0
            set totalCurr 0
            set state "unchanged"

            foreach partIndex $productObj($prodIndex,partIndexList) {

                set prev [partInfoGet prevInstFlag $partIndex]
                set curr [partInfoGet instFlag  $partIndex]

                incr totalPrev $prev
                incr totalCurr $curr

                if {"$prev" != "$curr"} {
                    set state "changed"
                }
            }

            return [stateInfoHelper $state $totalCurr $totalPrev]
        }

        default { puts "productInfoGet: unknown info: $info" }
    }
}

##############################################################################
#
# productInfoSet - changes the product object attributes
#
# see productInfoGet() for available products attributes.
#
# SYNOPSIS
# productInfoSet <attrib> <prodIndex> [value]
#
# PARAMETERS:
#    <attrib> : a product attribute
#    <prodIndex> : an integer identifies a product
#    [value] : new value of an attribute
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc productInfoSet {info prodIndex {value ""}} {
    global productObj pickList

    switch $info {
        partIndexList { set productObj($prodIndex,partIndexList) $value }

        number { set productObj($prodIndex,number) $value }

        desc { set productObj($prodIndex,desc) $value }

        instFlag {
            if {"$productObj($prodIndex,instFlag)" == "0" && \
                "$value" == "1"} {

                set setAllFlag 1
                set productObj($prodIndex,instFlag) $value

                foreach partIndex [productInfoGet partIndexList $prodIndex] {
                    if {"[partInfoGet instFlag $partIndex]" == "1"} {
                        set setAllFlag 0
                        break
                    }
                }

⌨️ 快捷键说明

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