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

Commit

Permalink
add support to install msu.
Browse files Browse the repository at this point in the history
  • Loading branch information
xhuanger authored and root committed Oct 12, 2013
1 parent 936a6a7 commit b767eb0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/helpers/functions/Install-ChocolateyInstallPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,15 @@ param(
}
}

if($fileType -like 'msu') {

if ($overrideArguments) {
$msuArgs = "$file $additionalInstallArgs"
} else {
$msuArgs = "$file $silentArgs $additionalInstallArgs"
}
Start-ChocolateyProcessAsAdmin "$msuArgs" 'wusa.exe' -validExitCodes $validExitCodes
}

write-host "$packageName has been installed."
}
18 changes: 18 additions & 0 deletions tests/unit/Install-ChocolateyInstallPackage.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$here = Split-Path -Parent $MyInvocation.MyCommand.Definition
$common = Join-Path (Split-Path -Parent $here) '_Common.ps1'
$base = Split-Path -parent (Split-Path -Parent $here)

. $common
. "$base\src\helpers\functions\Install-ChocolateyInstallPackage.ps1"

Describe "Install-ChocolateyInstallPackage" {
Context "When file type is msu" {
Mock Start-ChocolateyProcessAsAdmin

Install-ChocolateyInstallPackage "package" "msu"
It "should be installed" {
Assert-MockCalled Start-ChocolateyProcessAsAdmin
}
}

}

0 comments on commit b767eb0

Please sign in to comment.