您好,欢迎光临本网站![请登录][注册会员]  
文件名称: nisi脚本配置jdk tomcat mysql redis
  所属分类: 其它
  开发工具:
  文件大小: 5kb
  下载次数: 0
  上传时间: 2019-04-22
  提 供 者: jh_s****
 详细说明: 一.环境变量配置 ; 定义系统环境变量的 注册表key值 !define WriteEnvStr_RegKey HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ;设置环境变量 Function "regExpandStr" SetOverwrite ifnewer ;设置jdk环境变量 WriteRegExpandStr ${WriteEnvStr_RegKey} "JAVA_HOME" "$INSTDIR\jdk1.8.0_131" ;设置CATAL INA_DIR WriteRegExpandStr ${WriteEnvStr_RegKey} "CATALINA_DIR" "$INSTDIR\tomcat\bin" ;设置CATA_LINA WriteRegExpandStr ${WriteEnvStr_RegKey} "CATA_LINA" "$INSTDIR\tomcat" ;设置path ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$0;C:\windows\system32;$INSTDIR\redis;$INSTDIR\mysql\bin;$INSTDIR\Java\jdk1.8.0_131\bin;" #第一次是使环境变量修改对其他进程有效;刷新环境变量 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 SetOverwrite on functionend ;注册服务 Function "installService" detailprint "------------------------------------install tomcat Service..." Sleep 2000 SetOutPath "$INSTDIR\tomcat\bin" nsExec::Exec cmd /c service install nsExec::Exec cmd /c sc config tomcat8 start= auto ;设置服务自动开启 detailprint "------------------------------------install tomcat Service success..." detailprint "install mysql Service..." Sleep 2000 SetOutPath "$INSTDIR\mysql\bin" nsExec::Exec cmd /c $INSTDIR\mysql\bin\mysqld.exe" -install Mysql --defaults-file="$INSTDIR\\mysql\\my.ini detailprint "install mysql Service success..." detailprint "------------------------------------install redis Service..." Sleep 2000 SetOutPath "$INSTDIR\redis" nsExec::Exec cmd /c redis-server --service-install redis.windows.conf detailprint "install redis Service success..." functionend ; 启动服务 Function "startService" detailprint "------------------------------------start tomcat..." nsExec::Exec cmd /c sc start Tomcat8 detailprint "------------------------------------start tomcat success..." detailprint "------------------------------------start mysql..." nsExec::Exec cmd /c sc start mysql detailprint "------------------------------------start MySQL success..." detailprint "------------------------------------start redis..." ;nsExec::Exec cmd /c sc redis-server --service-start --service-name redis detailprint "------------------------------------start redis success..." functionend ;停止服务 Function "un.stopService" detailprint "正在停止tomcat服务......." nsExec::Exec cmd /c sc stop tomcat8 detailprint "停止tomcat服务成功......." detailprint "正在停止mysql服务......." nsExec::Exec cmd /c sc stop mysql detailprint "停止mysql服务成功......." detailprint "正在停止redis服务......." nsExec::Exec cmd /c sc redis-server --service-stop --service-name redis detailprint "停止redis服务成功......." functionend ;删除服务 Function "un.uninstService" detailprint "正在卸载tomcat服务......." nsExec::Exec cmd /c sc delete tomcat8 detailprint "卸载tomcat服务成功......." detailprint "正在卸载mysql服务......." nsExec::Exec cmd /c sc delete mysql detailprint "卸载mysql服务成功......." detailprint "正在卸载redis服务......." nsExec::Exec cmd /c sc delete redis detailprint "卸载redis服务成功......." functionend ;清空环境变量 Function "un.emptyRegExpandStr" #删除 系统环境变量JAVA_HOME 和 CATALINA_HOME #卸载的时候必须设置JAVA_HOME 和 CATALINA_HOME两个环境系统变量为空,或者删除这两个系统变量。否则会出现NSIS选择系统变量的错误(NSIS会自动选择之前有值的系统变量,而不是选择当前刚设置的系统变量) detailprint "正在删除相关环境变量......." functionend 二.校验mac地址 #序列号 校验页面 Page custom check_serial_number Var "MacAddress" Function check_serial_number Call .GetMacAddress #MessageBox MB_OK 当前机器Mac地址为:$MacAddress ${if} $MacAddress == 00-50-56-C0-00-08 ${OrIf} $MacAddress == 00-50-56-C0-00-081 #MessageBox MB_OK 已授权 ${Else} MessageBox MB_OK 未授权,请联系经销商并授权! ;SendMessage $HWNDPARENT 0x408 3 0 #页面跳转 Call onClickClose ${EndIf} FunctionEnd #获取主机MAC地址 Function .GetMacAddress System::Call Iphlpapi::GetAdaptersInfo(i,*i.r0) System::Alloc $0 Pop $1 System::Call Iphlpapi::GetAdaptersInfo(ir1r2,*ir0)i.r0 StrCmp $0 0 0 finish loop: StrCmp $2 0 finish System::Call *$2(i.r2,i,&t260;.s,&t132;.s,i.r5)i.r0 ;Unicode版将t改为m IntOp $3 403 + $5 StrCpy $6 "" ${For} $4 404 $3 IntOp $7 $0 + $4 System::Call *$7(&i1;.r7) IntFmt $7 "X" $7 StrCpy $6 "$6$7" StrCmp $4 $3 +2 StrCpy $6 "$6-" ${Next} StrCpy $MacAddress $6 Goto loop finish: System::Free $1 FunctionEnd 三.关闭按钮功能 ;点击右上角关闭按钮 Function onClickClose FindProcDLL::FindProc "${PRODUCT_NAME}.exe" Sleep 500 Pop $R0 ${If} $R0 != 0 KillProcDLL::KillProc "${PRODUCT_NAME}.exe" ${EndIf} FunctionEnd
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索:
 输入关键字,在本站1000多万海量源码库中尽情搜索: