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

相关推荐
尢词8 小时前
SpringMVC
java·spring·java-ee·tomcat·maven
清风百草8 小时前
【04】【Maven项目热部署】将Maven项目热部署到远程tomcat服务器上
tomcat·maven项目热部署
蒋桐城1 天前
Tomcat 启动卡住,日志显示 At least one JAR was scanned for TLDs yet contained no TLDs.
java·tomcat
qiaosaifei1 天前
SpringBoot项目中替换指定版本的tomcat
spring boot·后端·tomcat
雷神乐乐1 天前
IDEA构建JavaWeb项目,并通过Tomcat成功运行
服务器·tomcat·javaweb
陈大爷(有低保)1 天前
数据库连接池JNDI
数据库·mysql·tomcat
笔墨登场说说2 天前
JDK 里面的线程池和Tomcat线程池的区别
java·servlet·tomcat
爱分享的淘金达人2 天前
25国考照片处理器使用流程图解❗
java·考研·spring·eclipse·tomcat
爱分享的淘金达人2 天前
2025年山东省考报名流程图解
java·考研·spring·eclipse·tomcat·流程图
弓弧名家_玄真君2 天前
mac 安装tomcat
java·macos·tomcat