This script supports the packaging of MySQL, installation of MySQL services, installation of Windows services, Operation INI files, operation of the registry, efficient compression of files and other functions, basic to meet the common software packaging requirements.
; Define a variety of constants#defineMyappname "Software Name"#defineMyappdirname "Software Catalog name"The following version number, company name, URL in the control Panel-you can see where the application is uninstalled#defineMyappversion "Version number"#defineMyapppublisher "Company Name"#defineMyappurl "Software URL link"#defineMyappexename "Master execution file. exe"[Setup]; Note: The value of AppID identifies the application individually. Do not use the same AppID value for other installers.; (Generate a new GUID, click Tools|build the GUID in the IDE. ) AppId={{1394783a-5d3c-48cd-8470-E2dfbb844e42} AppName={#MyAppName}appversion={#MyAppVersion}appvername={#MyAppName}apppublisher={#MyAppPublisher}apppublisherurl={#MyAppURL}appsupporturl={#MyAppURL}appupdatesurl={#MyAppURL}defaultdirname={pf}\{#MyAppDirName}defaultgroupname={#MyAppName}; Install package file output directory OutputDir=D:\Output; Install package file name Outputbasefilename=setup; Compress files Compression=lzmasolidcompression=yes; run privilegesrequired with administrator privileges=Adminuninstalldisplayicon={app}/{#MyAppExeName}versioninfoversion=1.0.0.0; installation package language [Languages]name:"Chinesesimp"; Messagesfile:"COMPILER:DEFAULT.ISL"[Files]source:"F:\Output\ source program file directory \*"; DestDir:"{app}"; Flags:ignoreversion recursesubdirs createallsubdirs; source Program Files directory [icons]name:"{group}\{#MyAppName}"; Filename:"{app}\{#MyAppExeName}"Name:"{userdesktop}\{#MyAppName}"; Filename:"{app}\{#MyAppExeName}"; Workingdir:"{app}";; What to do when the installation is complete [run]filename:"{app}\mysql\bin\mysqld"; Parameters:"--install MySQL--defaults-file=""{App}\mysql\my.ini"""; Workingdir:"{App}\mysql\bin"; Flags:runhidden;; To install the MySQL service filename:"{sys}\net"; Parameters:"start MySQL"; Workingdir:"{SYS}"; Flags:runhidden;; Start the MySQL service filename:"{Dotnet40}\installutil.exe"; Parameters:"MyService.exe"; Workingdir:"{app}"; Flags:runhidden;; To install the Windows service FileName:"{sys}\net"; Parameters:"start MyService"; Workingdir:"{SYS}"; Flags:runhidden;; Start the Windows service filename:"{app}\{#MyAppExeName}"; Description:"{cm:launchprogram,{#StringChange (myappname, ' & ', ' && ')}}"; flags:nowait Postinstall skipifsilent Runasoriginaluser; whether to start the software; actions to be performed after uninstallation (stop, delete various services) [Uninstallrun] Filename:"{sys}\net"; Parameters:"stop MySQL"; Workingdir:"{SYS}"; Flags:runhidden; Filename:"{sys}\net"; Parameters:"Stop MyService"; Workingdir:"{SYS}"; Flags:runhidden; Filename:"{app}\mysql\bin\mysqld"; Parameters:"--remove MySQL"; Workingdir:"{App}\mysql\bin"; Flags:runhidden; Filename:"{Dotnet40}\installutil.exe"; Parameters:"/ u MyService.exe"; Workingdir:"{app}"; Flags:runhidden;; Manipulate the My.ini file, modify the Basedir and DataDir directories [ini]filename:"{App}\mysql\my.ini"; Section:"mysqld"; Key:"Basedir"; String:"{app}/mysql"Filename:"{App}\mysql\my.ini"; Section:"mysqld"; Key:"DataDir"; String:"{app}/mysql/data"Remove directory All files after uninstall, delete empty directory [Uninstalldelete]type:filesandordirs; Name:"{app}\*"Type:dirifempty; Name:"{app}"; Operation Registry [REGISTRY]ROOT:HKLM; Subkey:"Software\softname"; Flags:uninsdeletekey;
Share a Inno Setup software packaging script for your personal use