安装程序常用脚本

#!/bin/bash

#debug info

#user:houzc

#createtime:2012/7/27 and updatetime 2014/12/4

#Mysql  install directory , data diretory ,version  and mysql-root password setup.

DATA_DIR="/data/mysqldata/"

BASE_DIR="/usr/local/mysql"

VERSION="mysql-5.6.20"

MYSQL_PASSWD="admin"

#######apahce and php ,nginx  install directory ,version.########

HTTPVERSION="httpd-2.2.21"

PHPVERSION="php-5.4.7"

APPA_DIR="/usr/local/apache-2.2.21"

NGINXVERSION="nginx-1.6.0"

NGPA_DIR="/usr/local/nginx-1.6.0"

CUR_DIR=$(pwd)

mysql_install()

{

if [ -e "$MYSQL_DIR" ];then

echo "Mysql already exists......................................"

exit 0

else

rm -rf /usr/src/$VERSION/

mkdir -p /data/mysqldata/

mkdir -p /usr/local/mysql

tar zxvf $VERSION.tar.gz -C /usr/src

cd /usr/src/$VERSION/  && echo "tar ok..................."

/usr/bin/cmake -DCMAKE_INSTALL_PREFIX=$BASE_DIR  \

-DMYSQL_DATADIR=$DATA_DIR  \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DSYSCONFDIR=/etc \

-DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_unicode_ci \

-DWITH_DEBUG=0 -DMYSQL_USER=mysql

make && echo "make ok ..................................."

make install && echo "make install ok.................................."

cd  - && cp -r my.cnf.hzc /etc/my.cnf

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=$BASE_DIR --datadir=$DATA_DIR --no-defaults

chown mysql:root  -R  $BASE_DIR

chown mysql:mysql -R  $DATA_DIR

sed "26 i basedir=${BASE_DIR}" -i /etc/my.cnf

sed "27 i datadir=${DATA_DIR}" -i /etc/my.cnf

cp -r /usr/src/$VERSION/support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

sed "48 i basedir=${BASE_DIR}" -i /etc/init.d/mysqld

sed "49 i datadir=${DATA_DIR}" -i /etc/init.d/mysqld

echo ‘PATH=$PATH:/usr/local/mysql/bin/‘ >> /etc/profile

source /etc/profile

${BASE_DIR}/bin/mysqladmin  -u root  password "${MYSQL_PASSWD}"

#ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18

fi

}

apache_install()

{

if [ -e $APPA_DIR ];then

echo "httpd already exists.........................."

exit 0

else

rm -rf /usr/src/$HTTPVERSION

tar zxvf $HTTPVERSION.tar.gz -C /usr/src/

cd /usr/src/$HTTPVERSION/srclib/apr

./configure --prefix=/usr/local/apr

make && make install && echo "apr is ok................................"

sleep 3

cd -

cd /usr/src/$HTTPVERSION/srclib/apr-util/

./configure --prefix=/usr/local/apr-util/ \

--with-apr=/usr/local/apr

make && make install && echo "apr-util is ok.............................."

sleep 3

cd -

cd /usr/src/$HTTPVERSION

./configure --prefix=$APPA_DIR \

--with-apr=/usr/local/apr/ \

--with-apr-util=/usr/local/apr-util/ \

--enable-so \

--enable-rewrite

make && make install && echo "apache is ok.............................."

sed -i ‘s/#ServerName www.example.com:80/ServerName www.example.com:80/‘  $APPA_DIR/conf/httpd.conf

$APPA_DIR/bin/apachectl start

cd -

fi

}

php_install()

