diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-05-13 15:39:40 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-05-14 11:12:31 -0500 |
| commit | d5985a1688bc878e42ffd3ce3939fa52303cab16 (patch) | |
| tree | 0c283fe5454659c569317b37840a040474cfa032 /src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp | |
| parent | 6a6974a15deb6edf593736cdb8043bfb93064782 (diff) | |
| download | wix-d5985a1688bc878e42ffd3ce3939fa52303cab16.tar.gz wix-d5985a1688bc878e42ffd3ce3939fa52303cab16.tar.bz2 wix-d5985a1688bc878e42ffd3ce3939fa52303cab16.zip | |
Add option to hosts to always install prereqs.
Add PrereqPackage to BundlePackage
Implements 4718
Diffstat (limited to 'src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp')
| -rw-r--r-- | src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp b/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp new file mode 100644 index 00000000..1fa71bc2 --- /dev/null +++ b/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp | |||
| @@ -0,0 +1,33 @@ | |||
| 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 | #include "precomp.h" | ||
| 4 | |||
| 5 | int __cdecl wmain( | ||
| 6 | __in int argc, | ||
| 7 | __in LPWSTR argv[] | ||
| 8 | ) | ||
| 9 | { | ||
| 10 | HRESULT hr = S_OK; | ||
| 11 | DWORD dwExitCode = 0; | ||
| 12 | LPCWSTR wzDestinationFile = argc > 1 ? argv[1] : NULL; | ||
| 13 | LPCWSTR wzGoodFile = argc > 2 ? argv[2] : NULL; | ||
| 14 | LPCWSTR wzBadFile = argc > 3 ? argv[3] : NULL; | ||
| 15 | |||
| 16 | if (argc != 4) | ||
| 17 | { | ||
| 18 | ExitWithRootFailure(hr, E_INVALIDARG, "Invalid args"); | ||
| 19 | } | ||
| 20 | |||
| 21 | if (!::MoveFileW(wzDestinationFile, wzBadFile)) | ||
| 22 | { | ||
| 23 | ExitWithLastError(hr, "Failed to move bad file"); | ||
| 24 | } | ||
| 25 | |||
| 26 | if (!::MoveFileW(wzGoodFile, wzDestinationFile)) | ||
| 27 | { | ||
| 28 | ExitWithLastError(hr, "Failed to move good file"); | ||
| 29 | } | ||
| 30 | |||
| 31 | LExit: | ||
| 32 | return FAILED(hr) ? (int)hr : (int)dwExitCode; | ||
| 33 | } | ||
