使用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

相关推荐
落落落sss6 小时前
MybatisPlus
android·java·开发语言·spring·tomcat·rabbitmq·mybatis
程序员大金2 天前
基于SpringBoot+Vue+MySQL的校园招聘管理系统
java·vue.js·spring boot·后端·mysql·tomcat·intellij-idea
刘重洋3 天前
解决nginx+tomcat宕机完美解决方案
nginx·tomcat·firefox
苦逼IT运维3 天前
正向代理与反向代理:原理、区别以及应用(Nginx 和 Tomcat)
运维·服务器·nginx·云原生·tomcat·devops
刘重洋3 天前
Tomcat监控与调优:比Tomcat Manager更加强大的Psi-Probe
java·tomcat·psi-probe监控
LearnTech_1234 天前
【学习笔记】手写 Tomcat 八
java·笔记·学习·tomcat·手写 tomcat
VaporGas4 天前
DBCP数据库连接池以及在Tomcat中配置JNDI数据源
java·数据库·tomcat
BUG弄潮儿4 天前
jdk & tomcat 镜像制作
java·开发语言·tomcat
白80805 天前
tomcat 文件上传 (CVE-2017-12615)
java·python·tomcat
VaporGas5 天前
idea2023-快速搭建一个本地tomcat的javaWeb项目(从0到1保姆教学)
java·tomcat