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

add support to install msu. #348

Merged
merged 1 commit into from
Oct 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}

}