diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-06-24 12:28:27 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-06-27 11:14:21 -0500 |
| commit | eb53852d7ae6838e54525eb57df1d8ce8a722f9b (patch) | |
| tree | 7fa05bd6df1bce2e20d87c5fbacc1c658dc000aa /src/libs/dutil/WixToolset.DUtil/apputil.cpp | |
| parent | 6ee12a64cb75097a238e60d4fd0ea542e8312214 (diff) | |
| download | wix-eb53852d7ae6838e54525eb57df1d8ce8a722f9b.tar.gz wix-eb53852d7ae6838e54525eb57df1d8ce8a722f9b.tar.bz2 wix-eb53852d7ae6838e54525eb57df1d8ce8a722f9b.zip | |
Add longPathAware to Burn manifest to support long paths.
Fixes 3455
Diffstat (limited to '')
| -rw-r--r-- | src/libs/dutil/WixToolset.DUtil/apputil.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/apputil.cpp b/src/libs/dutil/WixToolset.DUtil/apputil.cpp index b70c8cfb..9e75082a 100644 --- a/src/libs/dutil/WixToolset.DUtil/apputil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/apputil.cpp | |||
| @@ -87,31 +87,27 @@ DAPI_(HRESULT) LoadSystemLibraryWithPath( | |||
| 87 | ) | 87 | ) |
| 88 | { | 88 | { |
| 89 | HRESULT hr = S_OK; | 89 | HRESULT hr = S_OK; |
| 90 | DWORD cch = 0; | 90 | LPWSTR sczDirectory = NULL; |
| 91 | WCHAR wzPath[MAX_PATH] = { }; | 91 | LPWSTR sczPath = NULL; |
| 92 | 92 | ||
| 93 | cch = ::GetSystemDirectoryW(wzPath, MAX_PATH); | 93 | hr = PathGetSystemDirectory(&sczDirectory); |
| 94 | AppExitOnNullWithLastError(cch, hr, "Failed to get the Windows system directory."); | 94 | AppExitOnFailure(hr, "Failed to get the Windows system directory."); |
| 95 | 95 | ||
| 96 | if (L'\\' != wzPath[cch - 1]) | 96 | hr = StrAllocFormatted(&sczPath, L"%ls%ls", sczDirectory, wzModuleName); |
| 97 | { | 97 | AppExitOnFailure(hr, "Failed to create the fully-qualified path to %ls.", wzModuleName); |
| 98 | hr = ::StringCchCatNW(wzPath, MAX_PATH, L"\\", 1); | ||
| 99 | AppExitOnRootFailure(hr, "Failed to terminate the string with a backslash."); | ||
| 100 | } | ||
| 101 | 98 | ||
| 102 | hr = ::StringCchCatW(wzPath, MAX_PATH, wzModuleName); | 99 | *phModule = ::LoadLibraryExW(sczPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); |
| 103 | AppExitOnRootFailure(hr, "Failed to create the fully-qualified path to %ls.", wzModuleName); | 100 | AppExitOnNullWithLastError(*phModule, hr, "Failed to load the library %ls.", sczPath); |
| 104 | |||
| 105 | *phModule = ::LoadLibraryExW(wzPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); | ||
| 106 | AppExitOnNullWithLastError(*phModule, hr, "Failed to load the library %ls.", wzModuleName); | ||
| 107 | 101 | ||
| 108 | if (psczPath) | 102 | if (psczPath) |
| 109 | { | 103 | { |
| 110 | hr = StrAllocString(psczPath, wzPath, MAX_PATH); | 104 | *psczPath = sczPath; |
| 111 | AppExitOnFailure(hr, "Failed to copy the path to library."); | 105 | sczPath = NULL; |
| 112 | } | 106 | } |
| 113 | 107 | ||
| 114 | LExit: | 108 | LExit: |
| 109 | ReleaseStr(sczDirectory); | ||
| 110 | |||
| 115 | return hr; | 111 | return hr; |
| 116 | } | 112 | } |
| 117 | 113 | ||