{

if [ -e "/usr/local/$PHPVERSION" ];then

echo "php already exists.........................."

exit 0

else

gd_install

rm -rf /usr/src/$PHPVERSION

tar zxvf $PHPVERSION.tar.gz -C /usr/src/

cd /usr/src/$PHPVERSION/

./configure --prefix=/usr/local/$PHPVERSION \

--with-apxs2=$APPA_DIR/bin/apxs \

--with-zlib --with-libxml-dir --enable-gd-native-ttf \

--enable-mbstring --with-gd=/usr/local/gd-2.0.33/ \

--with-mysql=$BASE_DIR \

--with-freetype-dir=/usr/local/freetype-2.4.3/ \

--with-jpeg-dir=/usr/local/jpeg-8b/ \

--with-png-dir=/usr/local/libpng-1.4.4/ \

--enable-sockets --enable-bcmath --with-gettext

make && make install && echo "php  is ok.............................."

cp -r php.ini-development /usr/local/$PHPVERSION/lib/php.ini

sed -i "54 i AddType application/x-httpd-php .php " $APPA_DIR/conf/httpd.conf

sed -i ‘s/DirectoryIndex index.html/DirectoryIndex index.html index.php/‘ $APPA_DIR/conf/httpd.conf

cd -

cp -r info.php $APPA_DIR/htdocs/

$APPA_DIR/bin/apachectl stop

$APPA_DIR/bin/apachectl start

fi

}

gd_install()

{

rm -rf /usr/src/freetype-2.4.3/

tar zxvf freetype-2.4.3.tar.gz -C /usr/src/

cd /usr/src/freetype-2.4.3/

./configure --prefix=/usr/local/freetype-2.4.3

make && make install && echo "freetype is ok.............................."

sleep 5s

cd -

rm -rf /usr/src/libpng-1.4.4/

tar zxvf libpng-1.4.4.tar.gz -C /usr/src/

cd  /usr/src/libpng-1.4.4/

./configure --prefix=/usr/local/libpng-1.4.4

make && make install && echo "libpng is ok.............................."

sleep 5s

cd -

rm -rf /usr/src/jpeg-8b

tar zxvf jpegsrc.v8b.tar.gz -C /usr/src/

cd  /usr/src/jpeg-8b/

./configure --prefix=/usr/local/jpeg-8b

make && make install && echo "jpeg-8b is ok.............................."

sleep 5s

cd -

rm -rf /usr/src/gd-2.0.33

tar zxvf gd-2.0.33.tar.gz -C /usr/src/

cp -r gd_png.c  /usr/src/gd-2.0.33/

cd /usr/src/gd-2.0.33/

./configure --prefix=/usr/local/gd-2.0.33 \

--with-jpeg=/usr/local/jpeg-8b \

--with-freetype=/usr/local/freetype-2.4.3 \

--with-png=/usr/local/libpng-1.4.4    \

--with-zlib --enable-m4_pattern_allow

make && make install && echo "gd is ok.............................."

sed -i  ‘/gd_free/a \ \ void (*data);‘ /usr/local/gd-2.0.33/include/gd_io.h

sleep 5s

cd -

}

nginx_install()

{

if [ -e $NGPA_DIR ];then

echo "nginx already exists.........................."

exit 0

else

groupadd -rf www

useradd -g www www -s /bin/false

rm -rf /usr/src/pcre-8.31

rm -rf /usr/src/$NGINXVERSION

tar zxvf pcre-8.36.tar.gz  -C /usr/src/

cd /usr/src/pcre-8.36

./configure

make &&  make install && echo "pcre is ok ..........................."

sleep 10s

cd -

tar zxvf $NGINXVERSION.tar.gz -C /usr/src/

cd /usr/src/$NGINXVERSION

./configure --prefix=$NGPA_DIR \

--user=www --group=www \

--with-http_stub_status_module \

--with-openssl=/usr --with-pcre=/usr/src/pcre-8.36

make && make install && echo "nginx is  ok ......................."

ln -s /usr/local/lib/libpcre.so.1 /lib

ln -s /usr/local/lib/libpcre.so.1 /lib64

$NGPA_DIR/sbin/nginx

fi

}

pextend_install()

