【问题标题】:NSIS script - download .NET framework, DirectXNSIS 脚本 - 下载 .NET 框架、DirectX
【发布时间】:2010-02-12 21:13:57
【问题描述】:

NSIS 脚本能否从 microsoft 下载 .NET 和 DirectX,然后安装?

我不想在我的安装程序中包含安装程序,因为它们很大。

【问题讨论】:

    标签: .net directx nsis


    【解决方案1】:

    这是 .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
    

    【讨论】:

      【解决方案2】:

      【讨论】:

      • 我想在安装过程中下载文件,而不是在我的 8MB 安装程序中包含 DirectX 或 .NET 框架。
      • 这里引用的文件不是完整的安装程序,它是web安装程序。
      【解决方案3】:

      对于 DX,您可以使用 dxwebsetup.exe 作为引导程序。这是一个小型安装程序,它会扫描用户的系统,然后下载所需的组件:
      http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en

      不确定是否有适用于常规 .net 框架的类似 Web 安装程序,但至少成功了一半

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-05-07
        • 1970-01-01
        • 1970-01-01
        • 2011-04-03
        相关资源
        最近更新 更多