Changeset 546


Ignore:
Timestamp:
11/13/2008 3:08:07 PM (3 years ago)
Author:
lowjoel
Message:

Hide the Eraser bootstrapper progress screen after .NET has been installed, since the centrepiece should be the Eraser installer.

Location:
branches/eraser6/Installer/Bootstrapper
Files:
3 edited

Legend:

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

    r545 r546  
    6060 
    6161    DWORD lastOperation = 0; 
    62     //char buffer[262144]; 
    63     char* buffer = new char[2621440]; 
    64     unsigned bufsize = 2621440; 
    65     while (ReadFile(srcFile, buffer, bufsize, &lastOperation, NULL) && lastOperation) 
     62    char buffer[262144]; 
     63    while (ReadFile(srcFile, buffer, sizeof(buffer), &lastOperation, NULL) && lastOperation) 
    6664        WriteFile(destFile, buffer, lastOperation, &lastOperation, NULL); 
    6765 
     
    7169        throw std::wstring(L"The file size of the binary is larger than the data " 
    7270            L"offset position; recompile the package, increasing DataOffset."); 
    73     ZeroMemory(buffer, bufsize); 
     71    ZeroMemory(buffer, sizeof(buffer)); 
    7472    while (amountToWrite > 0) 
    7573    { 
    76         WriteFile(destFile, buffer, std::min<unsigned>(amountToWrite, bufsize), 
     74        WriteFile(destFile, buffer, std::min<unsigned>(amountToWrite, sizeof(buffer)), 
    7775            &lastOperation, NULL); 
    7876        amountToWrite -= lastOperation; 
     
    8684    int error; 
    8785    SetLastError(0); 
    88     while (ReadFile(packageFile, buffer, bufsize, &lastOperation, NULL) && lastOperation) 
     86    while (ReadFile(packageFile, buffer, sizeof(buffer), &lastOperation, NULL) && lastOperation) 
    8987    { 
    9088        WriteFile(destFile, buffer, lastOperation, &lastOperation, NULL); 
  • branches/eraser6/Installer/Bootstrapper/Bootstrapper.h

    r545 r546  
    4444    /// Creates the Window. 
    4545    bool Create(); 
     46 
     47    /// Shows or hides the window. 
     48    void Show(bool show); 
     49 
     50    /// Enables or disables the cancel button. 
     51    void EnableCancellation(bool enable); 
    4652 
    4753    /// Sets the progress of the current operation. 
  • branches/eraser6/Installer/Bootstrapper/Main.cpp

    r544 r546  
    134134        //Create the parent window and the child controls 
    135135        ::hInstance = hInstance; 
    136         Application::Get(); 
     136        Application& app = Application::Get(); 
     137        MainWindow& mainWin = app.GetTopWindow(); 
    137138 
    138139        //OK, now we do the hard work. Create a folder to place our payload into 
     
    148149        TempDir dir(tempDir); 
    149150        ExtractTempFiles(tempDir); 
     151        mainWin.EnableCancellation(false); 
    150152 
    151153        //Install the .NET framework 
     
    154156 
    155157        //Then install Eraser! 
     158        mainWin.Show(false); 
    156159        InstallEraser(tempDir); 
    157160    } 
     
    267270 
    268271    //Create the window 
    269     hWnd = CreateWindowW(szWindowClass, L"Eraser Setup", WS_CAPTION | WS_SYSMENU, 
     272    hWnd = CreateWindowW(szWindowClass, L"Eraser Setup", WS_CAPTION, 
    270273        CW_USEDEFAULT, 0, 300, 130, NULL, NULL, hInstance, NULL); 
    271274 
     
    306309} 
    307310 
     311void MainWindow::Show(bool show) 
     312{ 
     313    ShowWindow(hWnd, show ? SW_SHOW : SW_HIDE); 
     314} 
     315 
     316void MainWindow::EnableCancellation(bool enable) 
     317{ 
     318    EnableWindow(hWndCancelBtn, enable); 
     319} 
     320 
    308321void MainWindow::SetProgress(float progress) 
    309322{ 
Note: See TracChangeset for help on using the changeset viewer.