简体   繁体   English

NSIS脚本 - 下载.NET框架,DirectX

[英]NSIS script - download .NET framework, DirectX

Can a NSIS script download .NET and DirectX from microsoft, then install it? NSIS脚本可以从microsoft下载.NET和DirectX,然后安装吗?

I don't want to include the installers in my installer because they are huge. 我不想在我的安装程序中包含安装程序,因为它们非常庞大。

Here's an example for .Net : 这是.Net的一个例子:

Function GetDotnet ;// looks for local copy before downloading, returns path in $0
    Pop $0
    ${If} ${FileExists} "$InitDir\dotnetfx35.exe"
        StrCpy $0 "$InitDir\dotnetfx35.exe"
    ${ElseIf} ${FileExists} "$InitDir\dotnetfx35setup.exe"
        StrCpy $0 "$InitDir\dotnetfx35setup.exe"
    ${Else}         
        Call DownloadDotnet
        StrCpy $0 $0
    ${EndIf}
    Push $0
FunctionEnd

Function DownloadDotnet ;// downloads .Net, returns download path in $0
    NSISDL::download "${DotnetDownloadUrl}" "${TempDir}\dotnetfx35setup.exe"
    Pop $0  
    ${If} $0 == "cancel"
        Quit    
    ${EndIf} 
    StrCpy $0 "${TempDir}\dotnetfx35setup.exe"
    Push $0
FunctionEnd 

Function InstallDotnet ;// kicks off the .Net installer
    Pop $0
    Push $1 
    ExecWait '"$0" /norestart' $1       
FunctionEnd

在这里,您可以访问: 为DirectX进行Web下载的信息

For DX, you can use dxwebsetup.exe as a bootstrap. 对于DX,您可以使用dxwebsetup.exe作为引导程序。 It's a small installer, which scans the user's system and then downloads required components: 它是一个小型安装程序,它扫描用户的系统,然后下载所需的组件:
http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en

Not sure if there's a similar web installer for the regular .net framework, but at least that's half the battle 不确定是否有类似的常规.net框架的Web安装程序,但至少这是一半的战斗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM