2011-03-16 21 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

信息