显然,我找不到任何帮助。我有一个场景,我想检查用户是否在他或她的机器上安装了某个版本的.NET Framework。如果没有,我想在一个section-group中显示一个mandetory部分,让用户知道.NET Framework的特定版本是先决条件,并且它将在安装应用程序之前安装。我怎么能做这样的事呢?
谢谢!
答案 0 :(得分:1)
Outfile "test.exe"
Requestexecutionlevel user
!include Sections.nsh
!include LogicLib.nsh
Page Components MyCompPreCallback
Page Instfiles
SectionGroup /e Foo
Section ".NET Framework vX.Y" SEC_DOTNET
SectionIn RO
;File ...
SectionEnd
SectionGroupEnd
Function MyCompPreCallback
StrCpy $0 1 ;TODO: Check if .net is installed and put result in $0
${If} $0 <> 0
!insertmacro UnselectSection ${SEC_DOTNET}
${EndIf}
FunctionEnd