NSIS script - download .NET framework, DirectX

Can an NSIS script download .NET and DirectX from microsoft and then install it?

I do not want to include installers in my installer because they are huge.

+4
source share
3 answers

Here is an example for .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 
+4
source

For DX, you can use dxwebsetup.exe as a bootstrap. This is a small installer that scans the user system and then downloads the necessary components:
http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en

Not sure if there is a similar web installer for a regular .net structure, but at least this half the battle

0
source

Source: https://habr.com/ru/post/1301151/


All Articles