diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-06-03 17:47:54 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-06-07 19:44:36 -0500 |
| commit | b652e93a460b4b822a01382e5992f96f1d805ffe (patch) | |
| tree | 0c8ec0f0eba23d65fd404eb3f510944b244de65b /src/burn/engine/cache.cpp | |
| parent | 8a4d03207633e9fdc364aaed82bd167f844679f9 (diff) | |
| download | wix-b652e93a460b4b822a01382e5992f96f1d805ffe.tar.gz wix-b652e93a460b4b822a01382e5992f96f1d805ffe.tar.bz2 wix-b652e93a460b4b822a01382e5992f96f1d805ffe.zip | |
Replace PathCompare with PathCompareCanonicalized.
Diffstat (limited to 'src/burn/engine/cache.cpp')
| -rw-r--r-- | src/burn/engine/cache.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index 04b2f0ca..b311a195 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp | |||
| @@ -170,7 +170,7 @@ extern "C" HRESULT CacheInitialize( | |||
| 170 | 170 | ||
| 171 | HRESULT hr = S_OK; | 171 | HRESULT hr = S_OK; |
| 172 | LPWSTR sczAppData = NULL; | 172 | LPWSTR sczAppData = NULL; |
| 173 | int nCompare = 0; | 173 | BOOL fPathEqual = FALSE; |
| 174 | 174 | ||
| 175 | // Cache paths are initialized once so they cannot be changed while the engine is caching payloads. | 175 | // Cache paths are initialized once so they cannot be changed while the engine is caching payloads. |
| 176 | // Always construct the default machine package cache path so we can determine if we're redirected. | 176 | // Always construct the default machine package cache path so we can determine if we're redirected. |
| @@ -199,10 +199,10 @@ extern "C" HRESULT CacheInitialize( | |||
| 199 | ExitOnFailure(hr, "Failed to copy default package cache directory to current package cache directory."); | 199 | ExitOnFailure(hr, "Failed to copy default package cache directory to current package cache directory."); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | hr = PathCompare(pCache->sczDefaultMachinePackageCache, pCache->sczCurrentMachinePackageCache, &nCompare); | 202 | hr = PathCompareCanonicalized(pCache->sczDefaultMachinePackageCache, pCache->sczCurrentMachinePackageCache, &fPathEqual); |
| 203 | ExitOnFailure(hr, "Failed to compare default and current package cache directories."); | 203 | ExitOnFailure(hr, "Failed to compare default and current package cache directories."); |
| 204 | 204 | ||
| 205 | pCache->fCustomMachinePackageCache = CSTR_EQUAL != nCompare; | 205 | pCache->fCustomMachinePackageCache = !fPathEqual; |
| 206 | 206 | ||
| 207 | 207 | ||
| 208 | hr = PathGetKnownFolder(CSIDL_LOCAL_APPDATA, &sczAppData); | 208 | hr = PathGetKnownFolder(CSIDL_LOCAL_APPDATA, &sczAppData); |
| @@ -241,7 +241,7 @@ extern "C" HRESULT CacheInitializeSources( | |||
| 241 | LPWSTR sczCompletedPath = NULL; | 241 | LPWSTR sczCompletedPath = NULL; |
| 242 | LPWSTR sczOriginalSource = NULL; | 242 | LPWSTR sczOriginalSource = NULL; |
| 243 | LPWSTR sczOriginalSourceFolder = NULL; | 243 | LPWSTR sczOriginalSourceFolder = NULL; |
| 244 | int nCompare = 0; | 244 | BOOL fPathEqual = FALSE; |
| 245 | LPCWSTR wzSourceProcessPath = pInternalCommand->sczSourceProcessPath; | 245 | LPCWSTR wzSourceProcessPath = pInternalCommand->sczSourceProcessPath; |
| 246 | 246 | ||
| 247 | hr = PathForCurrentProcess(&sczCurrentPath, NULL); | 247 | hr = PathForCurrentProcess(&sczCurrentPath, NULL); |
| @@ -254,10 +254,10 @@ extern "C" HRESULT CacheInitializeSources( | |||
| 254 | hr = PathConcatRelativeToBase(sczCompletedFolder, pRegistration->sczExecutableName, &sczCompletedPath); | 254 | hr = PathConcatRelativeToBase(sczCompletedFolder, pRegistration->sczExecutableName, &sczCompletedPath); |
| 255 | ExitOnFailure(hr, "Failed to combine working path with engine file name."); | 255 | ExitOnFailure(hr, "Failed to combine working path with engine file name."); |
| 256 | 256 | ||
| 257 | hr = PathCompare(sczCurrentPath, sczCompletedPath, &nCompare); | 257 | hr = PathCompareCanonicalized(sczCurrentPath, sczCompletedPath, &fPathEqual); |
| 258 | ExitOnFailure(hr, "Failed to compare current path for bundle: %ls", sczCurrentPath); | 258 | ExitOnFailure(hr, "Failed to compare current path for bundle: %ls", sczCurrentPath); |
| 259 | 259 | ||
| 260 | pCache->fRunningFromCache = (CSTR_EQUAL == nCompare); | 260 | pCache->fRunningFromCache = fPathEqual; |
| 261 | 261 | ||
| 262 | // If a source process path was not provided (e.g. we are not being | 262 | // If a source process path was not provided (e.g. we are not being |
| 263 | // run in a clean room) then use the current process path as the | 263 | // run in a clean room) then use the current process path as the |
| @@ -959,7 +959,7 @@ extern "C" HRESULT CacheCompleteBundle( | |||
| 959 | ) | 959 | ) |
| 960 | { | 960 | { |
| 961 | HRESULT hr = S_OK; | 961 | HRESULT hr = S_OK; |
| 962 | int nCompare = 0; | 962 | BOOL fPathEqual = FALSE; |
| 963 | LPWSTR sczTargetDirectory = NULL; | 963 | LPWSTR sczTargetDirectory = NULL; |
| 964 | LPWSTR sczTargetPath = NULL; | 964 | LPWSTR sczTargetPath = NULL; |
| 965 | LPWSTR sczSourceDirectory = NULL; | 965 | LPWSTR sczSourceDirectory = NULL; |
| @@ -976,10 +976,10 @@ extern "C" HRESULT CacheCompleteBundle( | |||
| 976 | 976 | ||
| 977 | // If the bundle is running out of the package cache then we don't need to copy it there | 977 | // If the bundle is running out of the package cache then we don't need to copy it there |
| 978 | // (and don't want to since it'll be in use) so bail. | 978 | // (and don't want to since it'll be in use) so bail. |
| 979 | hr = PathCompare(wzSourceBundlePath, sczTargetPath, &nCompare); | 979 | hr = PathCompareCanonicalized(wzSourceBundlePath, sczTargetPath, &fPathEqual); |
| 980 | ExitOnFailure(hr, "Failed to compare completed cache path for bundle: %ls", wzSourceBundlePath); | 980 | ExitOnFailure(hr, "Failed to compare completed cache path for bundle: %ls", wzSourceBundlePath); |
| 981 | 981 | ||
| 982 | if (CSTR_EQUAL == nCompare) | 982 | if (fPathEqual) |
| 983 | { | 983 | { |
| 984 | ExitFunction(); | 984 | ExitFunction(); |
| 985 | } | 985 | } |
