首页 > 其他分享 >Inno Setup简单使用

Inno Setup简单使用

时间:2022-09-27 11:46:15浏览次数:77  
标签:set tomcat dp0 app echo NUL 简单 Inno Setup

  1、简介

    Inno Setup 是一个免费的安装制作软件,小巧、简便、精美是其最大特点,支持pascal脚本,能快速制作出标准Windows2000风格的安装界面,足以完成一般安装任务。该软件用Delphi写成,其官方网站同时也提供源程序免费下载。

  它虽不能与Installshield这类恐龙级的安装制作软件相比,但也当之无愧算是后起之秀。

  2、下载

    https://jrsoftware.org/ 最新版本是6.2.1

    

 

  3、安装,搜索网上即可

  4、简单使用

  脚本

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 
#define MyAppName "XX"
#define MyAppVersion "V1.0"
#define MyAppPublisher "XX公司"
#define MyAppURL "https://XX.cn/"
#define MyApp "Xx"
 
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{2504A925-B7D9-4206-9408-0A0365C9818C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
;DefaultDirName={pf}\{#MyAppName}
;DefaultDirName={autopf}\{#MyAppName}
;DefaultDirName={pf}\compare
DefaultDirName=d:\\compare
DefaultGroupName={#MyAppName}
OutputBaseFilename=video-client-setup
SetupIconFile=D:\deploy\gui\Video.ico
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
UninstallDisplayName=卸载{#MyAppName}
 
 
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
 
[Files]
;拷贝data
Source:".\data\*";DestDir:"{app}\data";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝sqlitedb
Source:".\sqlitedb\*";DestDir:"{app}\sqlitedb";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝sqlite
Source:".\sqlite\*";DestDir:"{app}\sqlite";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝java包
Source:".\java\*";DestDir:"{app}\java";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝tomcat
Source:".\tomcat\*";DestDir:"{app}\tomcat";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝ffmpeg文件
Source:".\ffmpeg\*";DestDir:"{app}\ffmpeg";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝脚本文件
Source:".\install_script.vbs";DestDir:"{app}";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝脚本文件
Source:".\install_video.bat";DestDir:"{app}";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝脚本文件
Source:".\uninstall_video.bat";DestDir:"{app}";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝客户端界面文件
Source:".\MainClient\*";DestDir:"{app}\MainClient";Flags:igNoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\{#MyApp}";Filename: "{app}\MainClient\MainClient.exe"; WorkingDir: "{app}\MainClient"
[Run]
;修改服务配置文件
Filename:"{app}\install_video.bat";Flags:runhidden;Description:"正在启动或配置相关程序";
[UninstallRun]
;Filename:"{app}\uninstall.bat";Flags:runhidden;
Filename:"{app}\uninstall_video.bat";Flags:runhidden;
[UninstallDelete]
Type:filesandordirs;Name:"{app}\data"
Type:filesandordirs;Name:"{app}\sqlite"
Type:filesandordirs;Name:"{app}\sqlitedb"
Type:filesandordirs;Name:"{app}\ffmpeg"
Type:filesandordirs;Name:"{app}\tomcat"
Type:filesandordirs;Name:"{app}\java"
Type:filesandordirs;Name:"{app}\MainClient"
Type:filesandordirs;Name:"{app}\uninstall_video.bat"
Type:files;Name:"{app}\InstallUtil.InstallLog"

  批处理脚本

install_video.bat   

>NUL 隐藏DOS命令显示
@echo off
title 软件配置安装中,请不要手动关闭
Rd "%WinDir%\system32\rainss_perm" >NUL 2>NUL
Md "%WinDir%\System32\rainss_perm" 2>NUL||(Echo 请使用右键管理员身份运行!&&Pause >nul&&Exit)
Rd "%WinDir%\System32\rainss_perm" 2>NUL
::%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
::如果有以前卸载有残留,导致tomcat服务没有卸载成功,先卸载和删除以前的残留文件
echo ++++++++++++++ 停止运行tomcat服务>NUL
net stop CTRVideoClient>NUL
echo ++++++++++++++ 卸载tomcat服务>NUL
call %~dp0\tomcat\bin\service.bat remove CTRVideoClient>NUL


color 0a
echo ++++++++++++++ 设置环境变量>NUL
set JAVA_HOME=%~dp0\java>NUL
set JRE_HOME=%~dp0\java\jre>NUL
set PATH=%PATH%;%%JAVA_HOME%%\jre\bin>NUL
set CLASSPATH=.;%%JAVA_HOME%%\jre\lib>NUL

set CATALINA_BASE=%~dp0\tomcat>NUL
set CATALINA_HOME=%~dp0\tomcat>NUL
set CATALINA_TMPDIR=%~dp0\tomcat\temp>NUL

set SQLITE_HOME=%~dp0\sqlitedb>NUL
set PATH=%PATH%;%%SQLITE_HOME%%>NUL

echo ++++++++++++++ 环境变量设置完毕>NUL
echo ++++++++++++++ tomcat注册服务>NUL
call %~dp0\tomcat\bin\service.bat install CTRVideoClient>NUL
echo ++++++++++++++ tomcat开机启动>NUL
sc config CTRVideoClient start=auto>NUL
echo ++++++++++++++ 启动tomcat服务>NUL
net start CTRVideoClient>NUL
:: echo ++++++++++++++ 浏览器打开系统 http://localhost:8081
:: for /f "tokens=3,4" %%a in ('"reg query HKEY_CLASSES_ROOT\http\shell\open\command"') do (set SoftWareRoot=%%a %%b)
::start http://localhost:8081
exit
::echo 'please input any key to exit...'
::pause>nul

uninstall_video.bat

@echo off
title 软件配置安装中,请不要手动关闭
Rd "%WinDir%\system32\rainss_perm" >NUL 2>NUL
Md "%WinDir%\System32\rainss_perm" 2>NUL||(Echo 请使用右键管理员身份运行!&&Pause >nul&&Exit)
Rd "%WinDir%\System32\rainss_perm" 2>NUL
::%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
color 0a
echo ++++++++++++++ 设置环境变量>NUL
set JAVA_HOME=%~dp0\java>NUL
set JRE_HOME=%~dp0\java\jre>NUL
set PATH=%PATH%;%%JAVA_HOME%%\jre\bin>NUL
set CLASSPATH=.;%%JAVA_HOME%%\jre\lib>NUL
set tomcatpath=%~dp0\tomcat\bin>NUL
set CATALINA_BASE=%~dp0\tomcat>NUL
set CATALINA_HOME=%~dp0\tomcat>NUL
set CATALINA_TMPDIR=%~dp0\tomcat\temp>NUL

echo ++++++++++++++ 停止运行tomcat服务>NUL
net stop CTRVideoClient>NUL
echo ++++++++++++++ 卸载tomcat服务>NUL
call %~dp0\tomcat\bin\service.bat remove CTRVideoClient>NUL

del %0>NUL
exit
::echo 'please input any key to exit...'
::pause>nul

 

标签:set,tomcat,dp0,app,echo,NUL,简单,Inno,Setup
From: https://www.cnblogs.com/shaosks/p/16733994.html

相关文章

  • 简单上手 Vue Router
    VueRouter也随着Vue3的更新来到了4版本,来看一下怎么使用吧!(这里使用的是compositionAPI和TypeScript模式)安装vue-router4npminstallvue-router@4在/src......
  • Vue3之script-setup全面解析(转载)
    可能很多同学(包括我)刚上手Vue3.0之后,都会觉得开发过程似乎变得更繁琐了,Vue官方团队当然不会无视群众的呼声,如果你基于脚手架和.vue文件开发,那么可以享受到更高效率......
  • CSS实现一个简单的聊天气泡
    问题描述:想实现一个聊天气泡框时需要一个突出的尖角,于是想到了借助伪元素来实现实现目标:实现一个可以动态变长的聊天气泡(如图所示)   实现过程:版本一:使用absout+......
  • C# WinForm国际化实现的简单方法
    本文是完善:https://www.jb51.net/article/45675.htm文章描述很详细,重要的代码都贴出来了我帮大家懒到家,将窗口代码和资源文件也传上来到手可运行,直观的了解多语......
  • IPv4与IPv6的简单联系与区别
    IPv4与IPv6的简单联系与区别网际协议版本4,(InternetProtocolversion4,IPv4),IPv4是互联网的核心,是网际协议开发过程中的第四个修订版本,也是使用最广泛的网际协议版本。I......
  • 利用JavaWeb,简单实现身份ID校验系统
    <%@pagecontentType="text/html;charset=UTF-8"language="java"%><html><head><title>WelcomeCheckIDSystem</title><styletype="text/css">......
  • 简单的css动画---老式电影加载效果
    <!DOCTYPEhtml><htmllang="en"><head>  <metacharset="UTF-8">  <metahttp-equiv="X-UA-Compatible"content="IE=edge">  <metaname="viewport"c......
  • NuGet的简单使用
    转https://www.cnblogs.com/nizhenghua/p/6422078.html什么是NuGet?NuGet(读作NewGet)是用于微软.NET开发平台的软件包管理器,是一个VisualStudio的扩展。在使用VisualSt......
  • Linux 搭建简单 HTTP 下载服务
    1.防火墙开启8000端口2.创建文件夹,文件mkdirtestcdtesttoucha.txt3.后台启动服务nohuppython-u-mSimpleHTTPServer>download.log2>&1&4.下载地址......
  • InnoDB MVCC——隐藏字段、Undolog、ReadView
    和MVCC相关的三个东西隐藏字段:InnoDB表中的每个行前都有的三个隐藏字段,用于实现MVCC机制undolog:用于记录数据的历史版本,每一个数据的历史版本在undolog中构成一个历史版......