diff options
Diffstat (limited to 'src/test')
3 files changed, 47 insertions, 0 deletions
diff --git a/src/test/burn/TestData/FilesInUseTests/WixStdBaBundle/WixStdBaBundle.wixproj b/src/test/burn/TestData/FilesInUseTests/WixStdBaBundle/WixStdBaBundle.wixproj new file mode 100644 index 00000000..e0860665 --- /dev/null +++ b/src/test/burn/TestData/FilesInUseTests/WixStdBaBundle/WixStdBaBundle.wixproj | |||
@@ -0,0 +1,17 @@ | |||
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 | <Project Sdk="WixToolset.Sdk"> | ||
3 | <PropertyGroup> | ||
4 | <OutputType>Bundle</OutputType> | ||
5 | <UpgradeCode>{6A348108-8ACE-4D13-A352-D8F76785BFE4}</UpgradeCode> | ||
6 | <DefineConstants>$(DefineConstants);BaseOutputPath=$(BaseOutputPath);Version=1.1</DefineConstants> | ||
7 | </PropertyGroup> | ||
8 | <ItemGroup> | ||
9 | <Compile Include="..\..\WixStdBaTests\BundleA\Bundle.wxs" Link="Bundle.wxs" /> | ||
10 | </ItemGroup> | ||
11 | <ItemGroup> | ||
12 | <ProjectReference Include="..\PackageA\PackageA.wixproj" /> | ||
13 | </ItemGroup> | ||
14 | <ItemGroup> | ||
15 | <PackageReference Include="WixToolset.Bal.wixext" /> | ||
16 | </ItemGroup> | ||
17 | </Project> \ No newline at end of file | ||
diff --git a/src/test/burn/TestData/FilesInUseTests/WixStdBaBundle/WixStdBaBundle.wxs b/src/test/burn/TestData/FilesInUseTests/WixStdBaBundle/WixStdBaBundle.wxs new file mode 100644 index 00000000..bd164a29 --- /dev/null +++ b/src/test/burn/TestData/FilesInUseTests/WixStdBaBundle/WixStdBaBundle.wxs | |||
@@ -0,0 +1,10 @@ | |||
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 | |||
3 | |||
4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
5 | <Fragment> | ||
6 | <PackageGroup Id="BundlePackages"> | ||
7 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" /> | ||
8 | </PackageGroup> | ||
9 | </Fragment> | ||
10 | </Wix> | ||
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/FilesInUseTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/FilesInUseTests.cs index 042175f0..12eca77d 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/FilesInUseTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/FilesInUseTests.cs | |||
@@ -33,5 +33,25 @@ namespace WixToolsetTest.BurnE2E | |||
33 | 33 | ||
34 | packageA.VerifyInstalled(false); | 34 | packageA.VerifyInstalled(false); |
35 | } | 35 | } |
36 | |||
37 | [RuntimeFact] | ||
38 | public void WixStdBAFailsWithLockedFile() | ||
39 | { | ||
40 | var packageA = this.CreatePackageInstaller("PackageA"); | ||
41 | var bundleA = this.CreateBundleInstaller("WixStdBaBundle"); | ||
42 | |||
43 | packageA.VerifyInstalled(false); | ||
44 | |||
45 | bundleA.Install(); | ||
46 | |||
47 | packageA.VerifyInstalled(true); | ||
48 | |||
49 | // Lock the file that will be uninstalled. | ||
50 | var targetInstallFile = packageA.GetInstalledFilePath("Package.wxs"); | ||
51 | using (var lockTargetFile = new FileStream(targetInstallFile, FileMode.Open, FileAccess.ReadWrite, FileShare.None)) | ||
52 | { | ||
53 | bundleA.Uninstall(expectedExitCode: (int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); | ||
54 | } | ||
55 | } | ||
36 | } | 56 | } |
37 | } | 57 | } |