我有一个 NSIS 安装程序,除非它需要下载其他文件,否则我想完全保持安静。我可以使用 SilentInstall 使其完全静音,但随后我无法显示我的下载对话框(我正在使用 InetLoad::load)。
我想告诉 NSIS 在我说之前不要显示任何窗口。我能想到的最好的是 HideWindow。不幸的是,它看起来像 NSIS 默认显示窗口然后隐藏它导致闪烁。
如何防止闪烁的窗口?
示例代码:
Name "Flicker test" OutFile "flickertest.exe" AutoCloseWindow true Section HideWindow SectionEnd
最佳答案
这是一种 hack 方式:
!include "${NSISDIR}\Examples\System\System.nsh"
Name "No Flicker test"
OutFile "noflickertest.exe"
AutoCloseWindow true
Function .onGUIInit
; move window off screen
System::Call "User32::SetWindowPos(i, i, i, i, i, i, i) b ($HWNDPARENT, 0, -10000, -10000, 0, 0, ${SWP_NOOWNERZORDER}|${SWP_NOSIZE})"
FunctionEnd
Section -main
HideWindow
SectionEnd
关于nsis - 如何隐藏所有窗口,直到我在 NSIS 中需要它们,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1604205/