Changeset 9

Show
Ignore:
Timestamp:
03/06/06 23:07:03 (6 years ago)
Author:
mloar2
Message:

Fixored progress stuff.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/System.Installer/System.Installer.cpp

    r4 r9  
    265265                      //field 1 = 2,field 2 will contain the number of ticks the bar has moved 
    266266                      // movement direction determined by g_bForwardProgress set by reset progress msg 
    267                       handler->Invoke((g_iProgress + (g_bForwardProgress ? iField[1] : -1*iField[1]))/g_iProgressTotal); 
     267                      handler->Invoke((g_iProgress + (g_bForwardProgress ? iField[1] : -1*iField[1]))); 
    268268                      //SendMessage(/*handle to your progress control*/,PBM_DELTAPOS,g_bForwardProgress ? iField[1] : -1*iField[1],0); 
    269269                      break; 
     
    356356          } 
    357357 
    358           /* There is no MsiUninstallProduct().  According to the documentation,  
    359            * MsiConfigureProduct(code, 0, INSTALLSTATE_ABSENT) should be equivalent. 
    360            * However, I had some issues with it.  Therefore, I'll just run msiexec.exe 
    361            * and tell it to remove.  It knows what to do. 
    362            */ 
    363358          setInternalUI(None); 
    364359          UINT ret = MsiConfigureProduct(code, 0, INSTALLSTATE_ABSENT); 
    365           /*STARTUPINFO strt; 
    366           // ZeroMemory is a macro that calls memset(), which isn't in the managed libs 
    367           // SecureZeroMemory calls a Win32 API to do its work 
    368           SecureZeroMemory(&strt,sizeof(STARTUPINFO)); 
    369           strt.cb = sizeof(STARTUPINFO); 
    370           strt.dwFlags = 0; 
    371           PROCESS_INFORMATION proc; 
    372           UINT ret = 0; 
    373  
    374           // DANGER WILL ROBINSON!!! DANGER!!! 
    375           // HARDCODED PATH!!! OH, THE HUMANITY!!! 
    376           if(CreateProcess(L"C:\\WINDOWS\\SYSTEM32\\msiexec.exe",code,NULL,NULL,FALSE,0,NULL,NULL,&strt,&proc)) 
    377           { 
    378           WaitForSingleObject(proc.hProcess,INFINITE); 
    379           DWORD code; 
    380           GetExitCodeProcess(proc.hProcess,&code); 
    381           ret = code; 
    382           CloseHandle(proc.hProcess); 
    383           CloseHandle(proc.hThread); 
    384           } 
    385           else 
    386           ret = GetLastError();*/ 
    387           Marshal::FreeHGlobal(code); 
    388360 
    389361          return ret;