【发布时间】:2021-01-16 13:41:49
【问题描述】:
我在安装安装程序之前检查所需的软件,如果该软件不存在,我将显示带有“确定”按钮的 MessageBox。当用户点击 在“OK”上,它正在导航到给定的 URL 以安装缺少的软件。但这里的问题是,从消息框导航到支持页面时,父对话框没有关闭。
当用户单击“确定”按钮时,我尝试了不同的方法来关闭父对话框。如果有任何方法可以关闭对话框,请建议我。
Function IsDotNetInstalled
ClearErrors
ReadRegStr $0 HKLM "Software\Microsoft\.NETFramework\policy\v3.0" "20319"
IfErrors Error
Goto End
Error:
MessageBox MB_OK|MB_ICONSTOP "Setup could not detect Microsoft .NET Framework v4.0 on this computer. $\r$\n$\r$\n Please install Microsoft .NET Framework v4.0 and run setup again. $\r$\n$\r$\n Click on OK to navigate to the Microsoft Support page" IDOK
ExecShell open "https://www.microsoft.com/en-in/download/details.aspx?id=17718"
SendMessage $HwndParent ${WM_QUIT} 0 0
Abort
Quit
End:
SendMessage $HwndParent ${WM_QUIT} 0 0
Abort
Quit
FunctionEnd
我从以下部分调用上述函数:
Section "RegistryTest (required)"
SectionIn RO
Call IsDotNetInstalled
ExecShell "" "$INSTDIR\Test.exe"
SectionEnd
【问题讨论】:
标签: nsis