在Inno Setup中执行UninstallString

编程入门 行业动态 更新时间:2024-10-27 19:22:06
本文介绍了在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:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584019.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Inno   Setup   UninstallString

发布评论

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

>www.elefans.com

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