在 Inno Setup 中执行 UninstallString

编程入门 行业动态 更新时间:2024-10-27 17:12:51
本文介绍了在 Inno Setup 中执行 UninstallString的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的要求是在安装和卸载以前的版本之前检查以前安装的 SQL native Client 11.我已经能够检查以前的安装没有问题,但是,我无法卸载相同的.

My requirement is to check for previous installation of SQL native Client 11, before installation and uninstall the previous version. I have been able to check for the previous installation with no problems, however, I am unable to uninstall the same.

我使用了如何检测旧安装和要约删除?

在运行期间,我收到以下错误

During run time, I am getting the following error

异常:内部错误:未知常量A22EED3F-6DB6-4987-8023-6C6B7030E554".

Exception: Internal error: Unknown constant "A22EED3F-6DB6-4987-8023-6C6B7030E554".

(其中常量是本机客户端的 GUID)在该行执行期间

(where the constant is the GUID of the native client) during the execution of the line

Exec(ExpandConstant(sUnInstallString), '', '', SW_SHOW, ewWaitUntilTerminated, iResultCode);

sUnInstallString 是

MsiExec.exe /I{A22EED3F-6DB6-4987-8023-6C6B7030E554}

提前致谢.

推荐答案

那不是 (Inno Setup) 常量.那是一个 GUID.删除 ExpandConstant 调用.

That's not a (Inno Setup) constant. That's a GUID. Remove the ExpandConstant call.

并且您需要将卸载字符串拆分为程序路径及其参数.

And you need to split the uninstall string to a program path and its parameters.

var P: Integer; UninstallPath: string; UninstallParams: string; begin { ... } { In case the program path is quoted, because it contains spaces. } { (it's not in your case, but it can be, in general) } if Copy(sUnInstallString, 1, 1) = '"' then begin Delete(sUnInstallString, 1, 1); P := Pos('"', sUnInstallString); end else P := 0; if P = 0 then begin P := Pos(' ', sUnInstallString); end; UninstallPath := Copy(sUnInstallString, 1, P - 1); UninstallParams := TrimLeft(Copy(sUnInstallString, P + 1, Length(sUnInstallString) - P)); Exec(UninstallPath, UninstallParams, '', SW_SHOW, wWaitUntilTerminated, iResultCode); { ... } end;

更多推荐

在 Inno Setup 中执行 UninstallString

本文发布于:2023-11-13 09:34:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584018.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Inno   Setup   UninstallString

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!