62 lines
1.8 KiB
PowerShell
62 lines
1.8 KiB
PowerShell
<#
|
|
Module: di-c4dw-install
|
|
Author: Vincenzo Esposito
|
|
Modified by: -
|
|
Modification History:
|
|
- First release 04/05/2020
|
|
last updated: 21/04/2020
|
|
Intent: Install the selected version of Attunity Replicate
|
|
#>
|
|
|
|
Param(
|
|
[string] $url,
|
|
[string] $version = "gen2"
|
|
)
|
|
|
|
Import-Module $PSScriptRoot\q-helper.psm1 | Out-Null
|
|
|
|
$fileName = $url.Substring($url.LastIndexOf("/") + 1)
|
|
|
|
$bin = "$PSScriptRoot\binaries\Attunity"
|
|
Write-Host "Binary Path $($bin)"
|
|
Write-Host "Starting di-c4dw-install.ps1"
|
|
$issFile = "Compose_install.iss"
|
|
|
|
if ( $version -ne "gen2" ) {
|
|
$issFile = "Compose_install_$version.iss"
|
|
}
|
|
|
|
|
|
Write-Host $bin\$fileName
|
|
|
|
If ((Test-Path $bin\$fileName))
|
|
{
|
|
Write-Host "Installing Attunity Compose from $($bin)\$($fileName)"
|
|
|
|
$fileNoExtension = [IO.Path]::GetFileNameWithoutExtension("$bin\$fileName")
|
|
Expand-Archive $bin\$fileName -DestinationPath $bin\$fileNoExtension -Force
|
|
|
|
#Write-Host "Binary decompressed in folder $($bin)\$($fileNoExtension)"
|
|
$exec = Get-ChildItem $bin\$fileNoExtension\*.exe | Select-Object -ExpandProperty Name
|
|
#Write-Host "Exec: $($exec)"
|
|
|
|
$C4DWInstall = "$($bin)\$($fileNoExtension)\$($exec) /s /f1$($PSScriptRoot)\$($issFile) /f2$($bin)\Compose_silent_x64_install.log"
|
|
|
|
Write-Host "Run Compose silent installation : $($C4DWInstall)"
|
|
Invoke-Expression $C4DWInstall
|
|
while (!(Test-Path "$($bin)\Compose_silent_x64_install.log")) {
|
|
Write-Host "[Waiting Compose to be installed] ..."
|
|
Start-Sleep 2
|
|
}
|
|
$C4DWResults = Get-IniFile "$($bin)\Compose_silent_x64_install.log"
|
|
$testResult = $C4DWResults.ResponseResult.ResultCode
|
|
Write-Host "Installation return code : $($testResult)"
|
|
|
|
}
|
|
else
|
|
{
|
|
Write-Host "No Binary found: $($bin)\$($fileName)"
|
|
}
|
|
|
|
|