【发布时间】:2019-03-18 20:47:14
【问题描述】:
我正在编写一个 Inno Setup 脚本,该脚本应该检查是否已经存在具有给定名称的开始菜单条目。下面的脚本检查目录是否存在。问题是即使选择了 '不创建开始菜单文件夹' 选项,它也会检查是否存在,我不知道如何获取此信息。
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpSelectProgramGroup then
begin
if DirExists(ExpandConstant('{group}')) then { if the directory is not empty }
begin
{ I have no idea how to get the info if the user has selected }
{ the create start menu folder option or not }
if { USER DID NOT SELECT THE 'Don't create a Start menu folder' OPTION } then
begin
MsgBox('Directory already exists. Please choose a different one.',
mbConfirmation, MB_OK);
Result := False;
end
else
begin
Result := True;
end;
end
else
begin
Result := True;
end;
end { wpSelectProgramGroup }
else
begin
Result := True;
end;
end;
【问题讨论】:
-
升级时应允许用户使用现有文件夹。