首页 \ 问答 \ NSIS安装程序许可证页面仅显示“关闭”和“取消”按钮(NSIS installer License page only shows “Close” and “Cancel” buttons)

NSIS安装程序许可证页面仅显示“关闭”和“取消”按钮(NSIS installer License page only shows “Close” and “Cancel” buttons)

我使用NSIS 2.46在Windows上构建了一个简单的安装程序。 这是许可页面的代码

# UI
!include "MUI2.nsh"
!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "..\legal\disclaimer.txt"
!insertmacro MUI_LANGUAGE "English"

当我运行安装程序时,“许可证”页面会正确显示许可证文本,但只会禁用“关闭”和启用“取消”按钮。 将选定的单选按钮更改为“我接受许可协议的条款”后,将启用“关闭”按钮。 如果单击它们,两个按钮都会导致安装程序退出。

如果接受许可,如何更改脚本以使用“继续”按钮?


I've built a simple installer on Windows using NSIS 2.46. That is the code for the license page

# UI
!include "MUI2.nsh"
!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "..\legal\disclaimer.txt"
!insertmacro MUI_LANGUAGE "English"

When I run the installer, the License page displays the license text properly but only has a disabled "Close" and an enabled "Cancel" button. Once I change the selected radio button to "I accept the terms of the License Agreement", the "Close" button is enabled. Both buttons cause the installer to quit if I click them.

How can I change the script to have a "Continue" button if the license is accepted?


原文:https://stackoverflow.com/questions/25013173
更新时间:2024-01-24 07:01

最满意答案

我问你是否可以做一些事情:

Foo<decltype([]()->void { })> foo;

不,你不能,因为lambda表达式不会出现在未评估的上下文中(例如decltypesizeof等)。 C ++ 0x FDIS,5.1.2 [expr.prim.lambda] p2

lambda表达式的评估导致临时值(12.2)。 这个临时被称为闭包对象。 lambda表达式不得出现在未经评估的操作数 (第5条)中。 [注意:闭包对象的行为就像一个函数对象(20.8).- end note] (强调我的)

您需要首先创建一个特定的lambda,然后使用decltype:

auto my_comp = [](const std::string& left, const std::string& right) -> bool {
  // whatever
}

typedef std::unordered_map<
  std::string,
  std::string,
  std::hash<std::string>,
  decltype(my_comp)
  > map_type;

那是因为每个lambda派生的闭包对象可能有完全不同的类型,毕竟它们就像匿名函数。


I'm asking if you can do something like:

Foo<decltype([]()->void { })> foo;

No you can't, because lambda expressions shall not appear in an unevaluated context (such as decltype and sizeof, amongst others). C++0x FDIS, 5.1.2 [expr.prim.lambda] p2

The evaluation of a lambda-expression results in a prvalue temporary (12.2). This temporary is called the closure object. A lambda-expression shall not appear in an unevaluated operand (Clause 5). [ Note: A closure object behaves like a function object (20.8).—end note ] (emphasis mine)

You would need to first create a specific lambda and then use decltype on that:

auto my_comp = [](const std::string& left, const std::string& right) -> bool {
  // whatever
}

typedef std::unordered_map<
  std::string,
  std::string,
  std::hash<std::string>,
  decltype(my_comp)
  > map_type;

That is because each lambda-derived closure object could have a completely different type, they're like anonymous functions after all.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)