Changeset 153


Ignore:
Timestamp:
3/9/2008 9:01:26 AM (7 years ago)
Author:
lowjoel
Message:

Added possibility of compiling a Portable version of Eraser

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Eraser.cpp

    r56 r153  
    112112    // end the execution of this instance. 
    113113 
     114#ifndef ERASER_STANDALONE 
    114115    { 
    115116        char temp[512]; 
     
    131132        } 
    132133    } 
    133 //  no_registry = true; 
     134#else 
     135    no_registry = true; 
     136#endif 
     137 
    134138    if (no_registry) { 
    135139        char temp[512]; 
  • trunk/EraserDoc.cpp

    r107 r153  
    136136    { 
    137137        // Create the Application Data path to store the Default ers file 
     138#ifndef ERASER_STANDALONE 
    138139        if (!SUCCEEDED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, m_strAppDataPath.GetBuffer(MAX_PATH)))) 
    139140            AfxMessageBox("Could not determine path to Application Data", MB_ICONERROR); 
    140141        m_strAppDataPath.ReleaseBuffer(); 
    141142        CreateDirectory((m_strAppDataPath += "\\") += szAppDataPath, NULL); 
     143#else 
     144        TCHAR moduleName[MAX_PATH]; 
     145        SetLastError(0); 
     146        DWORD charsWritten = GetModuleFileName(AfxGetInstanceHandle(), moduleName, MAX_PATH); 
     147        if (!charsWritten || GetLastError() != 0) 
     148            AfxMessageBox("Could not determine path to Application Data", MB_ICONERROR); 
     149 
     150        TCHAR drive[5]; 
     151        TCHAR dir[MAX_PATH]; 
     152        TCHAR ext[MAX_PATH]; 
     153        TCHAR filename[MAX_PATH]; 
     154        _splitpath(moduleName, drive, dir, filename, ext); 
     155        m_strAppDataPath = drive; 
     156        m_strAppDataPath += dir; 
     157#endif 
    142158 
    143159        // read preferences 
Note: See TracChangeset for help on using the changeset viewer.