diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-08-10 19:24:24 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-08-10 20:27:48 -0500 |
commit | 3756ae7c8dc60d459511d0b067ebef5efb052746 (patch) | |
tree | 5aa0505d3ab4e4337575597bcad9c6fd641ea78d /src/ext | |
parent | 84e7b6d277e5c3d118e11a45834d420254a758c0 (diff) | |
download | wix-3756ae7c8dc60d459511d0b067ebef5efb052746.tar.gz wix-3756ae7c8dc60d459511d0b067ebef5efb052746.tar.bz2 wix-3756ae7c8dc60d459511d0b067ebef5efb052746.zip |
Use IFileOpenDialog instead of SHBrowseForFolder and GetOpenFileName.
It is the recommended option since Vista and has better long path support.
Diffstat (limited to 'src/ext')
-rw-r--r-- | src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index d7b5a269..8544ff0e 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -1145,26 +1145,19 @@ public: // IBootstrapperApplication | |||
1145 | ) | 1145 | ) |
1146 | { | 1146 | { |
1147 | HRESULT hr = S_OK; | 1147 | HRESULT hr = S_OK; |
1148 | LPWSTR sczPath = NULL; | ||
1148 | 1149 | ||
1149 | if (BOOTSTRAPPER_CACHE_RESOLVE_NONE == *pAction && BOOTSTRAPPER_DISPLAY_FULL == m_command.display) // prompt to change the source location. | 1150 | if (BOOTSTRAPPER_CACHE_RESOLVE_NONE == *pAction && BOOTSTRAPPER_DISPLAY_FULL == m_command.display) // prompt to change the source location. |
1150 | { | 1151 | { |
1151 | OPENFILENAMEW ofn = { }; | 1152 | static COMDLG_FILTERSPEC vrgFilters[] = |
1152 | WCHAR wzFile[MAX_PATH] = { }; | 1153 | { |
1153 | 1154 | { L"All Files", L"*.*" }, | |
1154 | ::StringCchCopyW(wzFile, countof(wzFile), rgSearchPaths[dwRecommendedSearchPath]); | 1155 | }; |
1155 | |||
1156 | ofn.lStructSize = sizeof(ofn); | ||
1157 | ofn.hwndOwner = m_hWnd; | ||
1158 | ofn.lpstrFile = wzFile; | ||
1159 | ofn.nMaxFile = countof(wzFile); | ||
1160 | ofn.lpstrFilter = L"All Files\0*.*\0"; | ||
1161 | ofn.nFilterIndex = 1; | ||
1162 | ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; | ||
1163 | ofn.lpstrTitle = m_pTheme->sczCaption; | ||
1164 | 1156 | ||
1165 | if (::GetOpenFileNameW(&ofn)) | 1157 | hr = WnduShowOpenFileDialog(m_hWnd, TRUE, TRUE, m_pTheme->sczCaption, vrgFilters, countof(vrgFilters), 1, rgSearchPaths[dwRecommendedSearchPath], &sczPath); |
1158 | if (SUCCEEDED(hr)) | ||
1166 | { | 1159 | { |
1167 | hr = m_pEngine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, ofn.lpstrFile); | 1160 | hr = m_pEngine->SetLocalSource(wzPackageOrContainerId, wzPayloadId, sczPath); |
1168 | *pAction = BOOTSTRAPPER_CACHE_RESOLVE_RETRY; | 1161 | *pAction = BOOTSTRAPPER_CACHE_RESOLVE_RETRY; |
1169 | } | 1162 | } |
1170 | else | 1163 | else |
@@ -1175,6 +1168,9 @@ public: // IBootstrapperApplication | |||
1175 | // else there's nothing more we can do in non-interactive mode | 1168 | // else there's nothing more we can do in non-interactive mode |
1176 | 1169 | ||
1177 | *pfCancel |= CheckCanceled(); | 1170 | *pfCancel |= CheckCanceled(); |
1171 | |||
1172 | ReleaseStr(sczPath); | ||
1173 | |||
1178 | return hr; | 1174 | return hr; |
1179 | } | 1175 | } |
1180 | 1176 | ||