diff --git a/package/tinyxml2/tools/chocolateyinstall.ps1 b/package/tinyxml2/tools/chocolateyinstall.ps1 index 45f09f6..29969d5 100644 --- a/package/tinyxml2/tools/chocolateyinstall.ps1 +++ b/package/tinyxml2/tools/chocolateyinstall.ps1 @@ -7,6 +7,7 @@ $ErrorActionPreference = 'Stop'; # stop on all errors # Source registry key values which are shared between install and uninstall . $PSScriptRoot\regKeys.ps1 + # CMake doesn't set registry keys for the system package repository by default so we check for the presence of CMake by observing the registry path for the current user. # We need to register the package path to the machine because the jenkins node user doesn't have privileges to install packages via chocolatey. There may be other options to work around this and use HKCU. if (Test-Path $CMakeRegistryPath) { @@ -17,4 +18,7 @@ if (Test-Path $CMakeRegistryPath) { New-Item "$CMakeSystemRepositoryPath\$CMakePackageName" -ItemType directory New-ItemProperty -Name "CMakePackageDir" -PropertyType String -Value "$env:ChocolateyPackageFolder\share\cmake" -Path "$CMakeSystemRepositoryPath\$CMakePackageName" -} \ No newline at end of file +} + +# Add lib directory to path for dlls. +Install-ChocolateyPath "$env:ChocolateyPackageFolder\lib" -PathType "Machine" diff --git a/package/tinyxml2/tools/chocolateyuninstall.ps1 b/package/tinyxml2/tools/chocolateyuninstall.ps1 index 087aeaf..01c71d2 100644 --- a/package/tinyxml2/tools/chocolateyuninstall.ps1 +++ b/package/tinyxml2/tools/chocolateyuninstall.ps1 @@ -7,4 +7,7 @@ if (Test-Path $CMakeRegistryPath) { if (Test-Path $CMakeSystemRepositoryPath) { Remove-Item "$CMakeSystemRepositoryPath\$CMakePackageName" } -} \ No newline at end of file +} + +# Removal of the dynamic library from the system Path +# is handled automagically by the use of Install-ChocolateyPath.