Skip to content

Commit 2f67d4b

Browse files
authored
Only copy t2embed.dll if it doesn't already exist (#596)
I have run into a situation, where t2embed.dll already was in place causing the navinstall to fail, this PR ensures that the file is only copied if it doesn't already exist.
1 parent 6eecffa commit 2f67d4b

14 files changed

Lines changed: 43 additions & 14 deletions

File tree

generic/Run/100/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ Copy-Item -Path (Join-Path $roleTailoredClientFolder "*office*.dll") -Destinatio
7979
# Due to dependencies from finsql.exe, we have to copy hlink.dll and ReportBuilder in place inside the container
8080
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $roleTailoredClientFolder 'hlink.dll')
8181
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $serviceTierFolder 'hlink.dll')
82-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
82+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
83+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
84+
}
8385

8486
$reportBuilderPath = "C:\Program Files (x86)\ReportBuilder"
8587
$reportBuilderSrc = Join-Path $runPath 'Install\ReportBuilder'

generic/Run/110/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ Copy-Item -Path (Join-Path $roleTailoredClientFolder "*office*.dll") -Destinatio
9999
# Due to dependencies from finsql.exe, we have to copy hlink.dll and ReportBuilder in place inside the container
100100
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $roleTailoredClientFolder 'hlink.dll')
101101
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $serviceTierFolder 'hlink.dll')
102-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
102+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
103+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
104+
}
103105
Copy-Item -Path (Join-Path $runPath 'Install\Microsoft.IdentityModel.dll') -Destination (Join-Path $serviceTierFolder 'Microsoft.IdentityModel.dll')
104106

105107
$reportBuilderPath = "C:\Program Files (x86)\ReportBuilder"

generic/Run/130/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ Copy-Item -Path (Join-Path $roleTailoredClientFolder "*office*.dll") -Destinatio
102102
# Due to dependencies from finsql.exe, we have to copy hlink.dll and ReportBuilder in place inside the container
103103
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $roleTailoredClientFolder 'hlink.dll')
104104
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $serviceTierFolder 'hlink.dll')
105-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
105+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
106+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
107+
}
106108
Copy-Item -Path (Join-Path $runPath 'Install\Microsoft.IdentityModel.dll') -Destination (Join-Path $serviceTierFolder 'Microsoft.IdentityModel.dll')
107109

108110
$reportBuilderPath = "C:\Program Files (x86)\ReportBuilder"

generic/Run/150-new/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ Write-Host "Copying dependencies"
164164
$serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Service").FullName
165165
# Due to dependencies from finsql.exe, we have to copy hlink.dll and ReportBuilder in place inside the container
166166
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $serviceTierFolder 'hlink.dll')
167-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
167+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
168+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
169+
}
168170
Copy-Item -Path (Join-Path $runPath 'Install\Microsoft.IdentityModel.dll') -Destination (Join-Path $serviceTierFolder 'Microsoft.IdentityModel.dll')
169171

170172
Write-Host "Copying ReportBuilder"

generic/Run/150/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ $serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Servic
105105

106106
# Due to dependencies from finsql.exe, we have to copy hlink.dll and ReportBuilder in place inside the container
107107
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $serviceTierFolder 'hlink.dll')
108-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
108+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
109+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
110+
}
109111
Copy-Item -Path (Join-Path $runPath 'Install\Microsoft.IdentityModel.dll') -Destination (Join-Path $serviceTierFolder 'Microsoft.IdentityModel.dll')
110112

111113
$reportBuilderPath = "C:\Program Files (x86)\ReportBuilder"

generic/Run/210-new/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ Write-Host "Copying dependencies"
164164
$serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Service").FullName
165165
# Due to dependencies from finsql.exe, we have to copy hlink.dll and ReportBuilder in place inside the container
166166
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $serviceTierFolder 'hlink.dll')
167-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
167+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
168+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
169+
}
168170
Copy-Item -Path (Join-Path $runPath 'Install\Microsoft.IdentityModel.dll') -Destination (Join-Path $serviceTierFolder 'Microsoft.IdentityModel.dll')
169171

170172
Write-Host "Copying ReportBuilder"

generic/Run/210/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ $serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Servic
105105

106106
# Due to dependencies from finsql.exe, we have to copy hlink.dll and ReportBuilder in place inside the container
107107
Copy-Item -Path (Join-Path $runPath 'Install\hlink.dll') -Destination (Join-Path $serviceTierFolder 'hlink.dll')
108-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
108+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
109+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
110+
}
109111
Copy-Item -Path (Join-Path $runPath 'Install\Microsoft.IdentityModel.dll') -Destination (Join-Path $serviceTierFolder 'Microsoft.IdentityModel.dll')
110112

111113
$reportBuilderPath = "C:\Program Files (x86)\ReportBuilder"

generic/Run/240/navinstall.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ if ($installersFolder) {
155155

156156
Write-Host "Copying dependencies"
157157
$serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Service").FullName
158-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
158+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
159+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
160+
}
159161

160162
Write-Host "Importing PowerShell Modules"
161163
try {
@@ -372,3 +374,4 @@ if (!$skipDb -and ($multitenant -or $installOnly -or $licenseFilePath -ne "" -or
372374
$timespend = [Math]::Round([DateTime]::Now.Subtract($startTime).Totalseconds)
373375
Write-Host "Installation took $timespend seconds"
374376
Write-Host "Installation complete"
377+

generic/Run/260/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ if ($installersFolder) {
155155

156156
Write-Host "Copying dependencies"
157157
$serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Service").FullName
158-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
158+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
159+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
160+
}
159161

160162
Write-Host "Importing PowerShell Modules"
161163
try {

generic/Run/270/navinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ if ($installersFolder) {
161161

162162
Write-Host "Copying dependencies"
163163
$serviceTierFolder = (Get-Item "C:\Program Files\Microsoft Dynamics NAV\*\Service").FullName
164-
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
164+
if (!(Test-Path "c:\windows\system32\t2embed.dll")) {
165+
Copy-Item -Path (Join-Path $runPath 'Install\t2embed.dll') -Destination "c:\windows\system32\t2embed.dll"
166+
}
165167

166168
Write-Host "Importing PowerShell Modules"
167169
try {

0 commit comments

Comments
 (0)