相关疑难解决方法(0)

如何检测旧安装和提供删除?

如何检测用户是否已安装软件,如果是,如何提供删除旧版本的可能性?

我写了一些行来检查.这是正确的吗?如果这是正确的,那么我该如何让用户选择是继续安装还是卸载旧版本?

#define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\setupname_is1"

var
  uninstallPath: string;

function InitializeSetup: Boolean;
begin
  if (RegQueryStringValue(HKLM,'{#UNINSTKEY}','UninstallString',uninstallPath)) and
     (uninstallPath <> '') and (fileexists(uninstallPath)) then
  begin
    Result :=
      (MsgBox(CustomMessage('NotVerifiedVersionFound'), mbConfirmation,
              MB_YESNO or MB_DEFBUTTON2) = IDYES);
  end;
  { ... }
end;
Run Code Online (Sandbox Code Playgroud)

inno-setup

16
推荐指数
1
解决办法
3万
查看次数

标签 统计

inno-setup ×1