inno steup 安装判断 进程是否运行
1、添加了卸载判断用语
2、添加了安装程序进程是否存在使用了wmi服务
; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
#define MyAppName "陕十三1.0"
#define MyAppVersion "1.0"
#define MyAppPublisher ""
#define MyAppExeName "陕十三.exe"
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (若要生成新的 GUID,可在菜单中点击 "工具|生成 GUID"。)
AppId=
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\Expert_acquisition_system_v1
DisableProgramGroupPage=yes
; 以下行取消注释,以在非管理安装模式下运行(仅为当前用户安装)。
;PrivilegesRequired=lowest
DefaultGroupName=陕十三2.0
OutputBaseFilename=陕十三1.0
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[code]
function IsAppRunning(const FileName : string): Boolean;
var
FSWbemLocator: Variant;
FWMIService : Variant;
FWbemObjectSet: Variant;
begin
Result := false;
FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
FWMIService := FSWbemLocator.ConnectServer('', 'root\CIMV2', '', '');
FWbemObjectSet := FWMIService.ExecQuery(Format('SELECT Name FROM Win32_Process Where Name="%s"',[FileName]));
Result := (FWbemObjectSet.Count > 0);
FWbemObjectSet := Unassigned;
FWMIService := Unassigned;
FSWbemLocator := Unassigned;
end;
function InitializeSetup(): Boolean;
begin
Result := IsAppRunning('mysqld.exe');
if Result then
begin
MsgBox('当前系统中已经存在数据库,请先关闭程序后再重试! ', mbError, MB_OK);
result:=false;
end
else
begin
result := true;
end;
end;
function InitializeUninstall(): Boolean;
var
Text: string;
begin
Result := (MsgBox('当前卸载会卸载所关联的数据库数据以及程序,如继续卸载请按【是】放弃请按【否】', mbConfirmation, MB_YESNO) = IDYES);
end;
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone
;Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "E:\client\student_shengting\moegov\moegov\bin\Release\陕十三.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\client\student_shengting\moegov\moegov\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\rwas\excel导入导出版本\install.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\rwas\excel导入导出版本\zfxm_rss.sql"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\mysqls\test\mysql-5.6.45-winx64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
[Icons]
;Name: "{commonprograms}\{#MyAppName}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: {app};
;Name: {commonprograms}\{#MyAppName}\卸载 {#MyAppName}; Filename:{uninstallexe}; WorkingDir: {app};
;Name: {commonprograms}\{#MyAppName}\卸载 {#MyAppName}; Filename:{uninstallexe}; WorkingDir: {app};
;Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
//开始菜单快捷方式
Name: "{commonprograms}\{#MyAppName}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: {app};
//桌面快捷方式
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
//开始菜单卸载程序
Name: {commonprograms}\{#MyAppName}\卸载 {#MyAppName}; Filename:{uninstallexe}; WorkingDir: {app};
Name: {commonprograms}\{#MyAppName}\卸载 {#MyAppName}; Filename:{uninstallexe}; WorkingDir: {app};
[INI]
;修改数据库配置文件
Filename:"{app}\my.ini";Section:"client";Key:"port"; String:"3306"
;Filename:"{app}\my.ini";Section:"client";Key:"default-character-set"; String:"utf8" gb2312
Filename:"{app}\my.ini";Section:"client";Key:"default-character-set"; String:"utf8"
Filename:"{app}\my.ini";Section:"mysql";Key:"port"; String:"3306"
;Filename:"{app}\my.ini";Section:"mysql";Key:"default-character-set"; String:"utf8"
Filename:"{app}\my.ini";Section:"mysql";Key:"default-character-set"; String:"utf8"
Filename:"{app}\my.ini";Section:"mysqld";Key:"port"; String:"3306"
Filename:"{app}\my.ini";Section:"mysqld";Key:"basedir"; String:"{app}"
Filename:"{app}\my.ini";Section:"mysqld";Key:"datadir"; String:"{app}\data"
;Filename:"{app}\my.ini";Section:"mysqld";Key:"character-set-server"; String:"utf8"
Filename:"{app}\my.ini";Section:"mysqld";Key:"character-set-server"; String:"gb2312"
Filename:"{app}\my.ini";Section:"mysqld";Key:"default-storage-engine"; String:"InnoDB"
Filename:"{app}\my.ini";Section:"mysqld";Key:"max_connections"; String:"100"
Filename:"{app}\my.ini";Section:"mysqld";Key:"sql_mode"; String:"NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES"
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
;Filename: "{app}\vcredist_x64.exe";
Filename: "{app}\install.bat";Description:"正在启动或配置相关程序"
[UninstallRun]
Filename: "{app}\uninstall.bat";
[UninstallDelete]
Type:filesandordirs;Name:"{app}"
inno steup 安装判断 进程是否运行的更多相关文章
- Linux 判断进程是否运行
问题 linux平台 多人开发服务器,有时自己运行一个进程在服务器上,但未知原因导致停止运行了,需要添加一个定时任务,用于监控指定进程是否运行 方法 一个通用的方法,以便使用在不同项目中. 思路:定时 ...
- Inno Setup安装程序单例运行
1.源起: KV项目下载底层升级包,老是报出升级文件占用问题,反复分析,不得其所. 今天突然发现同时启动多个升级程序实例,分析认为安装包同时被调用多次,引发实例访问文件冲突,导致此问题. 安装程序由I ...
- shell脚本判断进程是否运行
zzx@zzx120:~$ if ps aux | grep "python"|grep -v grep > /dev/null #$?的值不同 th ...
- INNO setup安装卸载钱判断进程中是否在运行总结
1.安装前判断进程中是否有程序在运行. [files] ; 安装前判断进程,dll文件放在inno的安装目录中Source: compiler:psvince.dll; Flags: dontcopy ...
- inno setup 安装前判断进程是否存在,以及停止相应进程<转>
打包的时候遇到了这样的需求:假似用户都是傻瓜 式操作,如果更新安装程序的时候,之前的老程序还在运行这个时候如果你去提示让用户吧老程序手动退掉也不现实. 所以当遇到这种 ...
- innosetup 安装前、卸载前判断是否有进程正在运行<转>
[Code] //安装前判断是否有进程正在运行,istask.dll文件与打包的exe文件一起 function RunTask(FileName: string; bFullpath: Boolea ...
- Inno Setup安装时不能关闭指定进程
脚本由 Inno Setup 脚本向导 生成!; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "XX管理系统"#defi ...
- 如何运用inno在安装和卸载时提示用户结束进程?
我尝试着写了一段,但是卸载段存在问题,请指点! CODE [Files]Source: ISTask.dll; DestDir: {app}; Flags: ignoreversion [Code]f ...
- Inno Setup 安装、卸载前检测进程或服务
[转载]Inno Setup 安装.卸载前检测进程或服务 (2015-04-24 17:37:20) 转载▼ 标签: 转载 原文地址:Inno Setup 安装.卸载前检测进程或服务作者:一去丶二 ...
随机推荐
- VS 高级版本新建的项目如何降级使低版本 VS 可以打开
转载:https://blog.csdn.net/u012814856/article/details/70325267 一.引言 这里因为工作的原因,公司项目使用的是 VS2015 的编译环境,但是 ...
- Consul 学习笔记-服务注册
Consul简介: Consul是一种服务网格解决方案,提供具有服务发现,配置和分段功能的全功能控制平面.这些功能中的每一个都可以根据需要单独使用,也可以一起使用以构建完整的服务网格.Consul需要 ...
- C#实例 武汉肺炎全国疫情实时信息图
如果需要查看更多文章,请微信搜索公众号 csharp编程大全,需要进C#交流群群请加微信z438679770,备注进群, 我邀请你进群! ! ! --------------------------- ...
- shell-脚本的建立和执行
1. shell脚本的建立和执行 1) shell脚本的建立 在linux系统中,shell脚本(bash shell程序)通常是在编辑器(如vi/vim)中编写,由unix/linux命令.bas ...
- rabbitmq 交换机模式一 广播模式 fanout
<?php require_once "./vendor/autoload.php"; use PhpAmqpLib\Connection\AMQPStreamConnect ...
- nginx集群:nginx配置负载均衡集群(nginx1.18.0)
一,nginx的负载均衡集群的特点: 1,nginx集群和lvs的不同? lvs集群:工作在第4层(传输层) nginx集群:工作在第7层(应用层) lvs集群:性能更强 nginx集群:功能更强:可 ...
- 第四章 Bash Shell 的简单应用
一.Bash Shell 的简单介绍 1.什么是bash shell? 是一个命令解释器 它在操作系统的最外面 负责用户与内核进行交互的一种接口 将用户输入的命令翻译给操作系统,并将处理后的结果输出到 ...
- 【应用服务 App Service】当使用EntityFrameWorkCore访问Sql Server数据库时,在Azure App Service会出现Cannot create a DbSet for ** because this type is not included in the model for the context的错误
问题情形 使用EF Core访问数据库,在本地运行正常,发布到App Service后,偶尔出现了Cannot create a DbSet for ** because this type is n ...
- 简单又强大的pandas爬虫 利用pandas库的read_html()方法爬取网页表格型数据
文章目录 一.简介 二.原理 三.爬取实战 实例1 实例2 一.简介 一般的爬虫套路无非是发送请求.获取响应.解析网页.提取数据.保存数据等步骤.构造请求主要用到requests库,定位提取数据用的比 ...
- windows下nginx中配置端口转发 ----本文来自转载
什么是端口转发 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 转载原文链接:https://www.cnblogs.com/chanshuyi/ ...