zoukankan      html  css  js  c++  java
  • Atitit 发帖机系列(6) USRQBN2201 setup spec安装程序的实现规范与标准化解决方案

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

     

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

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

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

     

     setup安装.bat

     

    set javaexec="%java_home%injava.exe"

      

    rem a  start explorer z:  WEB-INFlib

    rem check url

    set maindir=%~dp0

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

     

    %javaexec%  -classpath ".;.classes;%atiplat_se%WebRootWEB-INFclasses;%atiplat_se%in" -Djava.ext.dirs="%~dp0lib;%atiplat_se%WebRootWEB-INFlib"   -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

     

     

  • 相关阅读:
    DataTable的一些使用技巧
    Linux下使用Mysql
    【Cocos2d-X开发学习笔记】第28期:游戏中音乐和音效的使用
    HDU 4669 Mutiples on a circle (DP , 统计)
    面试经典-设计包含min函数的栈
    最大熵模型
    这篇文章关于两阶段提交和Paxos讲的很好
    【读书笔记】神经网络与深度学习
    这个对协程的分析不错
    sendfile学习
  • 原文地址:https://www.cnblogs.com/attilax/p/6107916.html
Copyright © 2011-2022 走看看