From 36289b3be751ed6daaecf63532dfa1aa57f37438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9D=89?= Date: Sat, 26 Jan 2019 18:50:53 +0800 Subject: [PATCH] fix IHTMLDocument2_write not exist (#36) --- install.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index c099224..5ba8af5 100644 --- a/install.ps1 +++ b/install.ps1 @@ -51,7 +51,11 @@ if (!$Version) { if ($PSVersionTable.PSVersion.Major -lt 6) { $Response = Invoke-WebRequest 'https://github.com/denoland/deno/releases' $HTMLFile = New-Object -Com HTMLFile - $HTMLFile.IHTMLDocument2_write($Response.Content) + if ($HTMLFile.IHTMLDocument2_write) { + $HTMLFile.IHTMLDocument2_write($Response.Content) + } else { + $HTMLFile.write([System.Text.Encoding]::Unicode.GetBytes($Response.Content)) + } $DenoUri = $HTMLFile.getElementsByTagName('a') | Where-Object { $_.href -like "about:/denoland/deno/releases/download/*/deno_${OS}_x64.$Zip" } | ForEach-Object { $_.href -replace 'about:', 'https://github.com' } |