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

📄 setup

📁 windml3.0.3
💻
📖 第 1 页 / 共 2 页
字号:
    echo "swap space available and rerun $setup_type."
    exit_setup=1
fi

#############################################################################
#
# The following commands and functions check for necessary disk space 
# for temporary Setup files.  
#

space_available=0
checked_home_directory=0

# The amount of space needed for 
# sun4-solaris2: 27 megs

if [ "$WIND_HOST_TYPE" = "sun4-solaris2" ]
then
    necessary_space=27
fi 

#############################################################################
#
# tmpfreespace - This function sets the variable tmpfreemeg to the amount 
#                of space available in $TMP.
#

tmpfreespace () {
    if [ "$WIND_HOST_TYPE" = "sun4-solaris2" ] 
    then
        tmpfree=`/bin/df -k $TMP | /bin/grep \% | /bin/awk '{print $4}'`
    fi
    tmpfreemeg=`/bin/expr $tmpfree / 1024`
}

# Check the TMP directory for available space.  By default this was set to
# the user's home directory if TMP was not initially set in the environment.

tmpfreespace

if [ $tmpfreemeg -lt $necessary_space ] 
then
    # If not enough space is available in TMP, remove the previous TMP 
    # directory attempt.
    
    /bin/rm -rf $TMP 2>/dev/null
    
    # set TMP to reside under the user's home directory if TMP is
    # not currently set there.  Otherwise set TMP to reside
    # under /tmp.  
   
    if [ "$TMP" != "$HOME/tmp_WRS-Inst$$" ]
    then
        TMP=$HOME/tmp_WRS-Inst$$
    else
        TMP=/tmp/Inst$$
        checked_home_directory=1
    fi
    
    # create the new temporary directory for the next attempt.
    
    mkdir -p $TMP || mkdir $TMP || exit 0
else
    space_available=1
fi

# Check the user's home directory for available space if it has not
# already been checked.  

if [ $space_available -ne 1 -a $checked_home_directory -ne 1 ] 
then
    tmpfreespace
    if [ $tmpfreemeg -lt $necessary_space ]
    then
        # remove the previous TMP directory attempt.
        
        /bin/rm -rf $TMP 2>/dev/null
        TMP=/tmp/Inst$$
    
        # create the new temporary directory for the next attempt.
        
        mkdir -p $TMP || mkdir $TMP || exit 0
    else
        space_available=1
    fi
fi

# Finally check /tmp for space.  It is preferable to use TMP or the
# user's home directory for tmp space first, to prevent filling
# up swap space needed by MainWin or other running applications.

if [ $space_available -ne 1 ]
then
    # Add 5 megs to necessary_space to allow for MainWin swap space.
    
    tmp_necessary_space=`/bin/expr $necessary_space + 5`  

    tmpfreespace
    if [ $tmpfreemeg -lt $tmp_necessary_space ]
    then
        /bin/rm -rf $TMP 2>/dev/null
    else 
        space_available=1
    fi
fi

# Print an error message if not enough space is available in the
# temporary directory.

if [ $space_available -ne 1 ]
then
    echo
    echo "$setup_type has detected that there is not enough space available" 
    echo "in your TMP directory or your home directory to copy temporary"
    echo "files.  Please set the environment variable TMP to a directory"
    echo "location with $necessary_space megabytes free, or free enough space"
    echo "in your home directory."
    echo
    exit_setup=1
fi

#############################################################################
#
# rmtmpdir - This function removes the $TMP directory.  It prints a message 
#            to the display if removing $TMP is unsuccessful.  
#

rmtmpdir () {
    if /bin/rm -rf $TMP 2>/dev/null
    then  
        :  # Tmp directory was sucessfully removed
    else
        echo
        echo "Warning: $setup_type has detected that it was not allowed to" 
        echo "remove all temporary files located in $TMP."
        echo "These files are no longer needed by $setup_type and may be" 
        echo "removed."
        echo
    fi
}

#############################################################################
#
# killcolormanager - This function kills the MainWin Color Manager 
#                    running in the background.
#

killcolormanager () {
    currentuser=`whoami`
    colormanager_process=`/bin/ps -u $currentuser | /bin/grep -i mwcolor | \
                          /bin/awk '{print $1}'`
    if [ "$colormanager_process" != "" ]
    then
        if /bin/kill -9 $colormanager_process 2>/dev/null
        then
            : # kill was successful
        else
            echo
            echo "Setup has detected that it was not allowed to terminate"
            echo "the MainWin Color Manager.  This may interfere with ejection"
            echo "of the CD-ROM.  Please kill the process named"
            echo "'mwcolormanager' if the CD-ROM does not eject."
            echo 
        fi
    fi
}

###############################################################################
#
# exitsetup - This function is called when Setup exits, whether normally
#             or through a trap.  It calls the rmtmpdir and killcolormanager 
#             functions to clean up when SETUP exits.  See the 'trap' commands
#             below.  
#

exitsetup () {
    # Kill the color manager only if Setup invoked the color manager.

    if [ $colormgr_already_running -ne 1 ]
    then
        killcolormanager
    fi
    rmtmpdir
}

if [ $exit_setup -eq 1 ] 
then
    exitsetup
    exit 1
fi


