Changeset 1351


Ignore:
Timestamp:
11/27/2009 9:44:13 AM (4 years ago)
Author:
lowjoel
Message:

Only extract the relative file name from the 7-zip archive. This is because the files in the distribution are flat (and uniquely named). This allows the build server to do proper running builds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Installer/Bootstrapper/Bootstrapper.cpp

    r1278 r1351  
    260260        wchar_t fileName[MAX_PATH]; 
    261261        mbstowcs_s(&convertedChars, fileName, file->Name, sizeof(fileName) / sizeof(fileName[0])); 
     262         
     263        //Split the path to get the file name only. 
     264        wchar_t baseFileName[MAX_PATH]; 
     265        wchar_t fileExt[MAX_PATH]; 
     266        _wsplitpath_s(fileName, NULL, NULL, NULL, NULL, baseFileName, 
     267            sizeof(baseFileName) / sizeof(baseFileName[0]), fileExt, 
     268            sizeof(fileExt) / sizeof(fileExt[0])); 
     269        wcscpy_s(fileName, baseFileName); 
     270        wcscpy_s(fileName + wcslen(baseFileName), 
     271            sizeof(fileName) / sizeof(fileName[0]) - wcslen(baseFileName), fileExt); 
     272 
    262273        Handle destFile(CreateFileW((pathToExtract + fileName).c_str(), GENERIC_WRITE, 0, 
    263274            NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)); 
Note: See TracChangeset for help on using the changeset viewer.