开发者

NSIS Scripting Condidtional Section / SectionGroup

开发者 https://www.devze.com 2023-02-17 19:09 出处:网络
Apparently, I can\'t find any help on this. I have a scenario where I want to check if the user has a certain version of the .NET Framework installed on his or her machine. If not, I want to display a

Apparently, I can't find any help on this. I have a scenario where I want to check if the user has a certain version of the .NET Framework installed on his or her machine. If not, I want to display a mandetory section inside a section-group that let's the user know that a particular version of the .NET Framework is a prerequisite and it will be installed prior to installing the application. How can I go about doing something like this?开发者_StackOverflow社区

Thanks!


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

You can find information about finding the installed version of .NET on this blog and by searching the nsis wiki

0

精彩评论

暂无评论...
验证码 换一张
取 消