#############################################################################
# 
# The following command unzips the Mainwin and tcl libraries needed for
# Setup.
#

(cd $TMP; $CD_BIN/UNZIP -q $CD_BIN/MWUITCL.ZIP)

#############################################################################
# 
# The following commands determine the Tcl interpreter location and 
# the Tcl file to be executed.  
#

# Determine which Tcl interpreter to be used for starting SETUP.  Print
# a message and exit if the interpreter cannot be found.

/bin/mv $TMP/UITclSh $TMP/SETUP
/bin/mv $TMP/UITclSh.rxb $TMP/SETUP.rxb
/bin/mv $TMP/UITclSh.rxt $TMP/SETUP.rxt

TRY1_GUI=$TMP/SETUP
TRY2_GUI=$CD_BIN/host/$WIND_HOST_TYPE/bin/UITclSh
TRY3_GUI=$WIND_BASE/host/$WIND_HOST_TYPE/bin/UITclSh

if [ -f "$TRY1_GUI" ]
then
    INSTALL=$TRY1_GUI
elif [ -f "$TRY2_GUI" ]
then
    INSTALL=$TRY2_GUI
elif [ -f "$TRY3_GUI" ]
then
    INSTALL=$TRY3_GUI
else
    echo "${TRY1_GUI}: not found"
    echo "${TRY2_GUI}: not found"
    echo "${TRY3_GUI}: not found"
    echo "WIND_BASE=$WIND_BASE"
    exit 1
fi

# Set the correct Tcl file for Setup or Uninstall.

if [ $uninstall = 1 ] 
then
    TCL_FILE=$UNINST_HOME/UNINST.TCL
else
    TCL_FILE=$CD_ROOT/RESOURCE/TCL/INSTW32.TCL
fi

# Set the Tcl file used for creating a font cache.

EMPTY_TCL_FILE=$CD_ROOT/RESOURCE/TCL/EMPTY.TCL

#############################################################################
#
# The following commands set up a trap to call the exitsetup function 
# when SETUP exits, even when SETUP is terminated abnormally (for example,
# the user stops SETUP with CTRL-C).  The exitsetup function will cause
# Setup to clean up after itself.
#

trap exitsetup 0 1 15
trap "" 2

#############################################################################
#
# The following commands set up the environment variables needed for 
# executing SETUP.  
#

PATH=${CD_BIN}:${TMP}:$WIND_BASE/host/$WIND_HOST_TYPE/bin:$PATH
TCL_LIBRARY=$TMP/lib/tcl
TK_LIBRARY=$TMP/lib/tk
LD_LIBRARY_PATH=$TMP:$TMP/mw/lib-sunos5_optimized:$LD_LIBRARY_PATH
SHLIB_PATH=$TMP:$TMP/mw/lib-ux10_optimized:$SHLIB_PATH

# Establish XFILESEARCHPATH.

XFSP=$TMP:

if [ "$XFILESEARCHPATH" != "" ]
then
    # Save user's XFILESEARCHPATH so it can be restored for spawned programs.

    USER_XFILESEARCHPATH=$XFILESEARCHPATH
    export USER_XFILESEARCHPATH
    XFILESEARCHPATH=${XFSP}${XFILESEARCHPATH}
else
    XFILESEARCHPATH=${XFSP}
fi

# Make sure the Tornado font cache is used. 

unset MWFONT_CACHE_DIR

# Make sure the correct MWHOME setting is used for Setup.

unset MWHOME

# This setting removes the Setup background.  

SETUP_REMOVEBACKGROUND=1

# Export the necessary variables to the environment.

export SETUP_REMOVEBACKGROUND
export XFILESEARCHPATH
export TCL_LIBRARY
export TK_LIBRARY
export LD_LIBRARY_PATH
export SHLIB_PATH
export WIND_BASE
export WIND_HOST_TYPE
export PATH
export CD_ROOT
export CD_BIN
export TMP
export MWFONT_CACHE_DIR
export MWHOME
if [ $uninstall = 1 ]
then
    export UI
    export SETUP_UNINST
fi

# Copy shared libraries to the temp directory for Uninstall.

if [ $uninstall = 1 ]
then
    if [ "$WIND_HOST_TYPE" = "sun4-solaris2" ]
    then
        cp $CD_BIN/SETUPTCL.SO $TMP/setuptcl.so
    fi
fi

#############################################################################
#
# The following command is executed to create a font cache if necessary.  
# The font cache creation process is displayed to the user's shell.  
#

$CD_ROOT/MWWRAPPER $INSTALL $EMPTY_TCL_FILE FONT_CACHE_CHECK

#############################################################################
#
# The following commands execute Setup or Uninstall through MWWRAPPER.
#

if [ $uninstall = 1 ]
then
    $CD_ROOT/MWWRAPPER $INSTALL $TCL_FILE $WIND_BASE
else
    $CD_ROOT/MWWRAPPER $INSTALL $TCL_FILE $CD_ROOT $ARGV
fi

#############################################################################
#
# Just in case, if the temporary directory exists, remove it
# 

if [ -d $TMP ]
then
    rmtmpdir
fi


if [ -d $HOME/windows -a $windowsDirExisted = 0 ]
then
    rm -fr $HOME/windows
fi

⌨️ 快捷键说明

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