Skip to content

Commit

Permalink
Fixes windows install issue due to wrong quoting see
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoegh committed Oct 25, 2015
1 parent da14b8b commit 4052107
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion src/Conda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,63 @@ function additional_channels()
return res
end

############ Work aorund for https://github.com/JuliaLang/julia/issues/8064 ##################
# See also https://github.com/JuliaLang/IJulia.jl/pull/211#issuecomment-51562782

typealias HANDLE Ptr{Void}
typealias DWORD Uint32
typealias WORD Uint16
typealias LPTSTR Cwchar_t
typealias LPBYTE Ptr{Char}

immutable STARTUPINFO
cb::DWORD
lpReserved::LPTSTR
lpDesktop::LPTSTR
lpTitle::LPTSTR
dwX::DWORD
dwY::DWORD
dwXSize::DWORD
dwYSize::DWORD
dwXCountChars::DWORD
dwYCountChars::DWORD
dwFillAttribute::DWORD
dwFlags::DWORD
wShowWindow::WORD
cbReserved2::WORD
lpReserved2::LPBYTE
hStdInput::HANDLE
hStdOutput::HANDLE
hStdError::HANDLE
STARTUPINFO() = new()
end

immutable PROCESS_INFORMATION
hProcess::HANDLE
hThread::HANDLE
dwProcessId::DWORD
dwThreadId::DWORD
PROCESS_INFORMATION() = new(C_NULL,C_NULL,C_NULL,C_NULL)
end

CreateProcess(cmd) = begin
si = [STARTUPINFO()]
pi = [PROCESS_INFORMATION()]
ccall(:CreateProcessW, Cchar,
(Ptr{Cwchar_t}, Ptr{Cwchar_t}, Ptr{Int}, Ptr{Int}, Cchar, Int64,
Ptr{Uint8}, Ptr{Uint8}, Ptr{PROCESS_INFORMATION}, Ptr{STARTUPINFO}),
C_NULL,
utf16(cmd),
C_NULL,
C_NULL,
0,
0,
C_NULL, C_NULL,
convert(Ptr{PROCESS_INFORMATION}, pointer(pi)),
convert(Ptr{STARTUPINFO}, pointer(pi)))
end

##########################################################

"Get the miniconda installer URL."
function _installer_url()
Expand Down Expand Up @@ -115,7 +172,7 @@ function _install_conda(force=false)
run(`$installer -b -f -p $PREFIX`)
end
@windows_only begin
run(`$installer /S /AddToPath=0 /RegisterPython=0 /D=$PREFIX`)
CreateProcess("$installer /S /AddToPath=0 /RegisterPython=0 /D=$PREFIX")
end
end
end
Expand Down

0 comments on commit 4052107

Please sign in to comment.