Changeset 1278 for trunk/eraser6
- Timestamp:
- 10/19/2009 10:43:42 AM (4 years ago)
- Location:
- trunk/eraser6/Installer/Bootstrapper
- Files:
-
- 2 edited
-
Bootstrapper.cpp (modified) (7 diffs)
-
Main.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Installer/Bootstrapper/Bootstrapper.cpp
r1277 r1278 143 143 144 144 LZMemStream* s = static_cast<LZMemStream*>(object); 145 146 //Copy the memory to the provided buffer. 147 *size = std::min(std::min(*size, s->BufferSize - s->CurrentOffset), 148 static_cast<size_t>(32768)); 145 149 char* dstBuffer = reinterpret_cast<char*>(SzAlloc(object, *size)); 150 memcpy(dstBuffer, s->Buffer + s->CurrentOffset, *size); 151 152 *buf = dstBuffer; 153 s->BufferRead += *size; 154 155 MainWindow& mainWin = Application::Get().GetTopWindow(); 156 mainWin.SetProgress((float)((double)s->BufferRead / s->BufferSize)); 157 return SZ_OK; 158 } 159 160 static SRes LZMemStreamRead(void* object, void* buf, size_t* size) 161 { 162 LZMemStream* s = static_cast<LZMemStream*>(object); 146 163 147 164 //Copy the memory to the provided buffer. 148 *size = std::min(*size, s->BufferSize - s->CurrentOffset); 149 memcpy(dstBuffer, s->Buffer + s->CurrentOffset, *size); 150 *buf = dstBuffer; 151 return SZ_OK; 152 } 153 154 static SRes LZMemStreamRead(void* object, void* buf, size_t* size) 155 { 156 LZMemStream* s = static_cast<LZMemStream*>(object); 157 158 //Copy the memory to the provided buffer. 159 *size = std::min(*size, s->BufferSize - s->CurrentOffset); 165 *size = std::min(std::min(*size, s->BufferSize - s->CurrentOffset), 166 static_cast<size_t>(32768)); 160 167 memcpy(buf, s->Buffer + s->CurrentOffset, *size); 161 168 … … 194 201 if (newPos > s->BufferSize || newPos < 0) 195 202 return SZ_ERROR_INPUT_EOF; 196 s->CurrentOffset = newPos;203 s->CurrentOffset = static_cast<size_t>(newPos); 197 204 *position = newPos; 198 205 return SZ_OK; … … 241 248 unsigned blockIndex = 0; 242 249 Byte* outBuffer = NULL; 243 size_t outBufferSize = 0;250 size_t outBufferSize = 0; 244 251 for (unsigned i = 0; i < db.db.NumFiles; ++i) 245 252 { … … 322 329 } 323 330 324 int CreateProcessAndWait(const std::wstring& commandLine )331 int CreateProcessAndWait(const std::wstring& commandLine, const std::wstring& appName) 325 332 { 326 333 //Get a mutable version of the command line … … 337 344 { 338 345 delete[] cmdLine; 339 throw GetErrorMessage(GetLastError());346 throw L"Error while executing " + appName + L": " + GetErrorMessage(GetLastError()); 340 347 } 341 348 delete[] cmdLine; … … 379 386 380 387 //And the return code is true if the process exited with 0. 381 return CreateProcessAndWait(commandLine ) == 0;388 return CreateProcessAndWait(commandLine, L".NET Framework Installer") == 0; 382 389 } 383 390 … … 415 422 416 423 //And the return code is true if the process exited with 0. 417 return CreateProcessAndWait(commandLine ) == 0;418 } 424 return CreateProcessAndWait(commandLine, L"Eraser") == 0; 425 } -
trunk/eraser6/Installer/Bootstrapper/Main.cpp
r815 r1278 345 345 { 346 346 EnableWindow(hWndCancelBtn, enable); 347 Application::Get().Yield(); 347 348 } 348 349 … … 353 354 SetWindowLongPtr(hWndProgressBar, GWL_STYLE, pbStyle & (~PBS_MARQUEE)); 354 355 SendMessage(hWndProgressBar, PBM_SETPOS, (int)(progress * 1000), 0); 356 Application::Get().Yield(); 355 357 } 356 358 … … 360 362 GetWindowLongPtr(hWndProgressBar, GWL_STYLE) | PBS_MARQUEE); 361 363 SendMessage(hWndProgressBar, PBM_SETMARQUEE, true, 100); 364 Application::Get().Yield(); 362 365 } 363 366 … … 365 368 { 366 369 SetWindowTextW(hWndStatusLbl, message.c_str()); 370 Application::Get().Yield(); 367 371 } 368 372
Note: See TracChangeset
for help on using the changeset viewer.
