如何在Inno设置中检查64/32位 [英] How to check 64/32-bit in Inno setup
本文介绍了如何在Inno设置中检查64/32位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想进入一个文件夹。如果是64位的 Program Files
,则为 Program Files(x86)
。
I want to go inside a folder. It will be Program Files (x86)
if 64-bit Program Files
if 32-bit. How to do that in Inno setup.
这是我尝试过的代码(但没有运气):
This is the code I tried (but no luck):
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}\Local\VirtualStore\Program Files (x86)\MY PROJECT'), True, True, True);
else
DelTree(ExpandConstant('{userappdata}\Local\VirtualStore\Program Files\MY PROJECT'), True, True, True);
end;
end;
end;
end;
推荐答案
您的开始
和 end
不匹配。并且 else
之前应该没有分号。
Your begin
's and end
's do not match. And there should be no semicolon before else
.
而且您不应该关心处理器体系结构( ProcessorArchitecture
),但仅是否Windows是64位( IsWin64
)。
And you should not care about processor architecture (ProcessorArchitecture
), but only whether the Windows is 64-bit (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}\Local\VirtualStore\Program Files (x86)\MY PROJECT'), True, True, True)
else
DelTree(ExpandConstant('{userappdata}\Local\VirtualStore\Program Files\MY PROJECT'), True, True, True);
end;
end;
end;
end;
这篇关于如何在Inno设置中检查64/32位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文