如何在 Inno Setup 中执行命令行的命令
Pascal Scripting: Exec
function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;
Executes the specified executable or batch file, using the same credentials as Setup/Uninstall. The Wait parameter specifies whether the function should return immediately or wait until the launched process has terminated or is idle. Returns True if the specified file was executed successfully, False otherwise.
If True is returned and Wait is ewWaitUntilTerminated then ResultCode returns the exit code of the process.
If False is returned then ResultCode specifies the error that occurred. Use SysErrorMessage(ResultCode) to get a description of the error.
TExecWait is defined as:
TExecWait = (ewNoWait, ewWaitUntilTerminated, ewWaitUntilIdle);
Use the ShellExec function instead if you need to launch a file that is not an executable or batch file.
Do not include quotes in the Filename parameter; the function will add them automatically.
The WorkingDir parameter can be an empty string, in which case it will try to extract a pathname from the Filename parameter and use that as the initial current directory for the process. If no pathname was specified in Filename, a default directory will be used.
If you have a single string containing both a filename and parameters (e.g. a command line obtained from an UninstallString registry value), you need not separate them yourself; just pass '>' in the Filename parameter, and the full command line in the Params parameter. (Note that when this is done, the function's special platform-independent support for .bat and .cmd files is disabled; it simply passes the specified command line to CreateProcess without any processing.)
By default, when Setup/Uninstall is running in 64-bit install mode, this function disables WOW64 file system redirection when calling CreateProcess. It is possible to override this by calling EnableFsRedirection.
var
ResultCode: Integer;
begin
// Launch Notepad and wait for it to terminate
if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOW,
ewWaitUntilTerminated, ResultCode) then
begin
// handle success if necessary; ResultCode contains the exit code
end
else begin
// handle failure if necessary; ResultCode contains the error code
end;
end;
如何在 Inno Setup 中执行命令行的命令的更多相关文章
- 如何在 Inno Setup 中关联多种文件格式
问题描述 Inno Setup 是一款十分强大的 Windows 安装程序制作软件,可以通过编写并编译 iss 脚本来创建安装包.之前都是直接将 Pyinstaller 生成的文件夹压缩为 zip 格 ...
- Inno setup 中 执行参数传递注意的地方
Inno setup编译器编译使用pascal脚本编写的打包代码,其中Run段可以执行某些特定的程序,遇到一个bat批处理文件传递参数的问题,记录如下 1: [Run] 2: Filename: &q ...
- 在Unicode版Inno Setup中使用ISSkin给安装程序添加皮肤
原文 http://www.cnblogs.com/2356/archive/2009/10/27/1590565.html 在Unicode版Inno Setup中使用ISSkin给安装程序添加皮肤 ...
- Oozie命令行常用命令汇总[转]
Oozie命令行常用命令汇总 有时候脚本跑多了就不愿意在OozieWeb端去看脚本的运行情况了.还好Oozie提供了很多命令行命令.能通过命令行直接检索自己想看到的脚本信息.在这里简单进行一下总结.一 ...
- Linux命令行与命令
Linux命令行与命令 作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! Linux的命令是很重要的工具,也往往是初学者最大的瓶 ...
- 命令行工具命令 - run包到手机里
命令行工具命令 你完全可以选择不输入以下这些命令,执行这些命令的结果与在 Android Studio 中单击"运行"按钮是一样的. chmod +x gradlew - 此命令只 ...
- Windows命令行(DOS命令)教程 -1 (转载) http://www.pconline.com.cn/pcedu/rookie/basic/10111/15325.html
一.命令行简介 命令行就是在Windows操作系统中打开DOS窗口,以字符串的形式执行Windows管理程序. 在这里,先解释什么是DOS? DOS--Disk Operation System 磁盘 ...
- Windows命令行(DOS命令)教程
一.命令行简介 命令行就是在Windows操作系统中打开DOS窗口,以字符串的形式执行Windows管理程序. 在这里,先解释什么是DOS? DOS——Disk Operation System 磁盘 ...
- 【Linux】1、命令行及命令参数
命令行及命令参数 文章目录 命令行及命令参数 1.命令行提示符 2.命令和命令参数 简单的命令 date ls 命令参数 短参数(一个字母) 长参数(多个字母) 参数的值 其它参数 3.小结 4.参考 ...
随机推荐
- 使用python-crontab给linxu设置定时任务
安装pip install python-crontab #coding=utf-8 from crontab import CronTab #创建类 class Crontabi(object): ...
- 消息队列 NSQ 源码学习笔记 (一)
nsqlookupd 用于Topic, Channel, Node 三类信息的一致性分发 概要 nsqlookup 知识点总结 功能定位 为node 节点和客户端节点提供一致的topic, chann ...
- XXE白盒审计 PHP
XXE与XML注入的区别 https://www.cnblogs.com/websecurity-study/p/11348913.html XXE又分为内部实体和外部实体.我简单区分为内部实体就是自 ...
- Prism+MaterialDesign+EntityFramework Core+Postgresql WPF开发总结 之 中级篇
本着每天记录一点成长一点的原则,打算将目前完成的一个WPF项目相关的技术分享出来,供团队学习与总结. 总共分三个部分: 基础篇主要争对C#初学者,巩固C#常用知识点: 中级篇主要争对WPF布局与Mat ...
- 基于华为云IoT Studio自助生成10万行代码的奥秘
华为IoT小助手们搬好板凳.备好笔记本.听了HDC.Cloud的几场华为云技术架构师的直播讲课,感觉获益匪浅却又似懂非懂,直后悔自己没有好好打下基础.为了避免再次出现这样的情况,小助手偷偷跑去找了华为 ...
- java中封装,继承,多态,接口学习总结
### 一:封装java中封装是指一种将抽象性函式接口的实现细节部分包装.隐藏起来的方法. 封装可以被认为是一个保护屏障,防止该类的代码和数据被外部类定义的代码随机访问.要访问该类的代码和数据,必须通 ...
- web font各浏览器兼容问题以及格式
语法: @font-face { font-family: <identifier>; src: <fontsrc> [, <fontsrc>]*; <fon ...
- Vulnhub DC-6靶机渗透
信息搜集 nmap -sP 192.168.146.0/24 #找靶机ip nmap -sS -Pn -A 192.168.146.143 #扫描靶机信息 22和80端口,老朋友了. 先直接访问htt ...
- JAVA中使用使Math 类操作数据
转自:https://www.imooc.com/code/2342 侵删! Math 类位于 java.lang 包中,包含用于执行基本数学运算的方法, Math 类的所有方法都是静态方法,所以使用 ...
- 廖雪峰 Git 教程 + Git-Cheat-Sheet 学习总结
廖雪峰 Git 教程 + Git-Cheat-Sheet 学习总结 本教程主要是个人的 Git 学习总结. 主要参考博客: 廖雪峰 Git 教程 Git-Cheat-Sheet 文章目录 廖雪峰 Gi ...