{

tar zxvf libiconv-1.13.1.tar.gz

cd libiconv-1.13.1

./configure --prefix=/usr/local/libiconv

make  && make install

cd  -

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure

make  && make install

/sbin/ldconfig

cd libltdl

./configure --enable-ltdl-install

make  && make install

cd ../../

tar zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure

make  && make install

cd -

echo "/usr/local/lib/">>  /etc/ld.so.conf

/sbin/ldconfig

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

./configure

make  && make install

cd -

tar -zxvf  curl-7.17.1.tar.gz

cd curl-7.17.1

./configure --prefix=/usr/local/curl/

make  && make install

cd -

}

nphp_install(){

if [ -e "/usr/local/$PHPVERSION" ];then

echo "php already exists.........................."

exit 0

else

gd_install

pextend_install

rm -rf /usr/src/$PHPVERSION

tar zxvf $PHPVERSION.tar.gz -C /usr/src/

cd /usr/src/$PHPVERSION/ && echo "cd  is ok"

./configure --prefix=/usr/local/$PHPVERSION \

--with-mysql=$BASE_DIR\

--with-mysqli=$BASE_DIR/bin/mysql_config \

--with-freetype-dir=/usr/local/freetype-2.4.3 \

--with-jpeg-dir=/usr/local/jpeg-8b \

--with-png-dir=/usr/local/libpng-1.4.4/ \

--with-zlib --with-libxml-dir --enable-xml  --enable-mbstring \

--with-openssl  --with-gd=/usr/local/gd-2.0.33 \

--with-curl=/usr/local/curl/ \

--with-mhash --with-mcrypt --enable-sockets  --enable-pcntl  --enable-fpm \

--with-iconv=/usr/local/libiconv

make

make install

cd  -

cp  /usr/local/$PHPVERSION/etc/php-fpm.conf.default /usr/local/$PHPVERSION/etc/php-fpm.conf

cp /usr/src/$PHPVERSION/php.ini-development  /usr/local/$PHPVERSION/lib/php.ini

sed -ri ‘s/user = nobody/user = www/‘   /usr/local/$PHPVERSION/etc/php-fpm.conf

sed -ri ‘s/group = nobody/group = www/‘   /usr/local/$PHPVERSION/etc/php-fpm.conf

sed -ri  ‘/pid = run\/php-fpm.pid/apid = run\/php-fpm.pid‘ /usr/local/$PHPVERSION/etc/php-fpm.conf

cp /usr/src/$PHPVERSION/sapi/fpm/init.d.php-fpm  /etc/init.d/php-fpm

chmod +x /etc/init.d/php-fpm

/etc/init.d/php-fpm start

fi

}

cacti_install()

{

$BASE_DIR/bin/mysql -uroot -p$MYSQL_PASSWD -e "create database cacti;"

$BASE_DIR/bin/mysql -uroot -p$MYSQL_PASSWD -e "GRANT ALL ON cacti.* TO ${user1}@localhost IDENTIFIED BY ‘${passd1}‘;"

$BASE_DIR/bin/mysql -uroot -p$MYSQL_PASSWD -e "flush privileges;"

tar zxvf $CACTI_VERSION -C $CACTIPA_DIR

cact=`echo $CACTI_VERSION |cut -d . -f 1-3`

mv $CACTIPA_DIR/$cact $CACTIPA_DIR/cacti

cd $CACTIPA_DIR/cacti

$BASE_DIR/bin/mysql -u ${user1} -p${passd1} cacti < cacti.sql

}

zabbix_proxy_install()

