fixes #11770
This commit is contained in:
parent
7023241aaf
commit
b9dd972c32
1 changed files with 16 additions and 8 deletions
|
|
@ -17,6 +17,12 @@ type
|
||||||
Manual,
|
Manual,
|
||||||
Success
|
Success
|
||||||
|
|
||||||
|
proc expand(s: string): string =
|
||||||
|
try:
|
||||||
|
result = expandFilename(s)
|
||||||
|
except OSError, IOError:
|
||||||
|
result = s
|
||||||
|
|
||||||
proc unzip(): bool =
|
proc unzip(): bool =
|
||||||
if not fileExists("dist" / mingw):
|
if not fileExists("dist" / mingw):
|
||||||
echo "Could not find ", "dist" / mingw
|
echo "Could not find ", "dist" / mingw
|
||||||
|
|
@ -192,19 +198,21 @@ when defined(windows):
|
||||||
let bits = $(sizeof(pointer)*8)
|
let bits = $(sizeof(pointer)*8)
|
||||||
for d in dirs:
|
for d in dirs:
|
||||||
if dirExists d:
|
if dirExists d:
|
||||||
let x = expandFilename(d / "bin")
|
let x = expand(d / "bin")
|
||||||
|
if x.len != 0:
|
||||||
if checkGccArch(x): return x
|
if checkGccArch(x): return x
|
||||||
else: incompat.add x
|
else: incompat.add x
|
||||||
elif dirExists(d & bits):
|
elif dirExists(d & bits):
|
||||||
let x = expandFilename((d & bits) / "bin")
|
let x = expand((d & bits) / "bin")
|
||||||
|
if x.len != 0:
|
||||||
if checkGccArch(x): return x
|
if checkGccArch(x): return x
|
||||||
else: incompat.add x
|
else: incompat.add x
|
||||||
|
|
||||||
proc main() =
|
proc main() =
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
let nimDesiredPath = expandFilename(getCurrentDir() / "bin")
|
let nimDesiredPath = expand(getCurrentDir() / "bin")
|
||||||
let nimbleBin = getEnv("USERPROFILE") / ".nimble" / "bin"
|
let nimbleBin = getEnv("USERPROFILE") / ".nimble" / "bin"
|
||||||
let nimbleDesiredPath = try: expandFilename(nimbleBin) except: nimbleBin
|
let nimbleDesiredPath = expand(nimbleBin)
|
||||||
let p = tryGetUnicodeValue(r"Environment", "Path",
|
let p = tryGetUnicodeValue(r"Environment", "Path",
|
||||||
HKEY_CURRENT_USER) & ";" & tryGetUnicodeValue(
|
HKEY_CURRENT_USER) & ";" & tryGetUnicodeValue(
|
||||||
r"System\CurrentControlSet\Control\Session Manager\Environment", "Path",
|
r"System\CurrentControlSet\Control\Session Manager\Environment", "Path",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue