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

📄 instptch.tcl

📁 windml3.0.3
💻 TCL
字号:
# INSTPTCH.TCL - Automatic handling of Tornado patches.
#
# Copyright 1999-2003 Wind River Systems, Inc
#
# modification history
# --------------------
# 01d,06may03,bjl  added customized README.TXT and LICENSE.TXT handling.
# 01c,12dec02,bjl  updated for Tornado 2.2.
# 01b,23sep99,pfl  copy zip files to local WIND directory
# 01a,20jul99,bjl  written. 
# 01c,15aug01,rjl  STOPSERVICE() is called to stop the Tornado Registry from
#		   running during the installation of a patch and etc. 
# 01d,20aug01,rjl  added clean up code to put back the original CONFIG.TCl file
#                  from the Tornado tree.
# 01e,21aug01,rjl  added clean up code to remove files from the WIND directory.


#############################################################################
#
# installPatch - prompt for WIND_BASE and run Setup.
#
# This procedure will prompt the user for WIND_BASE if it has not been
# set in the environment.  It will then copy CONFIG.TCL and other
# necessary files to the Setup directory in the user's Tornado tree, and 
# automatically run Setup.  Since Setup copies itself to the hard drive 
# as read-only for the first Tornado release, the readonly attribute of
# CONFIG.TCL must be changed.
#
# SYNOPSIS
# .tS
# installPatch
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#

proc installPatch {} {
    global env
    global answer

    puts " "
    puts "Component Patch - March 17, 2004"
    puts "------------------------------"
    puts "Copyright (C) 2004, Wind River Systems, Inc."
    puts " "
    puts " "
    puts "Installation"
    puts "------------"
    puts "This patch must be installed on top of an existing installation "
    puts " "
    puts "\n* NOTE: Be sure to exit all Wind River Applications before proceeding,"
    puts "including the Tornado Registry, Target Servers, or other processes"
    puts "(wtxregd, tgtsvr, jre, monwrs)."
    puts " "

    set windbasechosen 0
    
    if {[info exists env(WIND_BASE)]} {
       puts "Your WIND_BASE environment variable is set to \"$env(WIND_BASE)\"."
       puts "Do you want to install this patch in that tree(y/n)?"
       gets stdin answer
       if {$answer == "y"} {
         	set windbasechosen 1
       } 
    } 
    
   
    if {$windbasechosen == 0} {
        puts "Please enter the directory of your MSP installation."
        set env(WIND_BASE) [gets stdin]
    }

    while {![file exists $env(WIND_BASE)/SETUP/SETUP.EXE]} {
        puts "Error: The directory \"$env(WIND_BASE)\" does not exist"
        puts "or is not a valid Wind River installation."
        puts "Please enter the directory of your Wind River installation."
        set env(WIND_BASE) [gets stdin]
    }
    
    if {[file exists $env(WIND_BASE)/SETUP/DISK_ID]} {
        file attributes $env(WIND_BASE)/SETUP/DISK_ID -readonly 0
    }
    
    file copy -force DISK_ID $env(WIND_BASE)/SETUP/DISK_ID

    if {[file exists README.TXT]} {
        if {[file exists $env(WIND_BASE)/SETUP/README.TXT]} {
            file attributes $env(WIND_BASE)/SETUP/README.TXT -readonly 0
	}
        file rename -force $env(WIND_BASE)/SETUP/README.TXT $env(WIND_BASE)/SETUP/README.TXT.BAK
        file copy -force README.TXT $env(WIND_BASE)/SETUP/README.TXT
    }

    if {[file exists LICENSE.TXT]} {
        if {[file exists $env(WIND_BASE)/SETUP/LICENSE.TXT]} {
            file attributes $env(WIND_BASE)/SETUP/LICENSE.TXT -readonly 0
	}
        file rename -force $env(WIND_BASE)/SETUP/LICENSE.TXT $env(WIND_BASE)/SETUP/LICENSE.TXT.BAK
        file copy -force LICENSE.TXT $env(WIND_BASE)/SETUP/LICENSE.TXT
    }
    
    file delete -force $env(WIND_BASE)/SETUP/WIND
    file copy -force WIND $env(WIND_BASE)/SETUP/WIND

    file attributes $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG.TCL -readonly 0
    file rename -force $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG.TCL $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG_BACK.TCL

    foreach f [glob -nocomplain RESOURCE/TCL/\*.TCL] {
        if {[file exists $env(WIND_BASE)/SETUP/$f]} {
            file attributes $env(WIND_BASE)/SETUP/$f -readonly 0
        }
        file copy -force $f $env(WIND_BASE)/SETUP/$f       
    }

    file attributes $env(WIND_BASE)/SETUP/RESOURCE/BITMAPS/SETUP.BMP -readonly 0
    file copy -force RESOURCE/BITMAPS/SETUP.BMP $env(WIND_BASE)/SETUP/RESOURCE/BITMAPS/SETUP.BMP

    exec $env(WIND_BASE)/SETUP/SETUP.EXE

    # Restore CONFIG.TCL and delete DISK_ID for Setup license management
    # help screens to work properly.

    if {[file exists $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG_BACK.TCL]} {

	file attributes $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG.TCL -readonly 0
	file delete -force $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG.TCL
	file rename -force $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG_BACK.TCL $env(WIND_BASE)/SETUP/RESOURCE/TCL/CONFIG.TCL
    }

    if {[file exists $env(WIND_BASE)/SETUP/README.TXT.BAK]} {
	file attributes $env(WIND_BASE)/SETUP/README.TXT -readonly 0
	file delete -force $env(WIND_BASE)/SETUP/README.TXT
	file rename -force $env(WIND_BASE)/SETUP/README.TXT.BAK $env(WIND_BASE)/SETUP/README.TXT
	file copy -force $env(WIND_BASE)/SETUP/README.TXT $env(WIND_BASE)/README.TXT
    }

    if {[file exists $env(WIND_BASE)/SETUP/LICENSE.TXT.BAK]} {
	file attributes $env(WIND_BASE)/SETUP/LICENSE.TXT -readonly 0
	file delete -force $env(WIND_BASE)/SETUP/LICENSE.TXT
	file rename -force $env(WIND_BASE)/SETUP/LICENSE.TXT.BAK $env(WIND_BASE)/SETUP/LICENSE.TXT
	file copy -force $env(WIND_BASE)/SETUP/LICENSE.TXT $env(WIND_BASE)/LICENSE.TXT
    }

    if {[file exists $env(WIND_BASE)/SETUP/DISK_ID]} {
	file attributes $env(WIND_BASE)/SETUP/DISK_ID -readonly 0
	file delete -force $env(WIND_BASE)/SETUP/DISK_ID
    }
   
    # Delete the patch WIND archive files.

    file delete -force $env(WIND_BASE)/SETUP/WIND
    file mkdir $env(WIND_BASE)/SETUP/WIND
}

###########################################################################
#
# INSTPTCH.TCL - Initialization code
#
# This code is executed when the file is sourced. It does all the
# necessary initialization to start the patch installation.   
#

installPatch

⌨️ 快捷键说明

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