Ignore:
Timestamp:
Apr 29, 2000, 8:26:59 PM (25 years ago)
Author:
sandervl
Message:

init changes, export for installation program, create additional directories & registry keys, added lvl2 debug log feature, override for windows dir re-added

File:
1 edited

Legend:

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

    r3074 r3461  
    1 /* $Id: initsystem.cpp,v 1.8 2000-03-10 16:11:59 sandervl Exp $ */
     1/* $Id: initsystem.cpp,v 1.9 2000-04-29 18:26:58 sandervl Exp $ */
    22/*
    33 * Odin system initialization (registry & directories)
    44 *
     5 * Called from the WarpIn install program to create the desktop directories and
     6 * to setup the registry
     7 *
     8 * InitSystemAndRegistry creates:
     9 *      - WINDOWSDIR\SYSTEM
     10 *      - WINDOWSDIR\AppData
     11 *      - WINDOWSDIR\Cache
     12 *      - WINDOWSDIR\Cookies
     13 *      - WINDOWSDIR\Desktop
     14 *      - WINDOWSDIR\Favorites
     15 *      - WINDOWSDIR\Fonts
     16 *      - WINDOWSDIR\History
     17 *      - WINDOWSDIR\NetHood
     18 *      - WINDOWSDIR\My Documents
     19 *      - WINDOWSDIR\PrintHood
     20 *      - WINDOWSDIR\Recent
     21 *      - WINDOWSDIR\SendTo
     22 *      - WINDOWSDIR\Start Menu
     23 *      - WINDOWSDIR\Start Menu\Programs
     24 *      - WINDOWSDIR\Start Menu\Programs\Startup
     25 *      - WINDOWSDIR\ShellNew
     26 *      - and a minimal system registry
    527 *
    628 * NOTE: Most of this has to be moved into the Odin install program!!!!!
     
    2042#include "debugtools.h"
    2143#include "cpuhlp.h"
    22 #include "initsystem.h"
     44#include <odininst.h>
    2345#include "directory.h"
    2446#include <versionos2.h>
     
    4163#define INITREG_ERROR           "InitRegistry: Unable to register system information"
    4264
    43 BOOL InitRegistry();
    44 
    45 //******************************************************************************
    46 //******************************************************************************
    47 BOOL InitSystemEnvironment(ULONG nrCPUs)
    48 {
    49    InitSystemInfo(nrCPUs);
    50    return InitRegistry();
    51 }
     65//******************************************************************************
     66//******************************************************************************
    5267//******************************************************************************
    5368//[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows]
     
    6075BYTE ShutdownTime[] = {0x44,0x5e,0xf2,0xbb,0x84,0x41,0xbf,0x01};
    6176//******************************************************************************
    62 BOOL InitRegistry()
     77BOOL InitSystemAndRegistry()
    6378{
    6479 HKEY hkey, hkey1;
     
    127142//   if(RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey) != ERROR_SUCCESS)
    128143//   {
     144        //SYSTEM dir
     145        strcpy(shellpath, InternalGetWindowsDirectoryA());
     146        strcat(shellpath, "\\SYSTEM");
     147        CreateDirectoryA(shellpath, NULL);
     148
     149        //AppData
     150        strcpy(shellpath, InternalGetWindowsDirectoryA());
     151        strcat(shellpath, "\\Application Data");
     152        CreateDirectoryA(shellpath, NULL);
     153        RegSetValueExA(hkey,"AppData",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     154        //Cache
     155        strcpy(shellpath, InternalGetWindowsDirectoryA());
     156        strcat(shellpath, "\\Temporary Internet Files");
     157        CreateDirectoryA(shellpath, NULL);
     158        RegSetValueExA(hkey,"Cache",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     159        //Cookies
     160        strcpy(shellpath, InternalGetWindowsDirectoryA());
     161        strcat(shellpath, "\\Cookies");
     162        CreateDirectoryA(shellpath, NULL);
     163        RegSetValueExA(hkey,"Cookies",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     164        //Desktop
     165        strcpy(shellpath, InternalGetWindowsDirectoryA());
     166        strcat(shellpath, "\\Desktop");
     167        CreateDirectoryA(shellpath, NULL);
     168        RegSetValueExA(hkey,"Desktop",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     169        //Favorites
    129170        strcpy(shellpath, InternalGetWindowsDirectoryA());
    130171        strcat(shellpath, "\\Favorites");
    131172        CreateDirectoryA(shellpath, NULL);
    132173        RegSetValueExA(hkey,"Favorites",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    133         strcpy(shellpath, InternalGetWindowsDirectoryA());
    134         strcat(shellpath, "\\Programs\\Startup");
     174        //Fonts
     175        strcpy(shellpath, InternalGetWindowsDirectoryA());
     176        strcat(shellpath, "\\Fonts");
     177        CreateDirectoryA(shellpath, NULL);
     178        RegSetValueExA(hkey,"Fonts",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     179        //History
     180        strcpy(shellpath, InternalGetWindowsDirectoryA());
     181        strcat(shellpath, "\\History");
     182        CreateDirectoryA(shellpath, NULL);
     183        RegSetValueExA(hkey,"History",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     184        //NetHood
     185        strcpy(shellpath, InternalGetWindowsDirectoryA());
     186        strcat(shellpath, "\\NetHood");
     187        CreateDirectoryA(shellpath, NULL);
     188        RegSetValueExA(hkey,"NetHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     189        //Personal
     190        strcpy(shellpath, InternalGetWindowsDirectoryA());
     191        strcat(shellpath, "\\My Documents");
     192        CreateDirectoryA(shellpath, NULL);
     193        RegSetValueExA(hkey,"Personal",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     194        //PrintHood
     195        strcpy(shellpath, InternalGetWindowsDirectoryA());
     196        strcat(shellpath, "\\PrintHood");
     197        CreateDirectoryA(shellpath, NULL);
     198        RegSetValueExA(hkey,"PrintHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     199        //Recent
     200        strcpy(shellpath, InternalGetWindowsDirectoryA());
     201        strcat(shellpath, "\\Recent");
     202        CreateDirectoryA(shellpath, NULL);
     203        RegSetValueExA(hkey,"Recent",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     204        //SendTo
     205        strcpy(shellpath, InternalGetWindowsDirectoryA());
     206        strcat(shellpath, "\\SendTo");
     207        CreateDirectoryA(shellpath, NULL);
     208        RegSetValueExA(hkey,"SendTo",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     209        //Start Menu
     210        strcpy(shellpath, InternalGetWindowsDirectoryA());
     211        strcat(shellpath, "\\Start Menu");
     212        CreateDirectoryA(shellpath, NULL);
     213        RegSetValueExA(hkey,"Start Menu",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     214        //Programs
     215        strcpy(shellpath, InternalGetWindowsDirectoryA());
     216        strcat(shellpath, "\\Start Menu\\Programs");
     217        CreateDirectoryA(shellpath, NULL);
     218        RegSetValueExA(hkey,"Programs",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     219        //Startup
     220        strcat(shellpath, "\\Startup");
    135221        CreateDirectoryA(shellpath, NULL);
    136222        RegSetValueExA(hkey,"Startup",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    137         strcpy(shellpath, InternalGetWindowsDirectoryA());
    138         strcat(shellpath, "\\Desktop");
    139         CreateDirectoryA(shellpath, NULL);
    140         RegSetValueExA(hkey,"Desktop",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    141         strcpy(shellpath, InternalGetWindowsDirectoryA());
    142         strcat(shellpath, "\\Start Menu\\Programs");
    143         CreateDirectoryA(shellpath, NULL);
    144         RegSetValueExA(hkey,"Programs",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    145         strcpy(shellpath, InternalGetWindowsDirectoryA());
    146         strcat(shellpath, "\\Fonts");
    147         CreateDirectoryA(shellpath, NULL);
    148         RegSetValueExA(hkey,"Fonts",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    149         strcpy(shellpath, InternalGetWindowsDirectoryA());
    150         strcat(shellpath, "\\SendTo");
    151         CreateDirectoryA(shellpath, NULL);
    152         RegSetValueExA(hkey,"SendTo",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    153         strcpy(shellpath, InternalGetWindowsDirectoryA());
    154         strcat(shellpath, "\\Start Menu");
    155         CreateDirectoryA(shellpath, NULL);
    156         RegSetValueExA(hkey,"Start Menu",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     223        //ShellNew
    157224        strcpy(shellpath, InternalGetWindowsDirectoryA());
    158225        strcat(shellpath, "\\ShellNew");
    159226        CreateDirectoryA(shellpath, NULL);
    160227        RegSetValueExA(hkey,"Templates",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    161         strcpy(shellpath, InternalGetWindowsDirectoryA());
    162         strcat(shellpath, "\\Recent");
    163         CreateDirectoryA(shellpath, NULL);
    164         RegSetValueExA(hkey,"Recent",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    165         strcpy(shellpath, InternalGetWindowsDirectoryA());
    166         strcat(shellpath, "\\NetHood");
    167         CreateDirectoryA(shellpath, NULL);
    168         RegSetValueExA(hkey,"NetHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    169         strcpy(shellpath, InternalGetWindowsDirectoryA());
    170         strcat(shellpath, "\\My Documents");
    171         CreateDirectoryA(shellpath, NULL);
    172         RegSetValueExA(hkey,"Personal",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
    173228//   }
    174229   RegCloseKey(hkey);
Note: See TracChangeset for help on using the changeset viewer.