{

yum  -y install  net-snmp-devel net-snmp-utils  curl-devel curl

echo "The system is bing installed pack,please waitting..."

sleep 5s

useradd zabbix -m -s /sbin/nologin

rm -rf /usr/src/zabbix-2.4.1

tar  -zxvf zabbix-2.4.1.tar.gz  -C /usr/src/

cd /usr/src/zabbix-2.4.1

./configure --prefix=/usr/local/zabbix-proxy --enable-server --enable-proxy --enable-agent --with-mysql=$BASE_DIR/bin/mysql_config --with-net-snmp --with-libcurl && echo "./config ............is ok!"

make && make install  &&  echo  make install......................is ok! ""

$BASE_DIR/bin/mysql -uroot -p$MYSQL_PASSWD -e "create database zabbix_proxy;"

$BASE_DIR/bin/mysql -uroot -p$MYSQL_PASSWD -e "GRANT ALL ON zabbix_proxy.* TO [email protected] IDENTIFIED BY ‘123456‘;"

$BASE_DIR/bin/mysql -uroot -p$MYSQL_PASSWD -e "flush privileges;"

$BASE_DIR/bin/mysql -uroot -p$MYSQL_PASSWD   zabbix_proxy  < /usr/src/zabbix-2.4.1/database/mysql/schema.sql

ln -s $BASE_DIR/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18

ln -s $BASE_DIR/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18

read -p "Please enter the zabbix_server_ip(1.1.1.1):" -t 300 serviceip

read -p "Please enter the hostname:" -t 300 hostname

mv /usr/local/zabbix-proxy/etc/zabbix_proxy.conf /usr/local/zabbix-proxy/etc/zabbix_proxy.conf.back

echo "DBName=zabbix_proxy " >> /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

echo "DBUser=zabbix " >> /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

echo "DBPassword=123456 " >> /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

echo "ConfigFrequency=60 " >> /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

echo "DataSenderFrequency=60 " >> /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

echo "Server=${serviceip} " >> /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

echo "Hostname=${hostname} " >> /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

/usr/local/zabbix-proxy/sbin/zabbix_proxy -c /usr/local/zabbix-proxy/etc/zabbix_proxy.conf

echo  "/usr/local/zabbix-proxy/sbin/zabbix_proxy -c /usr/local/zabbix-proxy/etc/zabbix_proxy.conf"  > /etc/rc.local

}

zabbix_agent_install()

{

yum  -y install  net-snmp-devel net-snmp-utils  curl-devel curl

echo "The system is bing installed pack,please waitting..."

sleep 5s

useradd zabbix -m -s /sbin/nologin

rm -rf /usr/src/zabbix-2.4.1

tar  -zxvf zabbix-2.4.1.tar.gz  -C /usr/src/

cd /usr/src/zabbix-2.4.1

./configure --prefix=/usr/local/zabbix_agent --enable-agent

make && make  install  && echo  "make instal  is ok ........................................................................."

read -p "Please enter the zabbix_server_ip(1.1.1.1):" -t 300 serviceip

read -p "Please enter the hostname:" -t 300 hostname

sed -i "s/ServerActive=127.0.0.1/ServerActive=${serviceip}/" /usr/local/zabbix_agent/etc/zabbix_agentd.conf

sed -i "s/Server=127.0.0.1/Server=${serviceip}/" /usr/local/zabbix_agent/etc/zabbix_agentd.conf

sed -i "s/Hostname=Zabbix server/Hostname=${hostname}/" /usr/local/zabbix_agent/etc/zabbix_agentd.conf

cat /usr/local/zabbix_agent/etc/zabbix_agentd.conf |grep -v -E "^$|^#"

/usr/local/zabbix_agent/sbin/zabbix_agentd  &&  echo  "zabbix-agent  is  ok......................!!"

}

tomcat_install() {

chmod +x jdk-6u32-linux-x64.bin

./jdk-6u32-linux-x64.bin

echo -e "\r"

mv $CUR_DIR/jdk1.6.0_32/ /usr/local/

if [ $? -eq 0 ];then

mv $CUR_DIR/jdk1.6.0_32 /usr/local

echo "JAVA_HOME=/usr/local/jdk1.6.0_32" >> /etc/profile

echo "CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar">> /etc/profile

sed -i  ‘$aPATH=${JAVA_HOME}/bin:$PATH‘ /etc/profile

echo "export JAVA_HOME JAVA_BIN PATH CLASSPATH">> /etc/profile

source /etc/profile

else

echo "Installation failed,please check the installation messages"

exit 3

fi

tar zxvf  apache-tomcat-6.0.41.tar.gz

if [ -d apache-tomcat-6.0.41 ];then

mv apache-tomcat-6.0.41 /usr/local

else

echo "Installation failed,please check the installation messages"

exit 3

fi

/usr/local/apache-tomcat-6.0.41/bin/startup.sh && echo "Tomcat server is started sucessfull"

}

