Changeset 537 for branches/eraser6/Installer/Bootstrapper/Bootstrapper.cpp
- Timestamp:
- 11/13/2008 10:54:09 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Installer/Bootstrapper/Bootstrapper.cpp
r536 r537 82 82 s->FileRead += readSize; 83 83 84 SetProgress(( double)s->FileRead / s->FileSize);84 SetProgress((float)((double)s->FileRead / s->FileSize)); 85 85 } 86 86 … … 104 104 void ExtractTempFiles(std::wstring pathToExtract) 105 105 { 106 if (std::wstring(L"\\/").find(pathToExtract[pathToExtract.length() - 1]) )106 if (std::wstring(L"\\/").find(pathToExtract[pathToExtract.length() - 1]) == std::wstring::npos) 107 107 pathToExtract += L"\\"; 108 108 … … 159 159 160 160 //Create the output file 161 size_t convertedChars = 0; 161 162 wchar_t fileName[MAX_PATH]; 162 mbstowcs (fileName, f->Name, sizeof(fileName) / sizeof(fileName[0]));163 mbstowcs_s(&convertedChars, fileName, f->Name, sizeof(fileName) / sizeof(fileName[0])); 163 164 HANDLE destFile = CreateFileW((pathToExtract + fileName).c_str(), GENERIC_WRITE, 0, 164 165 NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); … … 231 232 //Get a mutable version of the command line 232 233 wchar_t* cmdLine = new wchar_t[commandLine.length() + 1]; 233 wcscpy (cmdLine, commandLine.c_str());234 wcscpy_s(cmdLine, commandLine.length() + 1, commandLine.c_str()); 234 235 235 236 //Launch the process 236 237 STARTUPINFOW startupInfo; 237 PROCESS_INFORMATION WpInfo;238 PROCESS_INFORMATION pInfo; 238 239 ::ZeroMemory(&startupInfo, sizeof(startupInfo)); 239 240 ::ZeroMemory(&pInfo, sizeof(pInfo)); … … 273 274 274 275 //Get the path to the installer 275 if (std::wstring(L"\\/").find(tempDir[tempDir.length() - 1]) )276 if (std::wstring(L"\\/").find(tempDir[tempDir.length() - 1]) == std::wstring::npos) 276 277 tempDir += L"\\"; 277 std::wstring commandLine( '"' + tempDir);278 std::wstring commandLine(L'"' + tempDir); 278 279 commandLine += L"dotnetfx.exe\""; 279 280 … … 290 291 SYSTEM_INFO sysInfo; 291 292 ZeroMemory(&sysInfo, sizeof(sysInfo)); 292 sysInfo.cbSize = sizeof(sysInfo);293 293 GetSystemInfo(&sysInfo); 294 294 295 if (std::wstring(L"\\/").find(tempDir[tempDir.length() - 1]) )295 if (std::wstring(L"\\/").find(tempDir[tempDir.length() - 1]) == std::wstring::npos) 296 296 tempDir += L"\\"; 297 297 switch (sysInfo.wProcessorArchitecture) … … 307 307 308 308 std::wstring commandLine(L"msiexec.exe /i "); 309 commandLine += '"' + tempDir +'"';309 commandLine += L'"' + tempDir + L'"'; 310 310 311 311 //And the return code is true if the process exited with 0.
Note: See TracChangeset
for help on using the changeset viewer.
