WIXFEAT:4781 - Do a best-effort duplication of strings instead of fai… #260

Merged
merged 1 commit into from Jun 9, 2015

Projects

None yet

3 participants

@barnson
Member
barnson commented May 31, 2015

…ling if there's a missing string.

@rseanhall rseanhall commented on the diff Jun 2, 2015
...nsion/wixstdba/WixStandardBootstrapperApplication.cpp
@@ -1254,29 +1254,30 @@ class CWixStandardBootstrapperApplication : public CBalBaseBootstrapperApplicati
hr = LocGetString(m_pWixLoc, L"#(loc.SuccessInstallHeader)", &pLocString);
if (E_NOTFOUND == hr)
{
- hr = LocGetString(m_pWixLoc, L"#(loc.SuccessHeader)", &pLocString);
- ExitOnFailure(hr, "Failed to load SuccessHeader localization string.");
-
- hr = LocAddString(m_pWixLoc, L"SuccessInstallHeader", pLocString->wzText, pLocString->bOverridable);
- ExitOnFailure(hr, "Failed to duplicate localization string for SuccessInstallHeader.");
-
- hr = LocAddString(m_pWixLoc, L"SuccessRepairHeader", pLocString->wzText, pLocString->bOverridable);
- ExitOnFailure(hr, "Failed to duplicate localization string for SuccessRepairHeader.");
+ // Duplicate strings, best-effort only.
+ if (SUCCEEDED(LocGetString(m_pWixLoc, L"#(loc.SuccessHeader)", &pLocString)))
+ {
+ hr = LocAddString(m_pWixLoc, L"SuccessInstallHeader", pLocString->wzText, pLocString->bOverridable);
@rseanhall
rseanhall Jun 2, 2015 Member

What happens when you add a string that already exists?

@barnson
barnson Jun 8, 2015 Member

It succeeds, though it's essentially hidden. (The original is found first.) So the only failure here is OOM and other about-to-blow-up-anyway errors.

@robmen robmen merged commit 9b37d4d into wixtoolset:develop Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment