aboutsummaryrefslogtreecommitdiff
path: root/src/test/burn/TestData
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2025-02-11 13:53:50 -0800
committerRob Mensching <rob@firegiant.com>2025-02-11 15:49:33 -0800
commit040e50ec2859c1de70cd8e9f957474321774f293 (patch)
treecebfe14eccdb3884d5eefc443b285917b6b4a38b /src/test/burn/TestData
parentccfed95b510f7cd1b205379d0cec50de69c2d850 (diff)
downloadwix-040e50ec2859c1de70cd8e9f957474321774f293.tar.gz
wix-040e50ec2859c1de70cd8e9f957474321774f293.tar.bz2
wix-040e50ec2859c1de70cd8e9f957474321774f293.zip
Rewrite Prereq tests after hardening and bypassing .NET GUI errors
Diffstat (limited to 'src/test/burn/TestData')
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleA/BundleA.wxs11
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleA/bad.runtimeconfig.json10
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleB/BundleB.wxs12
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wixproj2
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wxs10
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleC/bad.runtimeconfig.json10
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wixproj2
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wxs11
-rw-r--r--src/test/burn/TestData/PrereqBaTests/BundleE/BundleE.wxs4
-rw-r--r--src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp20
10 files changed, 32 insertions, 60 deletions
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleA/BundleA.wxs b/src/test/burn/TestData/PrereqBaTests/BundleA/BundleA.wxs
index a86f498f..5f0fefe5 100644
--- a/src/test/burn/TestData/PrereqBaTests/BundleA/BundleA.wxs
+++ b/src/test/burn/TestData/PrereqBaTests/BundleA/BundleA.wxs
@@ -1,13 +1,11 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> 3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
5 <Fragment> 4 <Fragment>
6 <BootstrapperApplication Id="BrokenDnc" SourceFile="!(bindpath.dncx86)\TestBA.exe" Secondary="yes"> 5 <BootstrapperApplication Id="BrokenDnc" SourceFile="!(bindpath.dncx86)\TestBA.exe">
7 <Payload SourceFile="!(bindpath.dncx86)\TestBA.deps.json" /> 6 <Payload SourceFile="!(bindpath.dncx86)\TestBA.deps.json" />
8 <Payload SourceFile="!(bindpath.dncx86)\TestBA.dll" /> 7 <Payload SourceFile="!(bindpath.dncx86)\TestBA.dll" />
9 <Payload Name="good.runtimeconfig.json" SourceFile="!(bindpath.dncx86)\TestBA.runtimeconfig.json" /> 8 <Payload Name="good.runtimeconfig.json" SourceFile="!(bindpath.dncx86)\TestBA.runtimeconfig.json" />
10 <Payload Name="TestBA.runtimeconfig.json" SourceFile="bad.runtimeconfig.json" />
11 <Payload SourceFile="!(bindpath.dncx86)\mbanative.dll" /> 9 <Payload SourceFile="!(bindpath.dncx86)\mbanative.dll" />
12 <Payload SourceFile="!(bindpath.dncx86)\WixToolset.BootstrapperApplicationApi.dll" /> 10 <Payload SourceFile="!(bindpath.dncx86)\WixToolset.BootstrapperApplicationApi.dll" />
13 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" /> 11 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" />
@@ -17,13 +15,12 @@
17 </Fragment> 15 </Fragment>
18 16
19 <Fragment> 17 <Fragment>
20 <util:FileSearch Variable="GoodConfigPresent" Path="[BARuntimeDirectory]\good.runtimeconfig.json" Result="exists" /> 18 <util:FileSearch Variable="TestBAConfigPresent" Path="[BARuntimeDirectory]\TestBA.runtimeconfig.json" Result="exists" />
21 <Variable Name="CAUSEINFINITELOOP" bal:Overridable="yes" />
22 19
23 <PackageGroup Id="BundlePackages"> 20 <PackageGroup Id="BundlePackages">
24 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes" 21 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes"
25 Permanent="yes" DetectCondition="NOT GoodConfigPresent OR CAUSEINFINITELOOP = 1" 22 Permanent="yes" DetectCondition="TestBAConfigPresent"
26 InstallArguments="&quot;[BARuntimeDirectory]TestBA.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]good.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]bad.runtimeconfig.json&quot;" /> 23 InstallArguments="&quot;[BARuntimeDirectory]\TestBA.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]\good.runtimeconfig.json&quot;" />
27 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" /> 24 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" />
28 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" Cache="force" /> 25 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" Cache="force" />
29 </PackageGroup> 26 </PackageGroup>
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleA/bad.runtimeconfig.json b/src/test/burn/TestData/PrereqBaTests/BundleA/bad.runtimeconfig.json
deleted file mode 100644
index 07a1a830..00000000
--- a/src/test/burn/TestData/PrereqBaTests/BundleA/bad.runtimeconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
1{
2 "runtimeOptions": {
3 "tfm": "net5.5",
4 "rollForward": "Disable",
5 "framework": {
6 "name": "Microsoft.WindowsDesktop.App",
7 "version": "5.5.0"
8 }
9 }
10} \ No newline at end of file
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleB/BundleB.wxs b/src/test/burn/TestData/PrereqBaTests/BundleB/BundleB.wxs
index 7a84bd5b..f5745d0f 100644
--- a/src/test/burn/TestData/PrereqBaTests/BundleB/BundleB.wxs
+++ b/src/test/burn/TestData/PrereqBaTests/BundleB/BundleB.wxs
@@ -1,12 +1,9 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> 3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
5 <Fragment> 4 <Fragment>
6 <BootstrapperApplication Id="BrokenMba" SourceFile="!(bindpath.net2x86)\TestBA.exe" 5 <BootstrapperApplication Id="BrokenMba" SourceFile="!(bindpath.net2x86)\TestBA.exe">
7 Secondary="yes">
8 <Payload Name="good.config" SourceFile="!(bindpath.net2x86)\TestBA.exe.config" /> 6 <Payload Name="good.config" SourceFile="!(bindpath.net2x86)\TestBA.exe.config" />
9 <Payload Name="TestBA.exe.config" SourceFile="bad.config" />
10 <Payload SourceFile="!(bindpath.net2x86)\mbanative.dll" /> 7 <Payload SourceFile="!(bindpath.net2x86)\mbanative.dll" />
11 <Payload SourceFile="!(bindpath.net2x86)\WixToolset.BootstrapperApplicationApi.dll" /> 8 <Payload SourceFile="!(bindpath.net2x86)\WixToolset.BootstrapperApplicationApi.dll" />
12 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" /> 9 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" />
@@ -16,13 +13,12 @@
16 </Fragment> 13 </Fragment>
17 14
18 <Fragment> 15 <Fragment>
19 <util:FileSearch Variable="GoodConfigPresent" Path="[BARuntimeDirectory]\good.config" Result="exists" /> 16 <util:FileSearch Variable="TestBAConfigPresent" Path="[BARuntimeDirectory]\TestBA.exe.config" Result="exists" />
20 <Variable Name="CAUSEINFINITELOOP" bal:Overridable="yes" />
21 17
22 <PackageGroup Id="BundlePackages"> 18 <PackageGroup Id="BundlePackages">
23 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes" 19 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes"
24 Permanent="yes" DetectCondition="NOT GoodConfigPresent OR CAUSEINFINITELOOP = 1" 20 Permanent="yes" DetectCondition="TestBAConfigPresent"
25 InstallArguments="&quot;[BARuntimeDirectory]TestBA.exe.config&quot; &quot;[BARuntimeDirectory]good.config&quot; &quot;[BARuntimeDirectory]bad.config&quot;" /> 21 InstallArguments="&quot;[BARuntimeDirectory]TestBA.exe.config&quot; &quot;[BARuntimeDirectory]good.config&quot;" />
26 <MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" /> 22 <MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" />
27 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" /> 23 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" />
28 </PackageGroup> 24 </PackageGroup>
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wixproj b/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wixproj
index 7ed34aa5..27b9c196 100644
--- a/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wixproj
+++ b/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wixproj
@@ -2,7 +2,7 @@
2<Project Sdk="WixToolset.Sdk"> 2<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup> 3 <PropertyGroup>
4 <OutputType>Bundle</OutputType> 4 <OutputType>Bundle</OutputType>
5 <BA>BrokenDncAlwaysPrereq</BA> 5 <BA>BrokenDncSecondary</BA>
6 <UpgradeCode>{D2763AB7-979B-485C-AE52-DD03C23CCB93}</UpgradeCode> 6 <UpgradeCode>{D2763AB7-979B-485C-AE52-DD03C23CCB93}</UpgradeCode>
7 </PropertyGroup> 7 </PropertyGroup>
8 <ItemGroup> 8 <ItemGroup>
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wxs b/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wxs
index e03cad62..12607cf0 100644
--- a/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wxs
+++ b/src/test/burn/TestData/PrereqBaTests/BundleC/BundleC.wxs
@@ -2,11 +2,10 @@
2 2
3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> 3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
4 <Fragment> 4 <Fragment>
5 <BootstrapperApplication Id="BrokenDncAlwaysPrereq" SourceFile="!(bindpath.dncx86)\TestBA.exe" Secondary="true"> 5 <BootstrapperApplication Id="BrokenDncSecondary" SourceFile="!(bindpath.dncx86)\TestBA.exe" Secondary="yes">
6 <Payload SourceFile="!(bindpath.dncx86)\TestBA.deps.json" /> 6 <Payload SourceFile="!(bindpath.dncx86)\TestBA.deps.json" />
7 <Payload SourceFile="!(bindpath.dncx86)\TestBA.dll" /> 7 <Payload SourceFile="!(bindpath.dncx86)\TestBA.dll" />
8 <Payload Name="good.runtimeconfig.json" SourceFile="!(bindpath.dncx86)\TestBA.runtimeconfig.json" /> 8 <Payload Name="good.runtimeconfig.json" SourceFile="!(bindpath.dncx86)\TestBA.runtimeconfig.json" />
9 <Payload Name="TestBA.runtimeconfig.json" SourceFile="bad.runtimeconfig.json" />
10 <Payload SourceFile="!(bindpath.dncx86)\mbanative.dll" /> 9 <Payload SourceFile="!(bindpath.dncx86)\mbanative.dll" />
11 <Payload SourceFile="!(bindpath.dncx86)\WixToolset.BootstrapperApplicationApi.dll" /> 10 <Payload SourceFile="!(bindpath.dncx86)\WixToolset.BootstrapperApplicationApi.dll" />
12 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" /> 11 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" />
@@ -16,13 +15,12 @@
16 </Fragment> 15 </Fragment>
17 16
18 <Fragment> 17 <Fragment>
19 <util:FileSearch Variable="GoodConfigPresent" Path="[BARuntimeDirectory]\good.runtimeconfig.json" Result="exists" /> 18 <util:FileSearch Variable="TestBAConfigPresent" Path="[BARuntimeDirectory]TestBA.runtimeconfig.json" Result="exists" />
20 <Variable Name="CAUSEINFINITELOOP" bal:Overridable="yes" />
21 19
22 <PackageGroup Id="BundlePackages"> 20 <PackageGroup Id="BundlePackages">
23 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes" 21 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes"
24 Permanent="yes" DetectCondition="NOT GoodConfigPresent OR CAUSEINFINITELOOP = 1" 22 Permanent="yes" DetectCondition="TestBAConfigPresent"
25 InstallArguments="&quot;[BARuntimeDirectory]TestBA.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]good.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]bad.runtimeconfig.json&quot;" /> 23 InstallArguments="&quot;[BARuntimeDirectory]TestBA.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]good.runtimeconfig.json&quot;" />
26 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" /> 24 <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" />
27 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" Cache="force" /> 25 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" Cache="force" />
28 </PackageGroup> 26 </PackageGroup>
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleC/bad.runtimeconfig.json b/src/test/burn/TestData/PrereqBaTests/BundleC/bad.runtimeconfig.json
deleted file mode 100644
index 07a1a830..00000000
--- a/src/test/burn/TestData/PrereqBaTests/BundleC/bad.runtimeconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
1{
2 "runtimeOptions": {
3 "tfm": "net5.5",
4 "rollForward": "Disable",
5 "framework": {
6 "name": "Microsoft.WindowsDesktop.App",
7 "version": "5.5.0"
8 }
9 }
10} \ No newline at end of file
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wixproj b/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wixproj
index 280193df..1888bc7d 100644
--- a/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wixproj
+++ b/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wixproj
@@ -2,7 +2,7 @@
2<Project Sdk="WixToolset.Sdk"> 2<Project Sdk="WixToolset.Sdk">
3 <PropertyGroup> 3 <PropertyGroup>
4 <OutputType>Bundle</OutputType> 4 <OutputType>Bundle</OutputType>
5 <BA>BrokenMbaAlwaysPrereq</BA> 5 <BA>BrokenMbaSecondary</BA>
6 <UpgradeCode>{415CA128-60E1-4D16-ACE8-A1D43E98B997}</UpgradeCode> 6 <UpgradeCode>{415CA128-60E1-4D16-ACE8-A1D43E98B997}</UpgradeCode>
7 </PropertyGroup> 7 </PropertyGroup>
8 <ItemGroup> 8 <ItemGroup>
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wxs b/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wxs
index 2eed4bd1..1b414cb2 100644
--- a/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wxs
+++ b/src/test/burn/TestData/PrereqBaTests/BundleD/BundleD.wxs
@@ -1,11 +1,9 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> 3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
5 <Fragment> 4 <Fragment>
6 <BootstrapperApplication Id="BrokenMbaAlwaysPrereq" SourceFile="!(bindpath.net2x86)\TestBA.exe" Secondary="true"> 5 <BootstrapperApplication Id="BrokenMbaSecondary" SourceFile="!(bindpath.net2x86)\TestBA.exe" Secondary="true">
7 <Payload Name="good.config" SourceFile="!(bindpath.net2x86)\TestBA.exe.config" /> 6 <Payload Name="good.config" SourceFile="!(bindpath.net2x86)\TestBA.exe.config" />
8 <Payload Name="TestBA.exe.config" SourceFile="bad.config" />
9 <Payload SourceFile="!(bindpath.net2x86)\mbanative.dll" /> 7 <Payload SourceFile="!(bindpath.net2x86)\mbanative.dll" />
10 <Payload SourceFile="!(bindpath.net2x86)\WixToolset.BootstrapperApplicationApi.dll" /> 8 <Payload SourceFile="!(bindpath.net2x86)\WixToolset.BootstrapperApplicationApi.dll" />
11 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" /> 9 <Payload SourceFile="$(var.PrereqBaf.TargetPath)" bal:BAFunctions="yes" />
@@ -15,13 +13,12 @@
15 </Fragment> 13 </Fragment>
16 14
17 <Fragment> 15 <Fragment>
18 <util:FileSearch Variable="GoodConfigPresent" Path="[BARuntimeDirectory]\good.config" Result="exists" /> 16 <util:FileSearch Variable="TestBAConfigPresent" Path="[BARuntimeDirectory]\TestBA.exe.config" Result="exists" />
19 <Variable Name="CAUSEINFINITELOOP" bal:Overridable="yes" />
20 17
21 <PackageGroup Id="BundlePackages"> 18 <PackageGroup Id="BundlePackages">
22 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes" 19 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes"
23 Permanent="yes" DetectCondition="NOT GoodConfigPresent OR CAUSEINFINITELOOP = 1" 20 Permanent="yes" DetectCondition="TestBAConfigPresent"
24 InstallArguments="&quot;[BARuntimeDirectory]TestBA.exe.config&quot; &quot;[BARuntimeDirectory]good.config&quot; &quot;[BARuntimeDirectory]bad.config&quot;" /> 21 InstallArguments="&quot;[BARuntimeDirectory]TestBA.exe.config&quot; &quot;[BARuntimeDirectory]good.config&quot;" />
25 <MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" /> 22 <MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" bal:PrereqPackage="yes" Permanent="yes" />
26 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" /> 23 <MsiPackage Id="PackageC" SourceFile="$(var.PackageC.TargetPath)" />
27 </PackageGroup> 24 </PackageGroup>
diff --git a/src/test/burn/TestData/PrereqBaTests/BundleE/BundleE.wxs b/src/test/burn/TestData/PrereqBaTests/BundleE/BundleE.wxs
index b6962b65..b994847e 100644
--- a/src/test/burn/TestData/PrereqBaTests/BundleE/BundleE.wxs
+++ b/src/test/burn/TestData/PrereqBaTests/BundleE/BundleE.wxs
@@ -14,11 +14,11 @@
14 </Fragment> 14 </Fragment>
15 15
16 <Fragment> 16 <Fragment>
17 <util:FileSearch Variable="GoodConfigPresent" Path="[BARuntimeDirectory]\good.runtimeconfig.json" Result="exists" /> 17 <util:FileSearch Variable="TestBAConfigPresent" Path="[BARuntimeDirectory]\good.runtimeconfig.json" Result="exists" />
18 18
19 <PackageGroup Id="BundlePackages"> 19 <PackageGroup Id="BundlePackages">
20 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes" 20 <ExePackage SourceFile="$(var.ReplaceConfig.TargetPath)" bal:PrereqPackage="yes"
21 Permanent="yes" DetectCondition="NOT GoodConfigPresent" 21 Permanent="yes" DetectCondition="NOT TestBAConfigPresent"
22 InstallArguments="&quot;[BARuntimeDirectory]TestBA.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]good.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]bad.runtimeconfig.json&quot;" /> 22 InstallArguments="&quot;[BARuntimeDirectory]TestBA.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]good.runtimeconfig.json&quot; &quot;[BARuntimeDirectory]bad.runtimeconfig.json&quot;" />
23 </PackageGroup> 23 </PackageGroup>
24 </Fragment> 24 </Fragment>
diff --git a/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp b/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp
index 1fa71bc2..b8172e6b 100644
--- a/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp
+++ b/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp
@@ -7,27 +7,31 @@ int __cdecl wmain(
7 __in LPWSTR argv[] 7 __in LPWSTR argv[]
8 ) 8 )
9{ 9{
10 DWORD er = ERROR_SUCCESS;
10 HRESULT hr = S_OK; 11 HRESULT hr = S_OK;
11 DWORD dwExitCode = 0;
12 LPCWSTR wzDestinationFile = argc > 1 ? argv[1] : NULL; 12 LPCWSTR wzDestinationFile = argc > 1 ? argv[1] : NULL;
13 LPCWSTR wzGoodFile = argc > 2 ? argv[2] : NULL; 13 LPCWSTR wzGoodFile = argc > 2 ? argv[2] : NULL;
14 LPCWSTR wzBadFile = argc > 3 ? argv[3] : NULL; 14 LPCWSTR wzBackupFile = argc > 3 ? argv[3] : NULL;
15 15
16 if (argc != 4) 16 if (!wzDestinationFile || !*wzDestinationFile || !wzGoodFile || !*wzGoodFile)
17 { 17 {
18 ExitWithRootFailure(hr, E_INVALIDARG, "Invalid args"); 18 ExitWithRootFailure(hr, E_INVALIDARG, "Invalid args");
19 } 19 }
20 20
21 if (!::MoveFileW(wzDestinationFile, wzBadFile)) 21 if (wzBackupFile && *wzBackupFile && !::CopyFileW(wzDestinationFile, wzBackupFile, FALSE))
22 { 22 {
23 ExitWithLastError(hr, "Failed to move bad file"); 23 er = ::GetLastError();
24 if (ERROR_PATH_NOT_FOUND != er && ERROR_FILE_NOT_FOUND != er)
25 {
26 ExitOnWin32Error(er, hr, "Failed to copy to backup file");
27 }
24 } 28 }
25 29
26 if (!::MoveFileW(wzGoodFile, wzDestinationFile)) 30 if (!::CopyFileW(wzGoodFile, wzDestinationFile, FALSE))
27 { 31 {
28 ExitWithLastError(hr, "Failed to move good file"); 32 ExitWithLastError(hr, "Failed to copy in good file");
29 } 33 }
30 34
31LExit: 35LExit:
32 return FAILED(hr) ? (int)hr : (int)dwExitCode; 36 return FAILED(hr) ? (int)hr : (int)0;
33} 37}