我想做一个巫师。当用户选择是时,页面 x 应该跟随。当用户选择否时,页面 y 应该跟随。目前它只对我使用静态页面,所以没关系,用户选择什么总是相同的页面跟随......我该如何改变这一点?请问有人有什么想法吗?
这是一个摘录:
ExistPage := CreateInputOptionPage(OldPage.ID,
'', '', 'If you choose "Yes" then the package will be installed automatically with this setup',True, False);
// Add items
ExistPage.Add('Yes');
ExistPage.Add('No');
// Set initial values (optional)
ExistPage.SelectedValueIndex := 0;
TexPage := CreateInputDirPage(ExistPage.ID,
'Root installation directory', 'Please select installation directory',
'',
True, 'New Folder');
TexPage.Add('');
// Set initial value (optional)
TexPage.Values[0] := ExpandConstant('C:\');
创建页面时,您可以将页面 ID 存储到变量中:
// InitializeWizard is called when the wizard is about to begin.
// This is where we add any custom pages into the installation process.
// The relevant XXX_CreatePage methods should be defined BEFORE this method.
procedure InitializeWizard();
begin
// Add the Application Settings page just after the Selected Tasks page
idAppSettingsPage := AppSettings_CreatePage(wpSelectTasks)
end;
如果您要将用户无线电选择的结果缓存到公共变量中,那么您可以使用以下方法:
function ShouldSkipPage(PageID: Integer): Boolean;
begin
// We don't want to show the select dir, select program group or application settings
// pages if we are upgrading.
if ((PageID = wpSelectDir) or (PageID = idAppSettingsPage) or (PageID = wpSelectProgramGroup)) then
Result := bIsUpgrading
else
Result := False;
end;
这是我在我的设置中用来在安装过程中有选择地显示页面的东西。我只是不确定您如何检查自定义页面 ID。
我只是展示机制。如果您知道现在要显示页面 Y,您可以决定在变量 AA 设置为 1 时显示它。有意义吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句