diff --git a/src/chocolatey.resources/helpers/chocolateyInstaller.psm1 b/src/chocolatey.resources/helpers/chocolateyInstaller.psm1 index bfc0a37bbd..55a74ab2c9 100644 --- a/src/chocolatey.resources/helpers/chocolateyInstaller.psm1 +++ b/src/chocolatey.resources/helpers/chocolateyInstaller.psm1 @@ -48,6 +48,7 @@ if(Test-Path($extensionsPath)) { Write-Debug 'Loading community extensions' #Resolve-Path $extensionsPath\**\*\*.psm1 | % { Write-Debug "Importing `'$_`'"; Import-Module $_.ProviderPath } Get-ChildItem $extensionsPath -recurse -filter "*.psm1" | Select -ExpandProperty FullName | % { Write-Debug "Importing `'$_`'"; Import-Module $_; } + Get-ChildItem $extensionsPath -recurse -filter "*.dll" | Select -ExpandProperty FullName | % { Write-Debug "Importing `'$_`'"; Import-Module $_; } } Export-ModuleMember -Function * -Alias * \ No newline at end of file diff --git a/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 b/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 index 14f69c8e88..8994481dc2 100644 --- a/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 +++ b/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 @@ -24,5 +24,19 @@ $version = $env:packageVersion $packageName = $env:packageName $packageFolder = $env:packageFolder +$helpersPath = (Split-Path -parent $MyInvocation.MyCommand.Definition); +$nugetChocolateyPath = (Split-Path -parent $helpersPath) +$nugetPath = $nugetChocolateyPath +$nugetExePath = Join-Path $nuGetPath 'bin' +$nugetLibPath = Join-Path $nuGetPath 'lib' +$badLibPath = Join-Path $nuGetPath 'lib-bad' +$extensionsPath = Join-Path $nugetPath 'extensions' +$chocInstallVariableName = "ChocolateyInstall" +$chocoTools = Join-Path $nuGetPath 'tools' +$nugetExe = Join-Path $chocoTools 'nuget.exe' +$7zip = Join-Path $chocoTools '7za.exe' +$ShimGen = Join-Path $chocoTools 'shimgen.exe' +$checksumExe = Join-Path $chocoTools 'checksum.exe' + Write-Debug "Running `'$packageScript`'"; & "$packageScript" \ No newline at end of file diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyDesktopLink.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyDesktopLink.ps1 index 12f81ffc1c..36448c3a5f 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyDesktopLink.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyDesktopLink.ps1 @@ -55,10 +55,10 @@ param( $lnk.WorkingDirectory = $workingDirectory $lnk.Save() - Write-Debug "Desktop Shortcut created pointing at `'$targetFilePath`'." + Write-Host "Desktop Shortcut created pointing at `'$targetFilePath`'." } catch { - throw $_.Exception + Write-Warning "Unable to create desktop link. Error captured was $($_.Exception.Message)." } } \ No newline at end of file diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyExplorerMenuItem.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyExplorerMenuItem.ps1 index 4f04276da2..e66c4224fa 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyExplorerMenuItem.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyExplorerMenuItem.ps1 @@ -76,8 +76,7 @@ try { Write-Host "'$menuKey' explorer menu item has been created" } catch { - $errorMessage = "'$menuKey' explorer menu item was not created $($_.Exception.Message)" - Write-Error $errorMessage - throw $errorMessage + $errorMessage = "'$menuKey' explorer menu item was not created - $($_.Exception.Message)" + Write-Warning $errorMessage } } diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 index 0d7f362a90..09a7167e70 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyPinnedTaskBarItem.ps1 @@ -32,24 +32,28 @@ param( Write-Debug "Running 'Install-ChocolateyPinnedTaskBarItem' with targetFilePath:`'$targetFilePath`'"; - if (test-path($targetFilePath)) { - $verb = "Pin To Taskbar" - $path= split-path $targetFilePath - $shell=new-object -com "Shell.Application" - $folder=$shell.Namespace($path) - $item = $folder.Parsename((split-path $targetFilePath -leaf)) - $itemVerb = $item.Verbs() | ? {$_.Name.Replace("&","") -eq $verb} - if($itemVerb -eq $null){ - Write-Host "TaskBar verb not found for $item. It may have already been pinned" - } else { - $itemVerb.DoIt() - } - Write-Host "`'$targetFilePath`' has been pinned to the task bar on your desktop" - } else { - $errorMessage = "`'$targetFilePath`' does not exist, not able to pin to task bar" - } - if($errorMessage){ - Write-Error $errorMessage - throw $errorMessage + try{ + if (test-path($targetFilePath)) { + $verb = "Pin To Taskbar" + $path= split-path $targetFilePath + $shell=new-object -com "Shell.Application" + $folder=$shell.Namespace($path) + $item = $folder.Parsename((split-path $targetFilePath -leaf)) + $itemVerb = $item.Verbs() | ? {$_.Name.Replace("&","") -eq $verb} + if($itemVerb -eq $null){ + Write-Host "TaskBar verb not found for $item. It may have already been pinned" + } else { + $itemVerb.DoIt() + } + Write-Host "`'$targetFilePath`' has been pinned to the task bar on your desktop" + } else { + $errorMessage = "`'$targetFilePath`' does not exist, not able to pin to task bar" + } + + if ($errorMessage) { + Write-Warning $errorMessage + } + } catch { + Write-Warning "Unable to create pin. Error captured was $($_.Exception.Message)." } } \ No newline at end of file diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyShortcut.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyShortcut.ps1 index 038a688a62..98639dc53d 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyShortcut.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyShortcut.ps1 @@ -114,6 +114,6 @@ directoy, an icon to be used for the shortcut, along with a description and argu Write-Debug "Shortcut created." } catch { - throw $_.Exception + Write-Warning "Unable to create shortcut. Error captured was $($_.Exception.Message)." } } \ No newline at end of file