如何更改 NSIS 中欢迎页面和完成页面中图像的宽度,使其看起来像背景?
我想创建一个安装程序,其中在欢迎页面和完成页面中,而不是左侧的横幅,有一个覆盖对话框整个宽度的背景图像。
I want to create an installer in which in the welcome and finish pages instead of a banner on the left side, there is a background image that covers the whole width of the dialog.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
欢迎和完成页面是使用 nsDialogs 创建的自定义 NSIS 页面。但是,如果您希望位图覆盖整个对话框,那么您还需要对实际的 UI 文件进行一些修改。
将 ...\NSIS\Contrib\UIs\modern.exe 复制到 myui.exe
使用资源黑客 将位图控件添加到对话框 105。
在 .nsh 的顶部,将MUI_UI定义为myui.exe的路径
使用 nsDialogs 创建自定义页面以模拟“欢迎”和“完成”页面。在调用 nsDialogs::Show 之前,您需要:
SetCtlColors
以使其透明。LoadAndSetImage
将图像加载到您在对话框105中创建的控件中。如果您不想自己完成所有这些操作,您可以使用 图形安装程序 第 3 方产品。
这是使用页面区域的示例:
如果您希望位图扩展到页面区域的边界之外,则必须使用我最初的建议
!define MUI_UI
+GetDlgItem
+加载并设置图像
。The Welcome and Finish pages are custom NSIS pages created with nsDialogs. However, if you want a bitmap to cover the entire dialog then you need to do some modifications to the actual UI files as well.
Copy ...\NSIS\Contrib\UIs\modern.exe to myui.exe
Use Resource Hacker to add a bitmap control to dialog 105.
At the top of your .nsh, define MUI_UI to the path of myui.exe
Create custom pages with nsDialogs to mimic the Welcome and Finish pages. Before calling
nsDialogs::Show
you need to:SetCtlColors
on the custom dialog handle to make it transparent.LoadAndSetImage
to load the image into the control you created in dialog 105.If you don't want to do all of this yourself you can use the Graphical Installer 3rd-party product.
Here is an example using the page area:
If you want the bitmap to extend outside the bounds of the page area you have to use my initial suggestion with
!define MUI_UI
+GetDlgItem
+LoadAndSetImage
.