【发布时间】:2010-02-12 21:13:57
【问题描述】:
NSIS 脚本能否从 microsoft 下载 .NET 和 DirectX,然后安装?
我不想在我的安装程序中包含安装程序,因为它们很大。
【问题讨论】:
NSIS 脚本能否从 microsoft 下载 .NET 和 DirectX,然后安装?
我不想在我的安装程序中包含安装程序,因为它们很大。
【问题讨论】:
这是 .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
【讨论】:
【讨论】:
对于 DX,您可以使用 dxwebsetup.exe 作为引导程序。这是一个小型安装程序,它会扫描用户的系统,然后下载所需的组件:
http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en
不确定是否有适用于常规 .net 框架的类似 Web 安装程序,但至少成功了一半
【讨论】: