2011-03-16 58 views
0

显然,我找不到任何帮助。我有一个场景,我想检查用户是否在他或她的机器上安装了某个版本的.NET Framework。如果不是,我想在一个section-group内部显示一个mandetory部分,让用户知道.NET Framework的特定版本是必备条件,它将在安装应用程序之前安装。我该如何去做这样的事情?NSIS Scripting Condidtional Section/SectionGroup

谢谢!

回答

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 

你可以找到关于发现在this blog .NET的安装版本,并通过搜索nsis wiki

信息