diff options
Diffstat (limited to 'src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp')
| -rw-r--r-- | src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp | 93 |
1 files changed, 62 insertions, 31 deletions
diff --git a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp index 59b2d8de..c1e8b2b3 100644 --- a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp | |||
| @@ -614,7 +614,7 @@ public: // IBootstrapperApplication | |||
| 614 | { | 614 | { |
| 615 | // After restart we need to finish the dependency registration for our package so allow the package | 615 | // After restart we need to finish the dependency registration for our package so allow the package |
| 616 | // to go present. | 616 | // to go present. |
| 617 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzPackageId, -1, m_sczAfterForcedRestartPackage, -1)) | 617 | if (CSTR_EQUAL == ::CompareStringOrdinal(wzPackageId, -1, m_sczAfterForcedRestartPackage, -1, FALSE)) |
| 618 | { | 618 | { |
| 619 | // Do not allow a repair because that could put us in a perpetual restart loop. | 619 | // Do not allow a repair because that could put us in a perpetual restart loop. |
| 620 | if (BOOTSTRAPPER_REQUEST_STATE_REPAIR == *pRequestState) | 620 | if (BOOTSTRAPPER_REQUEST_STATE_REPAIR == *pRequestState) |
| @@ -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 | ||
| @@ -2928,7 +2946,7 @@ private: | |||
| 2928 | 2946 | ||
| 2929 | if (argv[i][0] == L'-' || argv[i][0] == L'/') | 2947 | if (argv[i][0] == L'-' || argv[i][0] == L'/') |
| 2930 | { | 2948 | { |
| 2931 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"lang", -1)) | 2949 | if (CSTR_EQUAL == ::CompareStringOrdinal(&argv[i][1], -1, L"lang", -1, TRUE)) |
| 2932 | { | 2950 | { |
| 2933 | if (i + 1 >= argc) | 2951 | if (i + 1 >= argc) |
| 2934 | { | 2952 | { |
| @@ -2941,7 +2959,7 @@ private: | |||
| 2941 | hr = StrAllocString(psczLanguage, &argv[i][0], 0); | 2959 | hr = StrAllocString(psczLanguage, &argv[i][0], 0); |
| 2942 | BalExitOnFailure(hr, "Failed to copy language."); | 2960 | BalExitOnFailure(hr, "Failed to copy language."); |
| 2943 | } | 2961 | } |
| 2944 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"cache", -1)) | 2962 | else if (CSTR_EQUAL == ::CompareStringOrdinal(&argv[i][1], -1, L"cache", -1, TRUE)) |
| 2945 | { | 2963 | { |
| 2946 | m_fRequestedCacheOnly = TRUE; | 2964 | m_fRequestedCacheOnly = TRUE; |
| 2947 | } | 2965 | } |
| @@ -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 | ||
| @@ -3570,7 +3597,7 @@ private: | |||
| 3570 | for (DWORD iAssignControl = 0; iAssignControl < countof(m_rgInitControls); ++iAssignControl) | 3597 | for (DWORD iAssignControl = 0; iAssignControl < countof(m_rgInitControls); ++iAssignControl) |
| 3571 | { | 3598 | { |
| 3572 | THEME_ASSIGN_CONTROL_ID* pAssignControl = m_rgInitControls + iAssignControl; | 3599 | THEME_ASSIGN_CONTROL_ID* pAssignControl = m_rgInitControls + iAssignControl; |
| 3573 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pArgs->pThemeControl->sczName, -1, pAssignControl->wzName, -1)) | 3600 | if (CSTR_EQUAL == ::CompareStringOrdinal(pArgs->pThemeControl->sczName, -1, pAssignControl->wzName, -1, FALSE)) |
| 3574 | { | 3601 | { |
| 3575 | if (!pAssignControl->ppControl) | 3602 | if (!pAssignControl->ppControl) |
| 3576 | { | 3603 | { |
| @@ -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 | ||
