aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp')
-rw-r--r--src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp85
1 files changed, 58 insertions, 27 deletions
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