@ -247,7 +247,7 @@ Function Choco-Install
[ int ] $timeout
[ int ] $timeout
)
)
if ( ( Choco-IsInstalled $package ) -and -not $force )
if ( Choco-IsInstalled $package )
{
{
if ( $upgrade )
if ( $upgrade )
{
{
@ -258,8 +258,7 @@ Function Choco-Install
return
return
}
}
elseif ( -not $force )
if ( -not $force )
{
{
return
return
}
}
@ -385,20 +384,13 @@ Try
{
{
Chocolatey-Install -Upgrade
Chocolatey-Install -Upgrade
if ( $state -eq " present " )
if ( $state -eq " present " -or $state -eq " latest " )
{
{
Choco-Install -package $package -version $version -source $source -force $force `
Choco-Install -package $package -version $version -source $source -force $force `
-installargs $installargs -packageparams $packageparams `
-installargs $installargs -packageparams $packageparams `
-allowemptychecksums $allowemptychecksums -ignorechecksums $ignorechecksums `
-allowemptychecksums $allowemptychecksums -ignorechecksums $ignorechecksums `
-ignoredependencies $ignoredependencies -timeout $timeout
-ignoredependencies $ignoredependencies -timeout $timeout
}
}
elseif ( $state -eq " latest " )
{
Choco-Upgrade -package $package -version $version -source $source -force $force `
-installargs $installargs -packageparams $packageparams `
-allowemptychecksums $allowemptychecksums -ignorechecksums $ignorechecksums `
-ignoredependencies $ignoredependencies -timeout $timeout
}
elseif ( $state -eq " absent " )
elseif ( $state -eq " absent " )
{
{
Choco-Uninstall -package $package -version $version -force $force -timeout $timeout
Choco-Uninstall -package $package -version $version -force $force -timeout $timeout