Ignore:
Timestamp:
Aug 2, 2000, 1:20:29 AM (25 years ago)
Author:
sandervl
Message:

added program files & common files registry keys + dir creation for odininst

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/initsystem.cpp

    r3740 r3913  
    1 /* $Id: initsystem.cpp,v 1.10 2000-06-21 20:51:51 sandervl Exp $ */
     1/* $Id: initsystem.cpp,v 1.11 2000-08-01 23:20:29 sandervl Exp $ */
    22/*
    33 * Odin system initialization (registry, directories & environment)
     
    2424 *      - WINDOWSDIR\Start Menu\Programs\Startup
    2525 *      - WINDOWSDIR\ShellNew
     26 *      - x:\Program Files
     27 *      - x:\Program Files\Common Files
    2628 *      - and a minimal system registry
    2729 *
    28  * NOTE: Most of this has to be moved into the Odin install program!!!!!
     30 * Copyright 1999-2000 Sander van Leeuwen (sandervl@xs4all.nl)
    2931 *
    30  * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
    31  *
     32 * Project Odin Software License can be found in LICENSE.TXT
    3233 */
    3334
     
    6263#define THREAD_BOTH             "Both"
    6364#define INITREG_ERROR           "InitRegistry: Unable to register system information"
     65#define DIR_PROGRAM             "ProgramFilesDir"
     66#define DIR_PROGRAM_COMMON      "CommonFilesDir"
     67#define DIR_SHARED              "SharedDir"
    6468
    6569//******************************************************************************
     
    316320   RegCloseKey(hkey1);
    317321   RegCloseKey(hkey);
     322
     323   //[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion]
     324   //"ProgramFilesDir"="C:\Program Files"
     325   //"CommonFilesDir"="C:\Program Files\Common Files"
     326   //# This is intended for a centrally managed (server) directory where system files and e.g. fonts can reside. Most installs have this set to C:\WINDOWS, though.
     327   //"SharedDir"="C:\WINDOWS"
     328   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion",&hkey)!=ERROR_SUCCESS) {
     329        goto initreg_error;
     330   }
     331   //Create x:\Program Files directory
     332   strcpy(shellpath, InternalGetWindowsDirectoryA());
     333   shellpath[2] = 0;    //get drive
     334   strcat(shellpath, "\\Program Files");
     335   CreateDirectoryA(shellpath, NULL);
     336   RegSetValueExA(hkey, DIR_PROGRAM, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     337
     338   //Create x:\Program Files\Common Files directory
     339   strcat(shellpath, "\\Common Files");
     340   CreateDirectoryA(shellpath, NULL);
     341   RegSetValueExA(hkey, DIR_PROGRAM_COMMON, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     342
     343   strcpy(shellpath, InternalGetWindowsDirectoryA());
     344   RegSetValueExA(hkey, DIR_SHARED, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     345
     346   RegCloseKey(hkey);
     347
    318348   return TRUE;
    319349
Note: See TracChangeset for help on using the changeset viewer.