Navigation Menu

Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

Commit

Permalink
avoid using ComObject
Browse files Browse the repository at this point in the history
Because WIndows Server Core cannot use ComObject, use `[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")` instead.
  • Loading branch information
cosmo0920 committed Jul 4, 2014
1 parent d82e23f commit 7b3b6df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions powershell/install-cmake.ps1
Expand Up @@ -6,7 +6,7 @@ $pathToZip = "$pwd\cmake.zip"
$targetDir = "$pwd\cmake"
#Load the assembly
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
[System.IO.Compression.ZipFile]::ExtractToDirectory($pathToZip, $targetDir)
[System.IO.Compression.ZipFile]::ExtractToDirectory($pathToZip, $pwd)

# set Path
$Env:Path = "$targetDir\cmake-${cmakeVersion}\win32-x86;" + $Env:Path
$Env:Path = ".\cmake-${cmakeVersion}-win32-x86\bin;" + $Env:Path
8 changes: 3 additions & 5 deletions powershell/package-unzip.ps1
Expand Up @@ -3,11 +3,9 @@

function unzipMrnPackage($workDir, $mariaDBVer, $arch) {
$file = "$workDir\mariadb-$mariadbVer-$arch.zip"
$shell = New-Object -ComObject shell.application
$zip = $shell.NameSpace($file)
$dest = $shell.NameSpace((Split-Path $file -Parent))

$dest.CopyHere($zip.Items())
#Load the assembly
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
[System.IO.Compression.ZipFile]::ExtractToDirectory($file, $pwd)
}

cd $workDir
Expand Down
7 changes: 3 additions & 4 deletions powershell/unzip.ps1
Expand Up @@ -8,8 +8,7 @@ if (Test-Path -path "$nightly") {
}

$file = $(Get-ChildItem $zipname).FullName
$shell = New-Object -ComObject shell.application
$zip = $shell.NameSpace($file)
$dest = $shell.NameSpace((Split-Path $file -Parent))

$dest.CopyHere($zip.Items())
#Load the assembly
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
[System.IO.Compression.ZipFile]::ExtractToDirectory($file, $pwd)

0 comments on commit 7b3b6df

Please sign in to comment.