Your script is just awesome, thank you very much. I like to use it very much, but I don't always have to distribute a package with an EXE or an MSI. I like to use chococlatey, or just want to distribute a regsitry value. Is there a way to distribute a simple install.ps1 and a detection.ps1 in your script?
as an example install.ps1:
$ProgramName = "PDF24"
$ChocoPrg_Version = [System.Version](C:\ProgramData\chocolatey\choco.exe --version)
if ($ChocoPrg_Version -gt [System.Version]"2.0") {
$localprograms = C:\ProgramData\chocolatey\choco.exe list
} else {
$localprograms = C:\ProgramData\chocolatey\choco.exe list -lo
}
Your script is just awesome, thank you very much. I like to use it very much, but I don't always have to distribute a package with an EXE or an MSI. I like to use chococlatey, or just want to distribute a regsitry value. Is there a way to distribute a simple install.ps1 and a detection.ps1 in your script?
as an example install.ps1:
$ProgramName = "PDF24"
$ChocoPrg_Version = [System.Version](C:\ProgramData\chocolatey\choco.exe --version) if ($ChocoPrg_Version -gt [System.Version]"2.0") { $localprograms = C:\ProgramData\chocolatey\choco.exe list } else { $localprograms = C:\ProgramData\chocolatey\choco.exe list -lo }
if ($localprograms -like "$ProgramName") { C:\ProgramData\chocolatey\choco.exe upgrade $ProgramName -y } else { C:\ProgramData\chocolatey\choco.exe install $ProgramName -y }
and the uninstall.ps1:
$ProgramName = "PDF24"
$ChocoPrg_Version = [System.Version](C:\ProgramData\chocolatey\choco.exe --version) if ($ChocoPrg_Version -gt [System.Version]"2.0") { $ChocoPrg_Existing = C:\ProgramData\chocolatey\choco.exe list } else { $ChocoPrg_Existing = C:\ProgramData\chocolatey\choco.exe list -lo }
if ($ChocoPrg_Existing -like "$ProgramName") { Write-Host "Found it!" exit 0 } else { exit 1 }