tengine_install() {

groupadd -rf www

useradd -g www www -s /bin/false

tar jxvf jemalloc-3.4.1.tar.bz2 -C /usr/src

cd /usr/src/jemalloc-3.4.1

./configure --prefix=/usr/local/jemalloc-3.4.1

make && make install

ldconfig

cd -

tar zxvf ngx_cache_purge-2.1.tar.gz -C /usr/src

tar zxvf tengine-1.5.1.tar.gz -C /usr/src

cd /usr/src/tengine-1.5.1

yum -y install pcre-devel openssl-devel gcc gcc-c++ make

./configure --user=www --group=www --prefix=/usr/local/tengine-1.5.1 --add-module=/usr/src/ngx_cache_purge-2.1 --with-http_stub_status_module \

--with-http_ssl_module --with-http_realip_module  --with-http_concat_module=shared --with-http_sysguard_module=shared --with-http_limit_conn_module=shared \

--with-http_limit_req_module=shared --with-http_footer_filter_module=shared --with-http_upstream_ip_hash_module=shared --with-http_upstream_least_conn_module=shared \

--with-http_upstream_session_sticky_module=shared --with-jemalloc=/usr/src/jemalloc-3.4.1

make && make install && echo tengine is  OK

}

case "$1" in

mysql_install)

if [ -f /etc/debian_version ]; then

apt-get -y install build-essential cmake libncurses5-dev bison

groupadd  -r mysql && useradd -r -M -s /usr/sbin/nologin -g mysql mysql

echo "The system is bing installed pack,please waitting..."

sleep 5s

mysql_install

/etc/init.d/mysqld start

update-rc.d mysqld defaults

else

yum -y install gcc gcc-c++  libtermcap-devel ncurses-devel  cmake  bison make

useradd mysql -M -s /sbin/nologin

echo "The system is bing installed packe,please waitting..."

sleep 5s

mysql_install 2>&1 | tee -a /tmp/install.log

/etc/init.d/mysqld start

chkconfig --add mysqld

fi

;;

apache_install)

if [ -f /etc/debian_version ]; then

apt-get -y install build-essential cmake

else

yum -y install gcc gcc-c++ make cmake

fi

apache_install 2>&1 | tee -a /tmp/install.log

;;

nginx_install)

if [ -f /etc/debian_version ]; then

apt-get -y install build-essential cmake  zlib1g-dev

else

yum -y install gcc gcc-c++ make cmake  zlib zlib-devel

fi

nginx_install 2>&1 | tee -a /tmp/install.log

;;

php_install)

if [ -f /etc/debian_version ]; then

apt-get  -y install zlib1g-dev libxml2-dev && php_install

else

yum -y install libxml2-devel libxml2    && php_install 2>&1 | tee -a /tmp/install.log

fi

;;

nphp_install)

if [ -f /etc/debian_version ]; then

apt-get  -y install zlib1g-dev libxml2-dev openssl-dev && nphp_install

else

yum -y install libxml2-devel libxml2  openssl-devel && nphp_install 2>&1 | tee -a /tmp/install.log

fi

;;

AMP_install)

if [ -f /etc/debian_version ]; then

apt-get -y install build-essential cmake libncurses5-dev bison

groupadd  -r mysql && useradd -r -M -s /usr/sbin/nologin -g mysql mysql

echo "The system is bing installed pack,please waitting..."

sleep 3

mysql_install

/etc/init.d/mysqld start

update-rc.d mysqld defaults

else

yum -y install gcc gcc-c++  libtermcap-devel ncurses-devel  cmake  bison make

