Inno Setup:仅当组件“X”存在时如何创建密码向导页面已选择
任何人都可以帮助我保护选择组或组件。
例如,
If ('Readme.txt').selected or ('compact').selected = True then
begin "Password wizard page";
else
result := true;
end;
与此工作脚本类似的东西:P
function CheckPassword(Password: String): Boolean;
begin
result := false;
if (Password='component') or (Password='type') then
result := true;
end;
Can anyone help me to protect a selection group or component.
For examples
If ('Readme.txt').selected or ('compact').selected = True then
begin "Password wizard page";
else
result := true;
end;
Something like that to this working script :P
function CheckPassword(Password: String): Boolean;
begin
result := false;
if (Password='component') or (Password='type') then
result := true;
end;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我完全理解你的问题,但这也许有帮助。这里有几个函数,您只需添加到 Components.iss 示例的
[code]
部分,其中一个组件(“help”)只能是当用户输入正确的密码时安装。由于您稍后在安装过程中需要密码,而且并非总是需要密码,因此您不能使用标准设置密码页面。您将创建自己的页面并将其插入到组件选择页面之后:
请注意,这使用翻译后的密码标题,您可能还需要使其他三个字符串也可翻译。
接下来,如果用户没有选择安装组件,则需要隐藏该页面:
最后,您需要检查密码,如果密码错误,则阻止用户进入下一页:
I'm not sure I completely understood your question, but maybe this helps. Here are a few functions you only need to add to the
[code]
section of the Components.iss sample, and one of the components ("help") can only be installed when the user enters the correct password.Since you need the password later in the installation, and not always, you can not use the standard setup password page. You will instead create your own page and insert it after the components selection page:
Note that this uses the translated password caption, you may need to make the other three strings translatable as well.
Next you will need to hide that page if the user has not selected the component for installation:
Finally you need to check the password, and prevent the user from going to the next page if the password is wrong: