diff --git a/bucket/ghostscript.json b/bucket/ghostscript.json index 6de93ea612..997e234d66 100644 --- a/bucket/ghostscript.json +++ b/bucket/ghostscript.json @@ -32,7 +32,25 @@ ] } }, + "post_install": [ + "$reg_app = \"HKCU:\\SOFTWARE\\Artifex\\GPL Ghostscript\\$version\"", + "$reg_lib = \"HKCU:\\SOFTWARE\\GPL Ghostscript\\$version\"", + "if ($global) { $reg_app = $reg_app.Replace('HKCU:','HKLM:'); $reg_lib = $reg_lib.Replace('HKCU','HKLM') }", + "$reg_gs_dll = \"$dir\\bin\\gsdll$($architecture.Replace('bit', '')).dll\".Replace('\\','\\\\')", + "$reg_gs_lib = \"$dir\\bin;$dir\\lib;$dir\\fonts\".Replace('\\','\\\\')", + "New-Item -Path $reg_app -Value $dir.Replace('\\','\\\\') -Force | Out-Null", + "New-Item -Path $reg_lib -Value $dir.Replace('\\','\\\\') -Force | Out-Null", + "New-ItemProperty -Path $reg_lib -Name 'GS_DLL' -Value $reg_gs_dll -PropertyType String | Out-Null", + "New-ItemProperty -Path $reg_lib -Name 'GS_LIB' -Value $reg_gs_lib -PropertyType String | Out-Null" + ], "env_add_path": "lib", + "post_uninstall": [ + "$reg_app = \"HKCU:\\SOFTWARE\\Artifex\\GPL Ghostscript\\$version\"", + "$reg_lib = \"HKCU:\\SOFTWARE\\GPL Ghostscript\\$version\"", + "if ($global) { $reg_app = $reg_app.Replace('HKCU:','HKLM:'); $reg_lib = $reg_lib.Replace('HKCU','HKLM') }", + "Remove-Item -Path $reg_app -Force -Recurse", + "Remove-Item -Path $reg_lib -Force -Recurse" + ], "checkver": { "github": "https://github.com/ArtifexSoftware/ghostpdl-downloads/", "regex": "Ghostscript/GhostPDL ([\\d.]+)"