useradd mysql -M -s /sbin/nologin

echo "The system is bing installed pack,please waitting..."

sleep 3

mysql_install 2>&1 | tee -a /tmp/install.log

/etc/init.d/mysqld start

chkconfig --add mysqld

fi

apache_install 2>&1 | tee -a /tmp/install.log

gd_install

if [ -f /etc/debian_version ]; then

apt-get  -y install zlib1g-dev libxml2-dev && php_install

else

yum -y install libxml2-devel libxml2    && php_install 2>&1 | tee -a /tmp/install.log

fi

;;

NMP_install)

if [ -f /etc/debian_version ]; then

apt-get -y install build-essential cmake libncurses5-dev bison

groupadd  -r mysql && useradd -r -M -s /usr/sbin/nologin -g mysql mysql

echo "The system is bing installed pack,please waitting..."

sleep 5s

mysql_install

/etc/init.d/mysqld start

update-rc.d mysqld defaults

else

yum -y install gcc gcc-c++  libtermcap-devel ncurses-devel  cmake  bison make

useradd mysql -M -s /sbin/nologin

echo "The system is bing installed pack,please waitting..."

sleep 5s

mysql_install 2>&1 | tee -a /tmp/install.log

/etc/init.d/mysqld start

chkconfig --add mysqld

fi

sleep  10s

nginx_install 2>&1 | tee -a /tmp/install.log

sleep  10s

if [ -f /etc/debian_version ]; then

apt-get  -y install zlib1g-dev libxml2-dev openssl-dev && nphp_install

else

yum -y install libxml2-devel libxml2  openssl-devel && nphp_install 2>&1 | tee -a /tmp/install.log

fi

;;

zabbix_proxy_install)

zabbix_proxy_install 2>&1 | tee -a /tmp/install.log

;;

zabbix_agent_install)

zabbix_agent_install 2>&1 | tee -a /tmp/install.log

;;

tomcat_install)

tomcat_install       2>&1 | tee -a /tmp/install.log

;;

tengine_install)

tengine_install      2>&1 | tee -a /tmp/install.log

;;

*)

echo "Usage:sh|bash $0 {mysql_install|apache_install|php_install|AMP_install|nginx_install|nphp_install|NMP_install|zabbix_proxy_install|zabbix_agent_install|tomcat_install|tengine_install}"

exit

;;

esac

时间: 2024-10-11 01:40:57

安装程序常用脚本的相关文章

使用inno setup打包程序完整脚本(.net框架检测,重复安装检测)

; 脚本由 Inno Setup 脚本向导 生成!; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "小小鸟软件"#define MyAppVersion "2012.2.29"#define MyAppPublisher "小小鸟科技"#define MyAppURL "http://www.cnblogs.com/IT-SmallBird/"#define MyAp

使用本脚本可以自动批量完成中间节点环境的部署工作,包括:Nginx编译安装、添加程序管理脚本、设置开机启动、反向代理配置、证书分发、添加iptables规则等

