' This Source Code Form is subject to the terms of the Mozilla Public
' License, v. 2.0. If a copy of the MPL was not distributed with this
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
' This script downloads and install MSYS2 and the preferred terminal emulator ConEmu
Sub Download(uri, path)
Dim httpRequest, stream
Set httpRequest = CreateObject("MSXML2.ServerXMLHTTP.6.0")
Set stream = CreateObject("Adodb.Stream")
httpRequest.Open "GET", uri, False
httpRequest.Send
With stream
.type = 1
.open
.write httpRequest.responseBody
.savetofile path, 2
End With
End Sub
Function GetInstallPath()
Dim message, prompt
message = "When you click OK, we will download and extract a build environment to the directory specified. You should see various windows appear. Do NOT interact with them until one explicitly prompts you to continue." & vbCrLf & vbCrLf & "Installation Path:"
Set FilesInZip = appShell.NameSpace(fso.GetAbsolutePathName("msys2.zip")).Items()
appShell.NameSpace(msysPath).CopyHere(FilesInZip)
' MSYS2 archive doesn't have tmp directory...
fso.CreateFolder(fso.BuildPath(msysPath, "tmp"))
fso.DeleteFile("msys2.zip")
If Err.Number <> 0 Then
MsgBox("Error downloading and installing MSYS2. Make sure you have internet connection. If you think this is a bug, please file one in Bugzilla https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Build%20Config")
errorCode = shell.Run("powershell.exe -NoProfile -ExecutionPolicy Unrestricted set dst '" & conemuPath & "'; set ver 'stable'; set lnk 'Mozilla Development Shell'; set xml '" & conemuSettingsURI & "'; set run $FALSE; .\install2.ps1", 0, true)
' Delete ConEmu installer
fso.DeleteFile("install2.ps1")
If Err.Number <> 0 Then
MsgBox("Error downloading and installing ConEmu. Make sure you have internet connection and Powershell installed. If you think this is a bug, please file one in Bugzilla https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Build%20Config")
MsgBox("MSYS2 initial setup failed. Make sure you have full access to the path you specified. If you think this is a bug, please file one in Bugzilla at https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Build%20Config")
MsgBox("Package update failed. Make sure you have internet access. If you think this is a bug, please file one in Bugzilla at https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Build%20Config")
MsgBox("Bootstrap failed. Make sure you have internet access. If you think this is a bug, please file one in Bugzilla https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Build%20Config")