很多時候我們需要在安裝文件之前卸載原有的程序而不是覆蓋安裝,本文的co
實現原理是:從注冊表'UninstallString'項中讀取卸載信息,用Exec進行靜默卸載。
下面co
function InitializeSetup(): boolean;
var
ResultStr: String;
ResultCode: Integer;
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\APP_NAME_is1', 'UninstallString', ResultStr) then
begin
ResultStr := RemoveQuotes(ResultStr);
Exec(ResultStr, '/silent', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
result := true;
end;
本文介绍了一种在安装新版本程序前静默卸载旧版本的方法。通过读取注册表中的'UninstallString'项来获取卸载指令,并使用Exec函数实现静默卸载过程。
2059

被折叠的 条评论
为什么被折叠?