使用本脚本可以自动批量完成中间节点环境的部署工作,包括:Nginx编译安装.添加程序管理脚本.设置开机启动.反向代理配置.证书分发.添加iptables规则等.脚本支持自定义nginx安装版本.设置编译模块.配置监听端口等. 1. Nginx Role规则说明 本脚本用于中间节点(Nginx反向代理)环境的自动化配置,主要内容包括: 安装基础依赖环境: 创建nginx启动用户(支持自定义用户): 下载nginx安装文件(可自定义nginx版本): 解压安装文件: 执行编译安装(可自定义编译参数和

Bash玩转脚本1之自己的脚本安装程序

Bash之打造自己的脚本安装器 前言 还是理所当然的前言,我一直想找一套管理脚本的"框架",能让自己杂乱的脚本有点规整.无奈眼界尚浅,未能找到. 因此萌生自己写一点优化脚本的工具来.新手可学习.高手请指正.今天先写一个脚本的安装器,目的在于写完并新脚本之后能够在shell的不论什么位置都能够便捷使用. 安装器干了啥? 一.配置文件 config.ini主要用于配置两个文件夹. 脚本的读取文件夹 生成软链接的存放文件夹 二.读取脚本 递归遍历读取scriptPath文件夹下的脚本文件,排

Bash之打造自己的脚本安装程序

Bash之打造自己的脚本安装器 前言 还是理所当然的前言,我一直想找一套管理脚本的"框架",能让自己杂乱的脚本有点规整,无奈眼界尚浅,未能找到.因此萌生自己写一点优化脚本的工具来,新手可学习,高手请指正.今天先写一个脚本的安装器,目的在于写完并新脚本之后能够在shell的任何位置都能够便捷使用. 安装器干了啥? 一.配置文件 config.ini主要用于配置两个目录. 脚本的读取目录 生成软链接的存放目录 二.读取脚本 递归遍历读取scriptPath目录下的脚本文件,排除掉insta

Inno Setup的常用脚本

Inno Setup的常用脚本 分类: VC++神奇理论 2012-12-06 10:07 3234人阅读 评论(2) 收藏 举报 安装不同的目录: [Files] Source: "我的程序\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "我的程序\*"; DestDir: {cf}\我的程序; Flags: ignoreve

[转]一个完整的Installshield安装程序实例

Installshield安装程序实例—基本设置一 前言 Installshield可以说是最好的做安装程序的商业软件之一,不过因为功能的太过于强大,以至于上手和精通都不是容易的事情,之前都是用Installshield的Project Assistant对付过去的,这次做这个安装程序,为了实现一些功能,必须写代码,国内外现成的资料很少,而且很多都语焉不详,自己反复啃了多次,对比Installshiel自带的help,才明白资料所表达的意思.这个安装程序虽然比较简陋,在行家眼里可能是小菜一碟,但

利用loadrunner代理方式录制手机(iPhone、Android)应用程序HTTP脚本

工具:loadrunner.手机 方法/步骤: 1.利用笔记本网卡或者类似360随身WiFi,在安装loadrunner的电脑上共享网络,在手机上连接共享的WiFi. 2.配置手机WiFi连接的HTTP代理地址和端口,代理地址(服务器)为电脑的IP地址,端口可以写1—65535,建议用不常用的端口,如:8899. 3.打开loadrunner脚本编辑器,选择录制协议为HTTP协议,同时设置录制模式为代理,端口填写手机上的端口. 4.点击录制,然后在手机上打开需要录制的应用程序,操作需要录制的业务

程序包管理rpm、yum与简单编译安装程序

Linux程序包管理 Linux中软件的安装主要有两种形式:一种是直接下载源代码包自行编译后安装,另一种直接获取rpm软件包进行安装. 程序的组成部分: 二进制程序:程序的主体文件,比如我们运行一个ls命令就是一个二进制程序. 库文件:程序的公用功能模块,比如A程序需要用一个打印机,B程序也需要一个打印机就可以公用这一个模块了.在window下库文件为.dll格式,linux下为/lib/*so格式的文件. 配置文件:通过设置配置文件来改变程序启动时的运行特征. 帮助手册:使用的帮助文档. ?

一个完整的Installshield安装程序实例—艾泽拉斯之海洋女神出品(三) --高级设置一

原文:一个完整的Installshield安装程序实例-艾泽拉斯之海洋女神出品(三) --高级设置一 上一篇:一个完整的安装程序实例—艾泽拉斯之海洋女神出品(二) --基本设置二 第二部分:脚本编程 在开始进行编程前,我们先明确一下我们要用编程来弥补前面设置的哪些功能的不足 1. 显示软件许可协议 2. 判断是否安装了本软件所需要的先决软件JKD1.6.0_04,如无,则启动外部安装程序进行安装(同样原理可以用来判断是否安装了其他软件,只要该软件在注册表中有键值) 3. 用户的输入信息.所选安装