我想进入一个文件夹。如果是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;
您的begin
和end
不匹配。并且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;