Skip to content

Commit b72b42b

Browse files
committed
[Unattended answer file] Fix addition problems with copy operation
1 parent eaa88bd commit b72b42b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Panels/DoWork/ProgressPanel.vb

+8-6
Original file line numberDiff line numberDiff line change
@@ -5493,15 +5493,17 @@ Public Class ProgressPanel
54935493
"- Unattended answer file: " & UnattendedFile)
54945494
Try
54955495
DynaLog.LogMessage("Copying unattended answer file to the Panther directory of the Windows image...")
5496-
If Not Directory.Exists(Path.Combine(targetImage, "Windows", "Panther")) Then
5497-
Directory.CreateDirectory(Path.Combine(targetImage, "Windows", "Panther"))
5496+
If Not Directory.Exists(Path.Combine(MountDir, "Windows", "Panther")) Then
5497+
Directory.CreateDirectory(Path.Combine(MountDir, "Windows", "Panther"))
54985498
End If
5499-
File.Copy(UnattendedFile, Path.Combine(targetImage, "Windows", "Panther", "unattend.xml"))
5499+
File.Copy(UnattendedFile, Path.Combine(MountDir, "Windows", "Panther", "unattend.xml"), True)
55005500
DynaLog.LogMessage("Copying unattended answer file to the System32 directory of the Windows image...")
5501-
If Not Directory.Exists(Path.Combine(targetImage, "Windows", "system32", "Sysprep")) Then
5502-
Directory.CreateDirectory(Path.Combine(targetImage, "Windows", "system32", "Sysprep"))
5501+
If Not Directory.Exists(Path.Combine(MountDir, "Windows", "system32", "Sysprep")) Then
5502+
Directory.CreateDirectory(Path.Combine(MountDir, "Windows", "system32", "Sysprep"))
55035503
End If
5504-
File.Copy(UnattendedFile, Path.Combine(targetImage, "Windows", "system32", "sysprep", "unattend.xml"))
5504+
File.Copy(UnattendedFile, Path.Combine(MountDir, "Windows", "system32", "sysprep", "unattend.xml"), True)
5505+
GetErrorCode(True)
5506+
Exit Sub
55055507
Catch ex As Exception
55065508
DynaLog.LogMessage("Could not copy unattended answer file to targets. Error message: " & ex.Message)
55075509
CommandArgs &= If(OnlineMgmt, " /online", " /image=" & targetImage) & " /apply-unattend=" & Quote & UnattendedFile & Quote

0 commit comments

Comments
 (0)