Changeset 21679


Ignore:
Timestamp:
Sep 30, 2011, 5:58:09 PM (14 years ago)
Author:
dmik
Message:

odininst: Create "Program Files" in WINDOWSDIR instead of drive root.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/tools/install/odininst.cpp

    r21535 r21679  
    44 *
    55 *  Creates:
    6  *      - SYSTEMDIR\drivers
    7  *      - SYSTEMDIR\drivers\etc
     6 *  - SYSTEMDIR\drivers
     7 *  - SYSTEMDIR\drivers\etc
    88 *  - WINDOWSDIR\SYSTEM
    9  *      - WINDOWSDIR\AppData
    10  *      - WINDOWSDIR\Cache
    11  *      - WINDOWSDIR\Cookies
     9 *  - WINDOWSDIR\AppData
     10 *  - WINDOWSDIR\Cache
     11 *  - WINDOWSDIR\Cookies
    1212 *  - WINDOWSDIR\Desktop
    1313 *  - WINDOWSDIR\Favorites
    1414 *  - WINDOWSDIR\Fonts
    15  *      - WINDOWSDIR\History
     15 *  - WINDOWSDIR\History
    1616 *  - WINDOWSDIR\NetHood
    1717 *  - WINDOWSDIR\My Documents
     
    2323 *  - WINDOWSDIR\Start Menu\Programs\Startup
    2424 *  - WINDOWSDIR\ShellNew
    25  *      - x:\Program Files
    26  *      - x:\Program Files\Common Files
     25 *  - WINDOWSDIR\Program Files
     26 *  - WINDOWSDIR\Program Files\Common Files
    2727 *  - WINDOWSDIR\Temp
    2828 *  - and a minimal system registry
     
    593593    goto initreg_error;
    594594   }
    595    //Check if DIR_PROGRAM already created
    596    val = sizeof(shellpath);
    597    if (RegQueryValueEx(hkey, DIR_PROGRAM, 0, NULL, (LPBYTE)shellpath, &val) != ERROR_SUCCESS
    598        || GetFileAttributes( shellpath) == -1) {
    599       //Create x:\Program Files directory
    600       strcpy(shellpath, InternalGetWindowsDirectory());
    601       shellpath[2] = 0;    //get drive
    602       strcat(shellpath, "\\Program Files");
    603       CreateDirectory(shellpath, NULL);
    604       RegSetValueEx(hkey, DIR_PROGRAM, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    605 
    606       //Create x:\Program Files\Common Files directory
    607       strcat(shellpath, "\\Common Files");
    608       CreateDirectory(shellpath, NULL);
    609       RegSetValueEx(hkey, DIR_PROGRAM_COMMON, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    610    }
     595
     596   //Create Program Files directory
     597   strcpy(shellpath, InternalGetWindowsDirectory());
     598   strcat(shellpath, "\\Program Files");
     599   CreateDirectory(shellpath, NULL);
     600   RegSetValueEx(hkey, DIR_PROGRAM, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     601
     602   //Create Program Files\Common Files directory
     603   strcat(shellpath, "\\Common Files");
     604   CreateDirectory(shellpath, NULL);
     605   RegSetValueEx(hkey, DIR_PROGRAM_COMMON, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    611606
    612607   strcpy(shellpath, InternalGetWindowsDirectory());
     
    807802   strcpy(shellpath, InternalGetWindowsDirectory());
    808803   strcat(shellpath, "\\system.ini");
    809    
     804
    810805   if(GetPrivateProfileStringA(szMci, szCDAudio, szMciCDA, &temp, 0, shellpath) <= 1) {
    811806      WritePrivateProfileStringA(szMci, szCDAudio, szMciCDA, shellpath);
Note: See TracChangeset for help on using the changeset viewer.