1

My company uses CYCLANCE and CYCLANCEProtect is preventing me to run Pkg.build(). Is it possible to stop Julia from using Powershell on Windows 7 and use cmd instead?

Here is an example:

julia> Pkg.build("Gumbo")
INFO: Building Gumbo
CylancePROTECT Script Control has blocked access to this PowerShell script.
CylancePROTECT Script Control has blocked access to this PowerShell script.
====================================================[ ERROR: Gumbo ]=======
Karma
  • 11
  • 1
  • 1
    I suspect not considering that it looks like the [download function](https://github.com/JuliaLang/julia/blob/446085a6520d6324e5e1857aa9a3d03f21007f27/base/download.jl) only invokes powershell on windows. Indeed it is noted in the [PR](https://github.com/JuliaLang/julia/pull/25477) that this could cause problems for people in your situation (corporate environment that blocks powershell). – Mike Zboray Mar 02 '18 at 04:22

1 Answers1

1

You could try to use cURL for downloading which is also available on windows (here are some installation instructions). Julia allows to override the download function by defining a function with the same name:

function Base.download(url::AbstractString, filename::AbstractString)
   run(`curl -L -f -o $filename $url`)
   filename
end

Once you paste this code in the julia REPL, julia should use this cURL download function (instead of PowerShell). If you want to make this permanent you can put this code in a file called .juliarc.jl (in the home directory, i.e. the output of homedir()).

Alex338207
  • 1,430
  • 8
  • 14