innosetup 打包

1、shellexec

ShellExec('open','taskkill.exe','/f /im {#MyAppExeName}','',SW_HIDE,ewNoWait,ErrorCode); ShellExec('open','tskkill.exe',' {#MyAppName}','',SW_HIDE,ewNoWait,ErrorCode);

2、cmd

[UninstallRun]
Filename: "{cmd}"; Parameters: "/C ""taskkill /im MustsWatcher.exe /f /t"
Filename: "{cmd}"; Parameters: "/C ""taskkill /im MUSTSYS.exe /f /t"

3、注册表

[Registry]
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "mustsWin"; ValueData: "{app}\Watcher\MustsWatcher.exe"

例子:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "JOS"
#define MyAppVersion "1.0.0.8"
#define MyAppExeName "MUSTSYS.exe"

[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={{E5025D4B-4E2F-4101-8BC6-392756C41AC0}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName=C:\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=C:\Users\lys\Desktop
OutputBaseFilename=mustc
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=no 
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\JOS\bin\MUSTSYS.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "C:\JOS\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[code]
//删除所有配置文件以达到干净卸载的目的
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);

begin
          
if CurUninstallStep = usUninstall then

if MsgBox('您是否要删除用户配置信息?', mbConfirmation, MB_YESNO) = IDYES then

//删除 {app} 文件夹及其中所有文件
DelTree(ExpandConstant('{app}'), True, True, True);
end;

[Registry]
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "mustsWin"; ValueData: "{app}\Watcher\MustsWatcher.exe"

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\启动保活程序"; Filename: "{app}\启动保活程序.bat"
Name: "{group}\停止保活程序"; Filename: "{app}\停止保活程序.bat"
Name: "{commondesktop}\musts"; Filename: "{app}\bin\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\Watcher\MustsWatcher.exe";Flags: nowait postinstall skipifsilent
Filename: "{app}\bin\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[UninstallRun]
Filename: "{cmd}"; Parameters: "/C ""taskkill /im MustsWatcher.exe /f /t"
Filename: "{cmd}"; Parameters: "/C ""taskkill /im MUSTSYS.exe /f /t"

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要使用Inno Setup打包MySQL 8.0.30,首先需要下载MySQL的安装程序和Inno Setup软件。 1. 下载MySQL 8.0.30安装程序:进入MySQL官方网站,找到下载页面,下载MySQL 8.0.30的安装程序。保存到本地目录。 2. 下载Inno Setup软件:进入Inno Setup的官方网站,找到下载页面,下载最新版本的Inno Setup软件。保存到本地目录,并安装在你的电脑上。 3. 创建Inno Setup脚本文件:使用文本编辑器,新建一个空的文本文件。将以下代码复制到该文件中: ``` [Setup] AppName=MySQL 8.0.30 AppVersion=8.0.30 DefaultDirName={pf}\MySQL\MySQL Server 8.0 DefaultGroupName=MySQL AllowNoIcons=yes OutputDir=userdocs:Inno Setup Examples Output [Files] Source: "C:\path\to\mysql-8.0.30-installer.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall [Run] Filename: "{tmp}\mysql-8.0.30-installer.exe"; Parameters: "--install-server"; WorkingDir: "{tmp}"; StatusMsg: "Installing MySQL 8.0.30, please wait..." [UninstallDelete] Type: files; Name: "{app}\unins000.dat" Type: files; Name: "{app}\unins000.exe" [Tasks] Name: "desktopicon"; Description: "Create a desktop icon"; GroupDescription: "Additional tasks:"; Flags: unchecked [Icons] Name: "{commondesktop}\MySQL 8.0.30"; Filename: "{app}\{#MyAppExeName}" [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent ``` 4. 修改脚本文件中的路径:将代码中的"C:\path\to\mysql-8.0.30-installer.exe"修改为你自己保存MySQL安装程序的路径。 5. 保存脚本文件:将该文本文件保存为任意名称的脚本文件,并将文件后缀改为.iss。 6. 编译安装程序:在Inno Setup安装目录中,找到并运行Inno Setup编译器(iscc.exe)。在编译器中选择刚才保存的脚本文件,并点击编译按钮。将会生成一个名为setup.exe的安装程序。 7. 运行安装程序:双击生成的setup.exe文件,按照安装程序的提示和选项进行MySQL的安装。 通过以上步骤,你就可以使用Inno Setup打包MySQL 8.0.30,并生成一个可执行的安装程序。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值