Inno 安装 包的制作脚本 文件, 包含jdk, mysql, 的安装和快捷方式的创建
; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
#define MyAppName "myApp"
#define MyAppVersion "1.0"
#define MyAppPublisher "信息化推进课"
#define MyAppURL "http://www.myApp.com/"
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{9E044575-9CD9-4751-B0BE-F6758BA94549}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={sd}\{#MyAppName}
DefaultGroupName=生产日报推移
AllowNoIcons=yes
OutputBaseFilename=myApp_setup
Compression=lzma/fast
SolidCompression=yes
[Files]
;拷贝jdk
Source:"Source\jdk1.8.0_191\*";DestDir:"{app}\jdk1.8.0_191";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝mysql
Source:"Source\mysql-5.7.24\*";DestDir:"{app}\mysql-5.7.24";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝server
Source:"Source\server\*";DestDir:"{app}\server";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝client
Source:"Source\client\*";DestDir:"{app}\client";Flags:igNoreversion recursesubdirs createallsubdirs
;拷贝bat
Source:"Source\*";DestDir:"{app}\";
;拷贝桌面快捷方式
;Source:"Source\xx系统.url";DestDir:"{userdesktop}\xx系统";
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[Icons]
Name: "{userdesktop}\快捷名称";Filename: "{app}\client\Report.exe"; WorkingDir: "{app}\client"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
[INI]
;修改数据库配置文件
;Filename: "{app}\mysql-5.7.24\my.ini"; Section: "mysqld"; Key: "basedir"; String: "{app}\mysql-5.7.24"
;Filename: "{app}\mysql-5.7.24\my.ini"; Section: "mysqld"; Key: "datadir"; String: "{app}\mysql-5.7.24\data"
;Filename: "{app}\mysql-5.7.24\my.ini"; Section: "mysqld"; Key: "port"; String: "3306"
;修改服务器配置文件
;Filename:"{app}\Server\init.ini";Section:"RegAddr";Key:"port"; String:"5556"
;Filename:"{userdesktop}\xx系统.url";Section:"InternetShortcut";Key:"URL"; String:"http://127.0.0.1:7070/"
[Run]
;修改tomcat配置文件
Filename:"{app}\install.bat";Description:"正在启动或配置相关程序";
[UninstallRun]
Filename:"{app}\uninstall.bat";
[UninstallDelete]
Type:filesandordirs;Name:"{app}\server"
Type:filesandordirs;Name:"{app}\client"
Type:filesandordirs;Name:"{app}\mysql-5.7.24"
Type:filesandordirs;Name:"{app}\jdk1.8.0_191"
;Type:files;Name:"{app}\InstallUtil.InstallLog"
[Code]
procedure ConfigXml2(xmlPath:String;xPath:String;innerText:String);
var
XMLDocument,XMLRoot,XMLNode:Variant;
begin
try
XMLDocument := CreateOleObject('MSXML2.DOMDocument');
XMLDocument.async := False;
XMLDocument.resolveExternals := False;
XMLDocument.load(xmlPath);
XMLRoot := XMLDocument.documentElement;
XMLNode:=XMLRoot.SelectSingleNode(xPath);
XMLNode.Text:=innerText;
XMLDocument.Save(xmlPath);
except
MsgBox('xml error', mbInformation, mb_Ok);
end;
end;
procedure ConfigXml(xmlPath:String;xPath:String;attrName:String;attrValue:String);
var
XMLDocument,XMLRoot,XMLNode:Variant;
begin
try
XMLDocument := CreateOleObject('MSXML2.DOMDocument');
XMLDocument.async := False;
XMLDocument.resolveExternals := False;
XMLDocument.load(xmlPath);
XMLRoot := XMLDocument.documentElement;
XMLNode:=XMLRoot.SelectSingleNode(xPath);
XMLNode.Attributes.GetNamedItem(attrName).Value:=attrValue;
XMLDocument.Save(xmlPath);
except
MsgBox('xml error', mbInformation, mb_Ok);
end;
end;