使用inno将tomcat打包成exe安装包(可以提示重复安装)

; Script generated by the Inno Setup Script Wizard.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "BBG002"

#define MyAppVersion "1.2"

#define MyAppPublisher "BBG002"

#define MyAppURL "http://localhost:8080/"

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={{86D79F54-E485-4011-83FE-FFC558F3DB93}

AppName={#MyAppName}

AppVersion={#MyAppVersion}

;AppVerName={#MyAppName} {#MyAppVersion}

AppPublisher={#MyAppPublisher}

AppPublisherURL={#MyAppURL}

AppSupportURL={#MyAppURL}

AppUpdatesURL={#MyAppURL}

DefaultDirName={pf}\{#MyAppName}

DefaultGroupName={#MyAppName}

OutputBaseFilename=BBG002_V1.2_INS

SetupIconFile=D:\testexe\favicon.ico

Compression=lzma

SolidCompression=yes

Languages

Name: "english"; MessagesFile: "compiler:Default.isl"

Files

Source: "D:\testexe\environment\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

Run

Filename: "{app}\environment.bat";

Registry

;将安装路径写入注册表

Root: HKCU; Subkey: "SOFTWARE\bbg002\config"; Flags: createvalueifdoesntexist

Root: HKCU; Subkey: "SOFTWARE\bbg002\config"; Flags: uninsdeletekeyifempty

Root: HKCU; Subkey: "SOFTWARE\bbg002\config"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"

Root: HKCU; Subkey: "SOFTWARE\bbg002\config"; ValueType: string; ValueName: "Version"; ValueData: "{#MyAppVersion}"

Root: HKCU; Subkey: "SOFTWARE\bbg002\config"; ValueType: dword; ValueName: "VersionNum"; ValueData: "100"

Root: HKCU; Subkey: "SOFTWARE\bbg002\config"; ValueType: string; ValueName: "Release Date"; ValueData: "2024/03/25"

Code

//初始化时执行

function InitializeSetup(): Boolean;

var

Version: string;

strPath: string;

ResultCode: Integer;

begin

Result:= TRUE;

//read the version

if RegQueryStringValue(HKEY_CURRENT_USER, 'SOFTWARE\bbg002\config', 'Version', Version) then

begin

// Successfully read the value

Version := '检测到已经安装了软件,请勿重复安装';

MsgBox(Version, mbConfirmation,MB_YESNO)

Result:= FALSE;

end;

end;

timeout /t 3 /nobreak >nul

unins000.exe

reg delete HKEY_CURRENT_USER\SOFTWARE\bbg002\config /f

unins000.exe

相关推荐
沐矢羽2 天前
Tomcat PUT方法任意写文件漏洞学习
学习·tomcat
matlab的学徒3 天前
Web与Nginx网站服务(改)
linux·运维·前端·nginx·tomcat
云动雨颤3 天前
Spring Boot配置优化:Tomcat+数据库+缓存+日志,全场景教程
数据库·spring boot·tomcat
森林-3 天前
MyBatis 从入门到精通(第一篇)—— 框架基础与环境搭建
java·tomcat·mybatis
ZzzZZzzzZZZzzzz…3 天前
Nginx_Tomcat综合案例
运维·nginx·tomcat·负载均衡·rhce·反向代理·https加密服务
潇I洒4 天前
若依4.8.1打包war后在Tomcat无法运行,404报错的一个解决方法
java·tomcat·ruoyi·若依·404
心灵宝贝4 天前
Tomcat Connectors 1.2.37 源码编译安装教程(mod_jk 详细步骤)
java·tomcat
脑子慢且灵5 天前
[JavaWeb]模拟一个简易的Tomcat服务(Servlet注解)
java·后端·servlet·tomcat·intellij-idea·web
liweiweili1265 天前
记录线上数据上传提示网络连接异常的故障
nginx·tomcat
记得开心一点嘛5 天前
手搓Tomcat
java·tomcat