NSIS 脚本条件部分/SectionGroup

发布于 2024-10-22 01:43:23 字数 160 浏览 5 评论 0原文

显然,我在这方面找不到任何帮助。我有一个场景,我想检查用户的计算机上是否安装了特定版本的 .NET Framework。如果没有,我想在节组内显示一个强制节,让用户知道特定版本的 .NET Framework 是先决条件,并且将在安装应用程序之前安装它。我怎样才能去做这样的事情呢?

谢谢!

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?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸠书 2024-10-29 01:43:23
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

您可以在 上找到有关查找已安装的 .NET 版本的信息此博客并通过搜索nsis 维基

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文