Atitit 发帖机系列(6) USRQBN2201 setup spec安装程序的实现规范与标准化解决方案

时间:2023-03-08 22:40:54
Atitit 发帖机系列(6) USRQBN2201 setup spec安装程序的实现规范与标准化解决方案

Atitit 发帖机系列(6) USRQBN2201 setup spec安装程序的实现规范与标准化解决方案

安装主要解决一个问题,就是resin的内容启动路径以及端口。。这里是使用的端口8077

主要是加载模板配置,然后替换,即可。

遇到的问题主要有主目录路径的提取,截取最后一个反斜杠。。

setup安装.bat

set javaexec="%java_home%\bin\java.exe"

rem a  start explorer z:  WEB-INF\lib

rem check url

set maindir=%~dp0

set maindirV2=%maindir:~0,-1%

%javaexec%  -classpath ".;.\classes;%atiplat_se%\WebRoot\WEB-INF\classes;%atiplat_se%\bin" -Djava.ext.dirs="%~dp0lib;%atiplat_se%\WebRoot\WEB-INF\lib"   -Djava.library.path="%~dp0dll;%atiplat_se%\dll" com.attilax.setup.ResinSetup "%maindirV2%"  8077

Pause

//  com.attilax.setup.ResinSetup

public class ResinSetup {

// d: 8088

public static void main(String[] args) {

String s="d:/resin-4.0.22/conf/resin.xml";

s=filex.convertSseparatorToLocal(s,"/");

//System.out.println(filex.getFileName_noExtName(s));

//System.out.println(File.separator);  //  File.separator=\ in windows

String mainDir=args[0];

String port=args[1];

String resinRoot=mainDir+"/resin-4.0.22";

String cfg_tmpl=resinRoot+"/conf/resin_tmpl.xml";

String txt=filex.read(cfg_tmpl);

String webroot=mainDir+"/AtiPlatf_ee/WebRoot";

txt=txt.replace("@root@", webroot);

txt=txt.replace("@port@", port);

String cfg=resinRoot+"/conf/resin.xml";

cfg=filex.convertSseparatorToLocal(cfg,"/");

String new_file_tmp_bek = filex.addSuffix(cfg, filex.getUUidName());

System.out.println(new_file_tmp_bek);

new File(cfg).renameTo(new File(new_file_tmp_bek ));

filex.save(txt, cfg);

System.out.println("--ok");

}

}

作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 )

汉字名:艾提拉(艾龙),   EMAIL:1466519819@qq.com

转载请注明来源: http://www.cnblogs.com/attilax/

Atiend