diff options
Diffstat (limited to 'src/ext/Bal')
18 files changed, 264 insertions, 39 deletions
diff --git a/src/ext/Bal/stdbas/WixInternalUIBootstrapperApplication.cpp b/src/ext/Bal/stdbas/WixInternalUIBootstrapperApplication.cpp index 270ce40c..bae098d4 100644 --- a/src/ext/Bal/stdbas/WixInternalUIBootstrapperApplication.cpp +++ b/src/ext/Bal/stdbas/WixInternalUIBootstrapperApplication.cpp | |||
| @@ -557,14 +557,19 @@ private: | |||
| 557 | HRESULT CreateMainWindow() | 557 | HRESULT CreateMainWindow() |
| 558 | { | 558 | { |
| 559 | HRESULT hr = S_OK; | 559 | HRESULT hr = S_OK; |
| 560 | WNDCLASSW wc = { }; | 560 | WNDCLASSEXW wc = { }; |
| 561 | DWORD dwWindowStyle = WS_POPUP; | 561 | DWORD dwWindowStyle = WS_POPUP; |
| 562 | 562 | ||
| 563 | LoadBundleIcon(m_hModule, &m_hIcon, &m_hSmallIcon); | ||
| 564 | |||
| 565 | wc.cbSize = sizeof(WNDCLASSEXW); | ||
| 563 | wc.lpfnWndProc = CWixInternalUIBootstrapperApplication::WndProc; | 566 | wc.lpfnWndProc = CWixInternalUIBootstrapperApplication::WndProc; |
| 564 | wc.hInstance = m_hModule; | 567 | wc.hInstance = m_hModule; |
| 565 | wc.lpszClassName = WIXIUIBA_WINDOW_CLASS; | 568 | wc.lpszClassName = WIXIUIBA_WINDOW_CLASS; |
| 569 | wc.hIcon = m_hIcon; | ||
| 570 | wc.hIconSm = m_hSmallIcon; | ||
| 566 | 571 | ||
| 567 | if (!::RegisterClassW(&wc)) | 572 | if (!::RegisterClassExW(&wc)) |
| 568 | { | 573 | { |
| 569 | ExitWithLastError(hr, "Failed to register window."); | 574 | ExitWithLastError(hr, "Failed to register window."); |
| 570 | } | 575 | } |
| @@ -601,6 +606,18 @@ private: | |||
| 601 | ::UnregisterClassW(WIXIUIBA_WINDOW_CLASS, m_hModule); | 606 | ::UnregisterClassW(WIXIUIBA_WINDOW_CLASS, m_hModule); |
| 602 | m_fRegistered = FALSE; | 607 | m_fRegistered = FALSE; |
| 603 | } | 608 | } |
| 609 | |||
| 610 | if (m_hIcon) | ||
| 611 | { | ||
| 612 | ::DestroyIcon(m_hIcon); | ||
| 613 | m_hIcon = NULL; | ||
| 614 | } | ||
| 615 | |||
| 616 | if (m_hSmallIcon) | ||
| 617 | { | ||
| 618 | ::DestroyIcon(m_hSmallIcon); | ||
| 619 | m_hSmallIcon = NULL; | ||
| 620 | } | ||
| 604 | } | 621 | } |
| 605 | 622 | ||
| 606 | // | 623 | // |
| @@ -807,6 +824,8 @@ public: | |||
| 807 | m_sczFailedMessage = NULL; | 824 | m_sczFailedMessage = NULL; |
| 808 | 825 | ||
| 809 | m_hUiThread = NULL; | 826 | m_hUiThread = NULL; |
| 827 | m_hIcon = NULL; | ||
| 828 | m_hSmallIcon = NULL; | ||
| 810 | m_fRegistered = FALSE; | 829 | m_fRegistered = FALSE; |
| 811 | m_hWnd = NULL; | 830 | m_hWnd = NULL; |
| 812 | 831 | ||
| @@ -847,6 +866,8 @@ private: | |||
| 847 | LPWSTR m_sczConfirmCloseMessage; | 866 | LPWSTR m_sczConfirmCloseMessage; |
| 848 | 867 | ||
| 849 | HANDLE m_hUiThread; | 868 | HANDLE m_hUiThread; |
| 869 | HICON m_hIcon; | ||
| 870 | HICON m_hSmallIcon; | ||
| 850 | BOOL m_fRegistered; | 871 | BOOL m_fRegistered; |
| 851 | HWND m_hWnd; | 872 | HWND m_hWnd; |
| 852 | 873 | ||
diff --git a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp index 6cfe0b4c..c1e8b2b3 100644 --- a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp | |||
| @@ -1231,34 +1231,52 @@ public: // IBootstrapperApplication | |||
| 1231 | __inout int* pResult | 1231 | __inout int* pResult |
| 1232 | ) | 1232 | ) |
| 1233 | { | 1233 | { |
| 1234 | HRESULT hr = S_OK; | ||
| 1235 | BAL_INFO_PACKAGE* pPackage = NULL; | ||
| 1236 | BOOL fShowFilesInUseDialog = TRUE; | ||
| 1234 | 1237 | ||
| 1235 | if (!m_fShowingInternalUiThisPackage && wzPackageId && *wzPackageId) | 1238 | if (!m_fShowingInternalUiThisPackage && wzPackageId && *wzPackageId) |
| 1236 | { | 1239 | { |
| 1237 | BalLog(BOOTSTRAPPER_LOG_LEVEL_VERBOSE, "Package %ls has %d applications holding files in use.", wzPackageId, cFiles); | 1240 | BalLog(BOOTSTRAPPER_LOG_LEVEL_VERBOSE, "Package %ls has %d applications holding files in use.", wzPackageId, cFiles); |
| 1238 | 1241 | ||
| 1239 | switch (source) | 1242 | hr = BalInfoFindPackageById(&m_Bundle.packages, wzPackageId, &pPackage); |
| 1243 | if (SUCCEEDED(hr) && pPackage->sczDisplayFilesInUseDialogCondition) | ||
| 1240 | { | 1244 | { |
| 1241 | case BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI: | 1245 | hr = BalEvaluateCondition(pPackage->sczDisplayFilesInUseDialogCondition, &fShowFilesInUseDialog); |
| 1242 | if (m_fShowStandardFilesInUse) | 1246 | BalExitOnFailure(hr, "Failed to evaluate condition for package '%ls': %ls", wzPackageId, pPackage->sczDisplayFilesInUseDialogCondition); |
| 1243 | { | 1247 | } |
| 1244 | return ShowMsiFilesInUse(cFiles, rgwzFiles, source, pResult); | 1248 | |
| 1245 | } | 1249 | if (fShowFilesInUseDialog) |
| 1246 | break; | 1250 | { |
| 1247 | case BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI_RM: | 1251 | switch (source) |
| 1248 | if (m_fShowRMFilesInUse) | ||
| 1249 | { | ||
| 1250 | return ShowMsiFilesInUse(cFiles, rgwzFiles, source, pResult); | ||
| 1251 | } | ||
| 1252 | break; | ||
| 1253 | case BOOTSTRAPPER_FILES_IN_USE_TYPE_NETFX: | ||
| 1254 | if (m_fShowNetfxFilesInUse) | ||
| 1255 | { | 1252 | { |
| 1256 | return ShowNetfxFilesInUse(cFiles, rgwzFiles, pResult); | 1253 | case BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI: |
| 1254 | if (m_fShowStandardFilesInUse) | ||
| 1255 | { | ||
| 1256 | return ShowMsiFilesInUse(cFiles, rgwzFiles, source, pResult); | ||
| 1257 | } | ||
| 1258 | break; | ||
| 1259 | case BOOTSTRAPPER_FILES_IN_USE_TYPE_MSI_RM: | ||
| 1260 | if (m_fShowRMFilesInUse) | ||
| 1261 | { | ||
| 1262 | return ShowMsiFilesInUse(cFiles, rgwzFiles, source, pResult); | ||
| 1263 | } | ||
| 1264 | break; | ||
| 1265 | case BOOTSTRAPPER_FILES_IN_USE_TYPE_NETFX: | ||
| 1266 | if (m_fShowNetfxFilesInUse) | ||
| 1267 | { | ||
| 1268 | return ShowNetfxFilesInUse(cFiles, rgwzFiles, pResult); | ||
| 1269 | } | ||
| 1270 | break; | ||
| 1257 | } | 1271 | } |
| 1258 | break; | 1272 | } |
| 1273 | else | ||
| 1274 | { | ||
| 1275 | *pResult = IDIGNORE; | ||
| 1259 | } | 1276 | } |
| 1260 | } | 1277 | } |
| 1261 | 1278 | ||
| 1279 | LExit: | ||
| 1262 | return __super::OnExecuteFilesInUse(wzPackageId, cFiles, rgwzFiles, nRecommendation, source, pResult); | 1280 | return __super::OnExecuteFilesInUse(wzPackageId, cFiles, rgwzFiles, nRecommendation, source, pResult); |
| 1263 | } | 1281 | } |
| 1264 | 1282 | ||
| @@ -3283,26 +3301,24 @@ private: | |||
| 3283 | HRESULT CreateMainWindow() | 3301 | HRESULT CreateMainWindow() |
| 3284 | { | 3302 | { |
| 3285 | HRESULT hr = S_OK; | 3303 | HRESULT hr = S_OK; |
| 3286 | WNDCLASSW wc = { }; | 3304 | WNDCLASSEXW wc = { sizeof(WNDCLASSEXW)}; |
| 3287 | DWORD dwWindowStyle = 0; | 3305 | DWORD dwWindowStyle = 0; |
| 3288 | int x = CW_USEDEFAULT; | 3306 | int x = CW_USEDEFAULT; |
| 3289 | int y = CW_USEDEFAULT; | 3307 | int y = CW_USEDEFAULT; |
| 3290 | POINT ptCursor = { }; | 3308 | POINT ptCursor = { }; |
| 3291 | 3309 | ||
| 3292 | ThemeInitializeWindowClass(m_pTheme, &wc, CWixStandardBootstrapperApplication::WndProc, m_hModule, WIXSTDBA_WINDOW_CLASS); | 3310 | ThemeInitializeWindowClassEx(m_pTheme, &wc, CWixStandardBootstrapperApplication::WndProc, m_hModule, WIXSTDBA_WINDOW_CLASS); |
| 3293 | 3311 | ||
| 3294 | // If the theme did not provide an icon, try using the icon from the bundle engine. | 3312 | // If the theme did not provide an icon, try using the icon from the bundle then fallback to the bundle engine. |
| 3295 | if (!wc.hIcon) | 3313 | if (!wc.hIcon) |
| 3296 | { | 3314 | { |
| 3297 | HMODULE hBootstrapperEngine = ::GetModuleHandleW(NULL); | 3315 | LoadBundleIcon(m_hModule, &m_hIcon, &m_hSmallIcon); |
| 3298 | if (hBootstrapperEngine) | 3316 | wc.hIcon = m_hIcon; |
| 3299 | { | 3317 | wc.hIconSm = m_hSmallIcon; |
| 3300 | wc.hIcon = ::LoadIconW(hBootstrapperEngine, MAKEINTRESOURCEW(1)); | ||
| 3301 | } | ||
| 3302 | } | 3318 | } |
| 3303 | 3319 | ||
| 3304 | // Register the window class and create the window. | 3320 | // Register the window class and create the window. |
| 3305 | if (!::RegisterClassW(&wc)) | 3321 | if (!::RegisterClassExW(&wc)) |
| 3306 | { | 3322 | { |
| 3307 | ExitWithLastError(hr, "Failed to register window."); | 3323 | ExitWithLastError(hr, "Failed to register window."); |
| 3308 | } | 3324 | } |
| @@ -3340,7 +3356,6 @@ private: | |||
| 3340 | return hr; | 3356 | return hr; |
| 3341 | } | 3357 | } |
| 3342 | 3358 | ||
| 3343 | |||
| 3344 | // | 3359 | // |
| 3345 | // InitializeTaskbarButton - initializes taskbar button for progress. | 3360 | // InitializeTaskbarButton - initializes taskbar button for progress. |
| 3346 | // | 3361 | // |
| @@ -3379,6 +3394,18 @@ private: | |||
| 3379 | ::UnregisterClassW(WIXSTDBA_WINDOW_CLASS, m_hModule); | 3394 | ::UnregisterClassW(WIXSTDBA_WINDOW_CLASS, m_hModule); |
| 3380 | m_fRegistered = FALSE; | 3395 | m_fRegistered = FALSE; |
| 3381 | } | 3396 | } |
| 3397 | |||
| 3398 | if (m_hIcon) | ||
| 3399 | { | ||
| 3400 | ::DestroyIcon(m_hIcon); | ||
| 3401 | m_hIcon = NULL; | ||
| 3402 | } | ||
| 3403 | |||
| 3404 | if (m_hSmallIcon) | ||
| 3405 | { | ||
| 3406 | ::DestroyIcon(m_hSmallIcon); | ||
| 3407 | m_hSmallIcon = NULL; | ||
| 3408 | } | ||
| 3382 | } | 3409 | } |
| 3383 | 3410 | ||
| 3384 | 3411 | ||
| @@ -4804,6 +4831,8 @@ public: | |||
| 4804 | m_pTheme = NULL; | 4831 | m_pTheme = NULL; |
| 4805 | memset(m_rgdwPageIds, 0, sizeof(m_rgdwPageIds)); | 4832 | memset(m_rgdwPageIds, 0, sizeof(m_rgdwPageIds)); |
| 4806 | m_hUiThread = NULL; | 4833 | m_hUiThread = NULL; |
| 4834 | m_hIcon = NULL; | ||
| 4835 | m_hSmallIcon = NULL; | ||
| 4807 | m_fRegistered = FALSE; | 4836 | m_fRegistered = FALSE; |
| 4808 | m_hWnd = NULL; | 4837 | m_hWnd = NULL; |
| 4809 | 4838 | ||
| @@ -5092,6 +5121,8 @@ private: | |||
| 5092 | THEME_ASSIGN_CONTROL_ID m_rgInitControls[LAST_WIXSTDBA_CONTROL - WIXSTDBA_FIRST_ASSIGN_CONTROL_ID]; | 5121 | THEME_ASSIGN_CONTROL_ID m_rgInitControls[LAST_WIXSTDBA_CONTROL - WIXSTDBA_FIRST_ASSIGN_CONTROL_ID]; |
| 5093 | DWORD m_rgdwPageIds[countof(vrgwzPageNames)]; | 5122 | DWORD m_rgdwPageIds[countof(vrgwzPageNames)]; |
| 5094 | HANDLE m_hUiThread; | 5123 | HANDLE m_hUiThread; |
| 5124 | HICON m_hIcon; | ||
| 5125 | HICON m_hSmallIcon; | ||
| 5095 | BOOL m_fRegistered; | 5126 | BOOL m_fRegistered; |
| 5096 | HWND m_hWnd; | 5127 | HWND m_hWnd; |
| 5097 | 5128 | ||
diff --git a/src/ext/Bal/stdbas/precomp.h b/src/ext/Bal/stdbas/precomp.h index a6c4cfe4..0faf1548 100644 --- a/src/ext/Bal/stdbas/precomp.h +++ b/src/ext/Bal/stdbas/precomp.h | |||
| @@ -42,3 +42,9 @@ | |||
| 42 | 42 | ||
| 43 | #include "stdbas.messages.h" | 43 | #include "stdbas.messages.h" |
| 44 | #include "WixStandardBootstrapperApplication.h" | 44 | #include "WixStandardBootstrapperApplication.h" |
| 45 | |||
| 46 | HRESULT LoadBundleIcon( | ||
| 47 | __in HMODULE hModule, | ||
| 48 | __out HICON* phIcon, | ||
| 49 | __out HICON* phSmallIcon | ||
| 50 | ); | ||
diff --git a/src/ext/Bal/stdbas/stdbas.cpp b/src/ext/Bal/stdbas/stdbas.cpp new file mode 100644 index 00000000..909bdc23 --- /dev/null +++ b/src/ext/Bal/stdbas/stdbas.cpp | |||
| @@ -0,0 +1,50 @@ | |||
| 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 | static const LPCWSTR WIX_BUNDLE_ICON_FILENAME = L"WixBundle.ico"; | ||
| 6 | |||
| 7 | |||
| 8 | // | ||
| 9 | // LoadBundleIcon - loads the icon that was (optionally) authored in the bundle otherwise use the one embedded in the bootstrapper application. | ||
| 10 | // | ||
| 11 | HRESULT LoadBundleIcon( | ||
| 12 | __in HMODULE hModule, | ||
| 13 | __out HICON* phIcon, | ||
| 14 | __out HICON* phSmallIcon | ||
| 15 | ) | ||
| 16 | { | ||
| 17 | HRESULT hr = S_OK; | ||
| 18 | LPWSTR sczIconPath = NULL; | ||
| 19 | int nIconWidth = ::GetSystemMetrics(SM_CXICON); | ||
| 20 | int nIconHeight = ::GetSystemMetrics(SM_CYICON); | ||
| 21 | int nSmallIconWidth = ::GetSystemMetrics(SM_CXSMICON); | ||
| 22 | int nSmallIconHeight = ::GetSystemMetrics(SM_CYSMICON); | ||
| 23 | HICON hIcon = NULL; | ||
| 24 | HICON hSmallIcon = NULL; | ||
| 25 | |||
| 26 | // First look for the optional authored bundle icon. | ||
| 27 | hr = PathRelativeToModule(&sczIconPath, WIX_BUNDLE_ICON_FILENAME, hModule); | ||
| 28 | ExitOnFailure(hr, "Failed to get path to bundle icon: %ls", WIX_BUNDLE_ICON_FILENAME); | ||
| 29 | |||
| 30 | if (FileExistsEx(sczIconPath, NULL)) | ||
| 31 | { | ||
| 32 | hIcon = reinterpret_cast<HICON>(::LoadImageW(NULL, sczIconPath, IMAGE_ICON, nIconWidth, nIconHeight, LR_LOADFROMFILE)); | ||
| 33 | |||
| 34 | hSmallIcon = reinterpret_cast<HICON>(::LoadImageW(NULL, sczIconPath, IMAGE_ICON, nSmallIconWidth, nSmallIconHeight, LR_LOADFROMFILE)); | ||
| 35 | } | ||
| 36 | else // fallback to the first icon resource in the bootstrapper application. | ||
| 37 | { | ||
| 38 | hIcon = reinterpret_cast<HICON>(::LoadImageW(hModule, MAKEINTRESOURCEW(1), IMAGE_ICON, nIconWidth, nIconHeight, LR_DEFAULTCOLOR)); | ||
| 39 | |||
| 40 | hSmallIcon = reinterpret_cast<HICON>(::LoadImageW(hModule, MAKEINTRESOURCEW(1), IMAGE_ICON, nSmallIconWidth, nSmallIconHeight, LR_DEFAULTCOLOR)); | ||
| 41 | } | ||
| 42 | |||
| 43 | *phIcon = hIcon; | ||
| 44 | *phSmallIcon = hSmallIcon; | ||
| 45 | |||
| 46 | LExit: | ||
| 47 | ReleaseStr(sczIconPath); | ||
| 48 | |||
| 49 | return hr; | ||
| 50 | } | ||
diff --git a/src/ext/Bal/stdbas/stdbas.vcxproj b/src/ext/Bal/stdbas/stdbas.vcxproj index fb2b0682..ba990af7 100644 --- a/src/ext/Bal/stdbas/stdbas.vcxproj +++ b/src/ext/Bal/stdbas/stdbas.vcxproj | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | <ClCompile Include="precomp.cpp"> | 60 | <ClCompile Include="precomp.cpp"> |
| 61 | <PrecompiledHeader>Create</PrecompiledHeader> | 61 | <PrecompiledHeader>Create</PrecompiledHeader> |
| 62 | </ClCompile> | 62 | </ClCompile> |
| 63 | <ClCompile Include="stdbas.cpp" /> | ||
| 63 | <ClCompile Include="WixInternalUIBootstrapperApplication.cpp" /> | 64 | <ClCompile Include="WixInternalUIBootstrapperApplication.cpp" /> |
| 64 | <ClCompile Include="WixStandardBootstrapperApplication.cpp" /> | 65 | <ClCompile Include="WixStandardBootstrapperApplication.cpp" /> |
| 65 | </ItemGroup> | 66 | </ItemGroup> |
| @@ -80,4 +81,4 @@ rc.exe -fo "$(OutDir)stdbas.res" "$(IntDir)stdbas.messages.rc"</Command> | |||
| 80 | </ItemGroup> | 81 | </ItemGroup> |
| 81 | 82 | ||
| 82 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | 83 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
| 83 | </Project> | 84 | </Project> \ No newline at end of file |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs index 07d3dacb..e599b8e2 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/BalExtensionFixture.cs | |||
| @@ -24,7 +24,8 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 24 | { | 24 | { |
| 25 | var baseFolder = fs.GetFolder(); | 25 | var baseFolder = fs.GetFolder(); |
| 26 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | 26 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); |
| 27 | var bundleSourceFolder = TestData.Get(@"TestData\WixStdBa"); | 27 | var bundleSourceFolder = TestData.Get(@"TestData", "WixStdBa"); |
| 28 | var dataFolder = TestData.Get(@"TestData", ".Data"); | ||
| 28 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 29 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 29 | var baFolderPath = Path.Combine(baseFolder, "ba"); | 30 | var baFolderPath = Path.Combine(baseFolder, "ba"); |
| 30 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | 31 | var extractFolderPath = Path.Combine(baseFolder, "extract"); |
| @@ -36,6 +37,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 36 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | 37 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), |
| 37 | "-intermediateFolder", intermediateFolder, | 38 | "-intermediateFolder", intermediateFolder, |
| 38 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), | 39 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), |
| 40 | "-bindpath", dataFolder, | ||
| 39 | "-o", bundleFile, | 41 | "-o", bundleFile, |
| 40 | }); | 42 | }); |
| 41 | compileResult.AssertSuccess(); | 43 | compileResult.AssertSuccess(); |
| @@ -56,6 +58,46 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 56 | } | 58 | } |
| 57 | 59 | ||
| 58 | [TestMethod] | 60 | [TestMethod] |
| 61 | public void CanBuildUsingDisplayFilesInUseDialogCondition() | ||
| 62 | { | ||
| 63 | using (var fs = new DisposableFileSystem()) | ||
| 64 | { | ||
| 65 | var baseFolder = fs.GetFolder(); | ||
| 66 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | ||
| 67 | var bundleSourceFolder = TestData.Get(@"TestData", "WixStdBa"); | ||
| 68 | var dataFolder = TestData.Get(@"TestData", ".Data"); | ||
| 69 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 70 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
| 71 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
| 72 | |||
| 73 | var compileResult = WixRunner.Execute(new[] | ||
| 74 | { | ||
| 75 | "build", | ||
| 76 | Path.Combine(bundleSourceFolder, "DisplayFilesInUseDialogConditionBundle.wxs"), | ||
| 77 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | ||
| 78 | "-intermediateFolder", intermediateFolder, | ||
| 79 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), | ||
| 80 | "-bindpath", dataFolder, | ||
| 81 | "-o", bundleFile, | ||
| 82 | }); | ||
| 83 | compileResult.AssertSuccess(); | ||
| 84 | |||
| 85 | Assert.IsTrue(File.Exists(bundleFile)); | ||
| 86 | |||
| 87 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | ||
| 88 | extractResult.AssertSuccess(); | ||
| 89 | |||
| 90 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | ||
| 91 | WixAssert.CompareLineByLine(new string[] | ||
| 92 | { | ||
| 93 | "<WixBalPackageInfo PackageId='test.msi' DisplayFilesInUseDialogCondition='1' />", | ||
| 94 | }, balPackageInfos); | ||
| 95 | |||
| 96 | Assert.IsTrue(File.Exists(Path.Combine(baFolderPath, "thm.wxl"))); | ||
| 97 | } | ||
| 98 | } | ||
| 99 | |||
| 100 | [TestMethod] | ||
| 59 | public void CanBuildUsingBootstrapperApplicationId() | 101 | public void CanBuildUsingBootstrapperApplicationId() |
| 60 | { | 102 | { |
| 61 | using (var fs = new DisposableFileSystem()) | 103 | using (var fs = new DisposableFileSystem()) |
| @@ -63,6 +105,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 63 | var baseFolder = fs.GetFolder(); | 105 | var baseFolder = fs.GetFolder(); |
| 64 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | 106 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); |
| 65 | var bundleSourceFolder = TestData.Get("TestData", "WixStdBa"); | 107 | var bundleSourceFolder = TestData.Get("TestData", "WixStdBa"); |
| 108 | var dataFolder = TestData.Get(@"TestData", ".Data"); | ||
| 66 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 109 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 67 | var baFolderPath = Path.Combine(baseFolder, "ba"); | 110 | var baFolderPath = Path.Combine(baseFolder, "ba"); |
| 68 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | 111 | var extractFolderPath = Path.Combine(baseFolder, "extract"); |
| @@ -74,6 +117,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 74 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | 117 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), |
| 75 | "-intermediateFolder", intermediateFolder, | 118 | "-intermediateFolder", intermediateFolder, |
| 76 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), | 119 | "-bindpath", Path.Combine(bundleSourceFolder, "data"), |
| 120 | "-bindpath", dataFolder, | ||
| 77 | "-o", bundleFile, | 121 | "-o", bundleFile, |
| 78 | }); | 122 | }); |
| 79 | compileResult.AssertSuccess(); | 123 | compileResult.AssertSuccess(); |
| @@ -103,7 +147,8 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 103 | { | 147 | { |
| 104 | var baseFolder = fs.GetFolder(); | 148 | var baseFolder = fs.GetFolder(); |
| 105 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | 149 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); |
| 106 | var bundleSourceFolder = TestData.Get(@"TestData\Overridable"); | 150 | var bundleSourceFolder = TestData.Get(@"TestData", "Overridable"); |
| 151 | var dataFolder = TestData.Get(@"TestData", ".Data"); | ||
| 107 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 152 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 108 | var baFolderPath = Path.Combine(baseFolder, "ba"); | 153 | var baFolderPath = Path.Combine(baseFolder, "ba"); |
| 109 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | 154 | var extractFolderPath = Path.Combine(baseFolder, "extract"); |
| @@ -114,6 +159,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 114 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), | 159 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), |
| 115 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | 160 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), |
| 116 | "-intermediateFolder", intermediateFolder, | 161 | "-intermediateFolder", intermediateFolder, |
| 162 | "-bindpath", dataFolder, | ||
| 117 | "-o", bundleFile, | 163 | "-o", bundleFile, |
| 118 | }); | 164 | }); |
| 119 | compileResult.AssertSuccess(); | 165 | compileResult.AssertSuccess(); |
| @@ -144,7 +190,8 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 144 | { | 190 | { |
| 145 | var baseFolder = fs.GetFolder(); | 191 | var baseFolder = fs.GetFolder(); |
| 146 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); | 192 | var bundleFile = Path.Combine(baseFolder, "bin", "test.exe"); |
| 147 | var bundleSourceFolder = TestData.Get(@"TestData\WixStdBa"); | 193 | var bundleSourceFolder = TestData.Get(@"TestData", "WixStdBa"); |
| 194 | var dataFolder = TestData.Get(@"TestData", ".Data"); | ||
| 148 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | 195 | var intermediateFolder = Path.Combine(baseFolder, "obj"); |
| 149 | 196 | ||
| 150 | var compileResult = WixRunner.Execute(new[] | 197 | var compileResult = WixRunner.Execute(new[] |
| @@ -153,6 +200,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 153 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), | 200 | Path.Combine(bundleSourceFolder, "Bundle.wxs"), |
| 154 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), | 201 | "-ext", TestData.Get(@"WixToolset.BootstrapperApplications.wixext.dll"), |
| 155 | "-intermediateFolder", intermediateFolder, | 202 | "-intermediateFolder", intermediateFolder, |
| 203 | "-bindpath", dataFolder, | ||
| 156 | "-o", bundleFile, | 204 | "-o", bundleFile, |
| 157 | }); | 205 | }); |
| 158 | compileResult.AssertSuccess(); | 206 | compileResult.AssertSuccess(); |
| @@ -298,6 +346,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 298 | { | 346 | { |
| 299 | "bal:Condition/@Condition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", | 347 | "bal:Condition/@Condition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", |
| 300 | "Overridable variable 'TEST1' collides with 'Test1' with Bundle/@CommandLineVariables value 'caseInsensitive'.", | 348 | "Overridable variable 'TEST1' collides with 'Test1' with Bundle/@CommandLineVariables value 'caseInsensitive'.", |
| 349 | "The *Package/@bal:DisplayFilesInUseDialogCondition attribute's value '=' is not a valid bundle condition.", | ||
| 301 | "The *Package/@bal:DisplayInternalUICondition attribute's value '=' is not a valid bundle condition.", | 350 | "The *Package/@bal:DisplayInternalUICondition attribute's value '=' is not a valid bundle condition.", |
| 302 | "The location of the Variable related to the previous error.", | 351 | "The location of the Variable related to the previous error.", |
| 303 | }, messages.ToArray()); | 352 | }, messages.ToArray()); |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs index 72e31540..7b4d00fc 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/InternalUIBAFixture.cs | |||
| @@ -168,6 +168,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 168 | "WixInternalUIBootstrapperApplication does not support the value of 'force' for Cache on prereq packages. Prereq packages are only cached when they need to be installed.", | 168 | "WixInternalUIBootstrapperApplication does not support the value of 'force' for Cache on prereq packages. Prereq packages are only cached when they need to be installed.", |
| 169 | "WixInternalUIBootstrapperApplication ignores InstallCondition for the primary package so that the MSI UI is always shown.", | 169 | "WixInternalUIBootstrapperApplication ignores InstallCondition for the primary package so that the MSI UI is always shown.", |
| 170 | "WixInternalUIBootstrapperApplication ignores DisplayInternalUICondition for the primary package so that the MSI UI is always shown.", | 170 | "WixInternalUIBootstrapperApplication ignores DisplayInternalUICondition for the primary package so that the MSI UI is always shown.", |
| 171 | "WixInternalUIBootstrapperApplication ignores DisplayFilesInUseDialogCondition for the primary package so that the MSI UI is always shown.", | ||
| 171 | "When using WixInternalUIBootstrapperApplication, all prereq packages should be before the primary package in the chain. The prereq packages are always installed before the primary package.", | 172 | "When using WixInternalUIBootstrapperApplication, all prereq packages should be before the primary package in the chain. The prereq packages are always installed before the primary package.", |
| 172 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); | 173 | }, compileResult.Messages.Select(m => m.ToString()).ToArray()); |
| 173 | 174 | ||
| @@ -181,7 +182,7 @@ namespace WixToolsetTest.BootstrapperApplications | |||
| 181 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); | 182 | var balPackageInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixBalPackageInfo"); |
| 182 | WixAssert.CompareLineByLine(new string[] | 183 | WixAssert.CompareLineByLine(new string[] |
| 183 | { | 184 | { |
| 184 | "<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='DISPLAYTEST' PrimaryPackageType='default' />", | 185 | "<WixBalPackageInfo PackageId='test.msi' DisplayInternalUICondition='DISPLAYTEST' DisplayFilesInUseDialogCondition='DISPLAYTEST' PrimaryPackageType='default' />", |
| 185 | }, balPackageInfos); | 186 | }, balPackageInfos); |
| 186 | 187 | ||
| 187 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); | 188 | var mbaPrereqInfos = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixPrereqInformation"); |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/.Data/test.ico b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/.Data/test.ico new file mode 100644 index 00000000..906ce324 --- /dev/null +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/.Data/test.ico | |||
| Binary files differ | |||
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs index 67dfc589..33b2d64c 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/Overridable/WrongCaseBundle.wxs | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | <Variable Name="TEST1" bal:Overridable="yes" /> | 9 | <Variable Name="TEST1" bal:Overridable="yes" /> |
| 10 | <Chain> | 10 | <Chain> |
| 11 | <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" /> | 11 | <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" /> |
| 12 | <MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="!(loc.NonsensePlanCondition)" /> | 12 | <MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="!(loc.NonsensePlanCondition)" bal:DisplayFilesInUseDialogCondition="!(loc.NonsensePlanCondition)" /> |
| 13 | </Chain> | 13 | </Chain> |
| 14 | <bal:Condition Condition="!(loc.NonsenseDetectCondition)" Message="Unsupported" /> | 14 | <bal:Condition Condition="!(loc.NonsenseDetectCondition)" Message="Unsupported" /> |
| 15 | </Bundle> | 15 | </Bundle> |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs index 2cf9787d..9c9aa0f8 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixIuiBa/IuibaWarnings.wxs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <bal:WixInternalUIBootstrapperApplication /> | 6 | <bal:WixInternalUIBootstrapperApplication /> |
| 7 | </BootstrapperApplication> | 7 | </BootstrapperApplication> |
| 8 | <Chain> | 8 | <Chain> |
| 9 | <MsiPackage SourceFile="test.msi" InstallCondition="INSTALLTEST" bal:DisplayInternalUICondition="DISPLAYTEST" /> | 9 | <MsiPackage SourceFile="test.msi" InstallCondition="INSTALLTEST" bal:DisplayInternalUICondition="DISPLAYTEST" bal:DisplayFilesInUseDialogCondition="DISPLAYTEST" /> |
| 10 | <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" Cache="force" /> | 10 | <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" Cache="force" /> |
| 11 | </Chain> | 11 | </Chain> |
| 12 | </Bundle> | 12 | </Bundle> |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs index e1945f53..44c15999 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/BootstrapperApplicationId.wxs | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" |
| 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
| 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2" |
| 5 | IconSourceFile="test.ico"> | ||
| 5 | <BootstrapperApplication Id="Custom"> | 6 | <BootstrapperApplication Id="Custom"> |
| 6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | 7 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> |
| 7 | </BootstrapperApplication> | 8 | </BootstrapperApplication> |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/Bundle.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/Bundle.wxs index c17b53ff..e0346900 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/Bundle.wxs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/Bundle.wxs | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" |
| 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
| 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2" |
| 5 | IconSourceFile="test.ico"> | ||
| 5 | <BootstrapperApplication> | 6 | <BootstrapperApplication> |
| 6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | 7 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> |
| 7 | </BootstrapperApplication> | 8 | </BootstrapperApplication> |
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayFilesInUseDialogConditionBundle.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayFilesInUseDialogConditionBundle.wxs new file mode 100644 index 00000000..098d6f83 --- /dev/null +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayFilesInUseDialogConditionBundle.wxs | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
| 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
| 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2" | ||
| 5 | IconSourceFile="test.ico"> | ||
| 6 | <BootstrapperApplication> | ||
| 7 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | ||
| 8 | </BootstrapperApplication> | ||
| 9 | <Chain> | ||
| 10 | <MsiPackage SourceFile="test.msi" bal:DisplayFilesInUseDialogCondition="1" /> | ||
| 11 | </Chain> | ||
| 12 | </Bundle> | ||
| 13 | </Wix> | ||
diff --git a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs index f08cfe6a..2dea66fd 100644 --- a/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs +++ b/src/ext/Bal/test/WixToolsetTest.BootstrapperApplications/TestData/WixStdBa/DisplayInternalUIConditionBundle.wxs | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" |
| 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
| 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2" |
| 5 | IconSourceFile="test.ico"> | ||
| 5 | <BootstrapperApplication> | 6 | <BootstrapperApplication> |
| 6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | 7 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> |
| 7 | </BootstrapperApplication> | 8 | </BootstrapperApplication> |
diff --git a/src/ext/Bal/wixext/BalBurnBackendExtension.cs b/src/ext/Bal/wixext/BalBurnBackendExtension.cs index 82195549..5831bb8a 100644 --- a/src/ext/Bal/wixext/BalBurnBackendExtension.cs +++ b/src/ext/Bal/wixext/BalBurnBackendExtension.cs | |||
| @@ -51,6 +51,11 @@ namespace WixToolset.BootstrapperApplications | |||
| 51 | writer.WriteAttributeString("DisplayInternalUICondition", balPackageInfoSymbol.DisplayInternalUICondition); | 51 | writer.WriteAttributeString("DisplayInternalUICondition", balPackageInfoSymbol.DisplayInternalUICondition); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | if (balPackageInfoSymbol.DisplayFilesInUseDialogCondition != null) | ||
| 55 | { | ||
| 56 | writer.WriteAttributeString("DisplayFilesInUseDialogCondition", balPackageInfoSymbol.DisplayFilesInUseDialogCondition); | ||
| 57 | } | ||
| 58 | |||
| 54 | if (balPackageInfoSymbol.PrimaryPackageType != BalPrimaryPackageType.None) | 59 | if (balPackageInfoSymbol.PrimaryPackageType != BalPrimaryPackageType.None) |
| 55 | { | 60 | { |
| 56 | writer.WriteAttributeString("PrimaryPackageType", balPackageInfoSymbol.PrimaryPackageType.ToString().ToLower()); | 61 | writer.WriteAttributeString("PrimaryPackageType", balPackageInfoSymbol.PrimaryPackageType.ToString().ToLower()); |
| @@ -104,6 +109,7 @@ namespace WixToolset.BootstrapperApplications | |||
| 104 | 109 | ||
| 105 | this.VerifyBalConditions(section); | 110 | this.VerifyBalConditions(section); |
| 106 | this.VerifyDisplayInternalUICondition(section); | 111 | this.VerifyDisplayInternalUICondition(section); |
| 112 | this.VerifyDisplayFilesInUseDialogCondition(section); | ||
| 107 | this.VerifyOverridableVariables(section); | 113 | this.VerifyOverridableVariables(section); |
| 108 | 114 | ||
| 109 | var balBaSymbol = section.Symbols.OfType<WixBalBootstrapperApplicationSymbol>().SingleOrDefault(); | 115 | var balBaSymbol = section.Symbols.OfType<WixBalBootstrapperApplicationSymbol>().SingleOrDefault(); |
| @@ -195,6 +201,17 @@ namespace WixToolset.BootstrapperApplications | |||
| 195 | } | 201 | } |
| 196 | } | 202 | } |
| 197 | 203 | ||
| 204 | private void VerifyDisplayFilesInUseDialogCondition(IntermediateSection section) | ||
| 205 | { | ||
| 206 | foreach (var balPackageInfoSymbol in section.Symbols.OfType<WixBalPackageInfoSymbol>().ToList()) | ||
| 207 | { | ||
| 208 | if (balPackageInfoSymbol.DisplayFilesInUseDialogCondition != null) | ||
| 209 | { | ||
| 210 | this.BackendHelper.ValidateBundleCondition(balPackageInfoSymbol.SourceLineNumbers, "*Package", "bal:DisplayFilesInUseDialogCondition", balPackageInfoSymbol.DisplayFilesInUseDialogCondition, BundleConditionPhase.Plan); | ||
| 211 | } | ||
| 212 | } | ||
| 213 | } | ||
| 214 | |||
| 198 | private void VerifyPrimaryPackages(IntermediateSection section, SourceLineNumber baSourceLineNumbers) | 215 | private void VerifyPrimaryPackages(IntermediateSection section, SourceLineNumber baSourceLineNumbers) |
| 199 | { | 216 | { |
| 200 | WixBalPackageInfoSymbol defaultPrimaryPackage = null; | 217 | WixBalPackageInfoSymbol defaultPrimaryPackage = null; |
| @@ -420,6 +437,11 @@ namespace WixToolset.BootstrapperApplications | |||
| 420 | { | 437 | { |
| 421 | this.Messaging.Write(BalWarnings.IuibaPrimaryPackageDisplayInternalUICondition(packageSymbol.SourceLineNumbers)); | 438 | this.Messaging.Write(BalWarnings.IuibaPrimaryPackageDisplayInternalUICondition(packageSymbol.SourceLineNumbers)); |
| 422 | } | 439 | } |
| 440 | |||
| 441 | if (balPackageInfoSymbol.DisplayFilesInUseDialogCondition != null) | ||
| 442 | { | ||
| 443 | this.Messaging.Write(BalWarnings.IuibaPrimaryPackageDisplayFilesInUseDialogCondition(packageSymbol.SourceLineNumbers)); | ||
| 444 | } | ||
| 423 | } | 445 | } |
| 424 | 446 | ||
| 425 | private void VerifyOverridableVariables(IntermediateSection section) | 447 | private void VerifyOverridableVariables(IntermediateSection section) |
diff --git a/src/ext/Bal/wixext/BalCompiler.cs b/src/ext/Bal/wixext/BalCompiler.cs index 35c86233..b7d5f679 100644 --- a/src/ext/Bal/wixext/BalCompiler.cs +++ b/src/ext/Bal/wixext/BalCompiler.cs | |||
| @@ -200,6 +200,20 @@ namespace WixToolset.BootstrapperApplications | |||
| 200 | break; | 200 | break; |
| 201 | } | 201 | } |
| 202 | break; | 202 | break; |
| 203 | case "DisplayFilesInUseDialogCondition": | ||
| 204 | switch (parentElement.Name.LocalName) | ||
| 205 | { | ||
| 206 | case "MsiPackage": | ||
| 207 | case "MspPackage": | ||
| 208 | var displayFilesInUseDialogCondition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute); | ||
| 209 | var packageInfo = this.GetBalPackageInfoSymbol(section, sourceLineNumbers, packageId); | ||
| 210 | packageInfo.DisplayFilesInUseDialogCondition = displayFilesInUseDialogCondition; | ||
| 211 | break; | ||
| 212 | default: | ||
| 213 | this.ParseHelper.UnexpectedAttribute(parentElement, attribute); | ||
| 214 | break; | ||
| 215 | } | ||
| 216 | break; | ||
| 203 | case "PrimaryPackageType": | 217 | case "PrimaryPackageType": |
| 204 | { | 218 | { |
| 205 | var primaryPackageType = BalPrimaryPackageType.None; | 219 | var primaryPackageType = BalPrimaryPackageType.None; |
diff --git a/src/ext/Bal/wixext/BalWarnings.cs b/src/ext/Bal/wixext/BalWarnings.cs index 8c5d892f..f86837f9 100644 --- a/src/ext/Bal/wixext/BalWarnings.cs +++ b/src/ext/Bal/wixext/BalWarnings.cs | |||
| @@ -23,6 +23,11 @@ namespace WixToolset.BootstrapperApplications | |||
| 23 | return Message(sourceLineNumbers, Ids.IuibaPrimaryPackageDisplayInternalUICondition, "WixInternalUIBootstrapperApplication ignores DisplayInternalUICondition for the primary package so that the MSI UI is always shown."); | 23 | return Message(sourceLineNumbers, Ids.IuibaPrimaryPackageDisplayInternalUICondition, "WixInternalUIBootstrapperApplication ignores DisplayInternalUICondition for the primary package so that the MSI UI is always shown."); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | public static Message IuibaPrimaryPackageDisplayFilesInUseDialogCondition(SourceLineNumber sourceLineNumbers) | ||
| 27 | { | ||
| 28 | return Message(sourceLineNumbers, Ids.IuibaPrimaryPackageDisplayFilesInUseDialogCondition, "WixInternalUIBootstrapperApplication ignores DisplayFilesInUseDialogCondition for the primary package so that the MSI UI is always shown."); | ||
| 29 | } | ||
| 30 | |||
| 26 | public static Message IuibaPrimaryPackageInstallCondition(SourceLineNumber sourceLineNumbers) | 31 | public static Message IuibaPrimaryPackageInstallCondition(SourceLineNumber sourceLineNumbers) |
| 27 | { | 32 | { |
| 28 | return Message(sourceLineNumbers, Ids.IuibaPrimaryPackageInstallCondition, "WixInternalUIBootstrapperApplication ignores InstallCondition for the primary package so that the MSI UI is always shown."); | 33 | return Message(sourceLineNumbers, Ids.IuibaPrimaryPackageInstallCondition, "WixInternalUIBootstrapperApplication ignores InstallCondition for the primary package so that the MSI UI is always shown."); |
| @@ -56,6 +61,7 @@ namespace WixToolset.BootstrapperApplications | |||
| 56 | IuibaPrimaryPackageDisplayInternalUICondition = 6504, | 61 | IuibaPrimaryPackageDisplayInternalUICondition = 6504, |
| 57 | IuibaPrereqPackageAfterPrimaryPackage = 6505, | 62 | IuibaPrereqPackageAfterPrimaryPackage = 6505, |
| 58 | DeprecatedBAFactoryAssemblyAttribute = 6506, | 63 | DeprecatedBAFactoryAssemblyAttribute = 6506, |
| 64 | IuibaPrimaryPackageDisplayFilesInUseDialogCondition = 6507, | ||
| 59 | } | 65 | } |
| 60 | } | 66 | } |
| 61 | } | 67 | } |
diff --git a/src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs index e2636d33..6e90c2b9 100644 --- a/src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs +++ b/src/ext/Bal/wixext/Symbols/WixBalPackageInfoSymbol.cs | |||
| @@ -14,6 +14,7 @@ namespace WixToolset.BootstrapperApplications | |||
| 14 | new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.PackageId), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.PackageId), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.DisplayInternalUICondition), IntermediateFieldType.String), | 15 | new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.DisplayInternalUICondition), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.PrimaryPackageType), IntermediateFieldType.Number), | 16 | new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.PrimaryPackageType), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(WixBalPackageInfoSymbolFields.DisplayFilesInUseDialogCondition), IntermediateFieldType.String), | ||
| 17 | }, | 18 | }, |
| 18 | typeof(WixBalPackageInfoSymbol)); | 19 | typeof(WixBalPackageInfoSymbol)); |
| 19 | } | 20 | } |
| @@ -28,6 +29,7 @@ namespace WixToolset.BootstrapperApplications.Symbols | |||
| 28 | PackageId, | 29 | PackageId, |
| 29 | DisplayInternalUICondition, | 30 | DisplayInternalUICondition, |
| 30 | PrimaryPackageType, | 31 | PrimaryPackageType, |
| 32 | DisplayFilesInUseDialogCondition, | ||
| 31 | } | 33 | } |
| 32 | 34 | ||
| 33 | public enum BalPrimaryPackageType | 35 | public enum BalPrimaryPackageType |
| @@ -68,5 +70,11 @@ namespace WixToolset.BootstrapperApplications.Symbols | |||
| 68 | get => (BalPrimaryPackageType)this.Fields[(int)WixBalPackageInfoSymbolFields.PrimaryPackageType].AsNumber(); | 70 | get => (BalPrimaryPackageType)this.Fields[(int)WixBalPackageInfoSymbolFields.PrimaryPackageType].AsNumber(); |
| 69 | set => this.Set((int)WixBalPackageInfoSymbolFields.PrimaryPackageType, (int)value); | 71 | set => this.Set((int)WixBalPackageInfoSymbolFields.PrimaryPackageType, (int)value); |
| 70 | } | 72 | } |
| 73 | |||
| 74 | public string DisplayFilesInUseDialogCondition | ||
| 75 | { | ||
| 76 | get => this.Fields[(int)WixBalPackageInfoSymbolFields.DisplayFilesInUseDialogCondition].AsString(); | ||
| 77 | set => this.Set((int)WixBalPackageInfoSymbolFields.DisplayFilesInUseDialogCondition, value); | ||
| 78 | } | ||
| 71 | } | 79 | } |
| 72 | } | 80 | } |
