-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path03-Install-BizTalk.ps1
61 lines (38 loc) · 1.78 KB
/
03-Install-BizTalk.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#Requires -RunAsAdministrator
################################################################
function Install-BizTalk ($mediaLib, $fullPathToConfig, $logFullname)
{
$fullPathToBTS = "$mediaLib\BizTalk Server\setup.exe"
if ((Test-Path -Path $fullPathToBTS) -eq $false )
{
Log-SetupStep -message "Did not find $fullPathToBTS. Exit!" -level Error
Exit
}
if ((Test-Path -Path $fullPathToConfig) -eq $false )
{
Log-SetupStep -message "Did not find $fullPathToConfig. Exit!" -level Error
Exit
}
Log-SetupStep -message "Installing BizTalk '$fullPathToBTS'"
Start-Process -FilePath $fullPathToBTS -ArgumentList "/S $fullPathToConfig /norestart /l $logFullname /companyname CONTOSO /username CONTOSO" -Wait
# Get the updated Env variables to check that setup did not rollback
$updatedEnv = [Environment]::GetEnvironmentVariables("Machine")
if ($updatedEnv.ContainsKey("BTSINSTALLPATH"))
{
Log-SetupStep -message "Installation av BizTalk Binaries Done" -level Information
}
else
{
Log-SetupStep -message "Installation av BizTalk Binaries Failed, review '$logFullname' for details." -level Error
}
}
################################################################
# Maincode
################################################################
$scriptfolder = [System.IO.Path]::GetDirectoryName( $MyInvocation.InvocationName)
Set-Location $scriptfolder
Import-Module "$scriptfolder\BtsSetupHelper.psm1" -Global -DisableNameChecking
Check-64Bit
$timestamp = [System.DateTime]::Now.ToString("yyyyMMdd_HHmmss")
$btsMedia = "D:\"
Install-BizTalk -mediaLib $btsMedia -fullPathToConfig "$scriptfolder\Config\Features.xml" -logFullname "$scriptfolder\Install-BizTalk_$timestamp.log"