如何在Inno Setup中检查64/32位



我想进入一个文件夹。如果是64位,则为Program Files (x86);如果是32位,则将为Program Files。如何在Inno设置中做到这一点。

这是我尝试过的代码(但没有成功(:

procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
  mres : integer;
begin
  case CurUninstallStep of
    usPostUninstall:
      begin
        mres := MsgBox('Do you want to delete saved games?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
        if mres = IDYES then
          if ProcessorArchitecture = paIA64 then
            begin
               if IsWin64 then
                DelTree(ExpandConstant('{userappdata}LocalVirtualStoreProgram Files (x86)MY PROJECT'), True, True, True);
          else
                DelTree(ExpandConstant('{userappdata}LocalVirtualStoreProgram FilesMY PROJECT'), True, True, True);
          end;
      end;
  end;
end;

您的beginend不匹配。并且else之前不应该有分号。

您不应该关心处理器体系结构(ProcessorArchitecture(,而应该只关心Windows是否为64位(IsWin64(。

procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
  mres : integer;
begin
  case CurUninstallStep of
    usPostUninstall:
      begin
        mres := MsgBox('Do you want to delete saved games?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
        if mres = IDYES then
        begin
          if IsWin64 then
            DelTree(ExpandConstant('{userappdata}LocalVirtualStoreProgram Files (x86)MY PROJECT'), True, True, True)
          else
            DelTree(ExpandConstant('{userappdata}LocalVirtualStoreProgram FilesMY PROJECT'), True, True, True);
        end;
      end;
  end;
end;

相关内容

  • 没有找到相关文章

最新更新