Update install.ps1

This commit is contained in:
FusionPBX 2017-12-31 11:14:05 -07:00 committed by GitHub
parent 6ac3bdb23f
commit 440dc1290a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -15,7 +15,6 @@ $database_password = "random" # random or a custom value
#$database_backup = $false # true or false
# General Settings
$cpu = "x64" # x64 or x86
$php_version = 7 # PHP version 5 or 7
$web_server = "IIS" # nginx or IIS
$iis_identity = "LocalSystem" # localSystem or NetworkService
@ -43,6 +42,15 @@ Function Get-Link([string]$url, [string]$pattern) {
return $uri.AbsoluteUri
}
Function Get-CPU() {
if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
Return "x86"
}
else {
Return "x64"
}
}
Function Write-Log([string]$message) {
Add-Content -Path "install.log" -Value $message
Write-Host $message -ForegroundColor Cyan
@ -62,6 +70,7 @@ Function Get-InstalledApp([string]$name) {
#Download and install latest version on FreeSWITCH 1.6.
#Set it to auto start
Function Install-FreeSWITCH() {
$cpu = Get-CPU
if ($cpu -eq "x86") {
$url = "http://files.freeswitch.org/windows/installer/x86/"
}
@ -126,6 +135,7 @@ Function Expand-ZIP([string]$filename) {
}
Function Install-PostgresODBC() {
$cpu = Get-CPU
$url = "https://ftp.postgresql.org/pub/odbc/versions/msi/"
$link = Get-Link $url -pattern "*" + ($cpu) + "*"
Write-Host Download ODBC from $link -ForegroundColor Cyan