ReactOS 0.4.17-dev-357-ga8f14ff
wizard.c File Reference
#include "precomp.h"
#include <stdlib.h>
#include <time.h>
#include <winnls.h>
#include <windowsx.h>
#include <wincon.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <tzlib.h>
#include <strsafe.h>
#include <debug.h>
Include dependency graph for wizard.c:

Go to the source code of this file.

Classes

struct  _REGISTRATIONDATA
 
struct  _TIMEZONE_ENTRY
 
struct  _PRODUCT_OPTION_DATA
 
struct  ThemeInfo
 

Macros

#define NDEBUG
 
#define MAX_LAYOUTS_PER_LANGID   0x10000
 

Typedefs

typedef struct _REGISTRATIONDATA REGISTRATIONDATA
 
typedef struct _REGISTRATIONDATAPREGISTRATIONDATA
 
typedef struct _TIMEZONE_ENTRY TIMEZONE_ENTRY
 
typedef struct _TIMEZONE_ENTRYPTIMEZONE_ENTRY
 
typedef struct _PRODUCT_OPTION_DATA PRODUCT_OPTION_DATA
 
typedef DWORD(WINAPIPFNREQUESTWIZARDPAGES) (PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
 

Functions

void WINAPI Control_RunDLLW (HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
 
static VOID CenterWindow (HWND hWnd)
 
static HFONT CreateTitleFont (VOID)
 
static HFONT CreateBoldFont (VOID)
 
static INT_PTR CALLBACK GplDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK WelcomeDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK AckPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL DoWriteSoundEvents (HKEY hKey, LPCWSTR lpSubkey, LPCWSTR lpEventsArray[][2], DWORD dwSize)
 
static BOOL DoWriteInstallationType (INSTALLATION_TYPE nOption)
 
static void OnChooseInstallationType (HWND hwndDlg, INSTALLATION_TYPE nOption)
 
static INT_PTR CALLBACK InstallTypePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL WriteOwnerSettings (WCHAR *OwnerName, WCHAR *OwnerOrganization)
 
static INT_PTR CALLBACK OwnerPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL WriteComputerSettings (WCHAR *ComputerName, HWND hwndDlg)
 
static BOOL WriteDefaultLogonData (LPWSTR Domain)
 
static void GenerateComputerName (LPWSTR lpBuffer)
 
static INT_PTR CALLBACK ComputerPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID SetUserLocaleName (HWND hwnd)
 
static VOID SetKeyboardLayoutName (HWND hwnd)
 
static BOOL RunControlPanelApplet (HWND hwnd, PCWSTR pwszCPLParameters)
 
VOID EnableVisualTheme (_In_opt_ HWND hwndParent, _In_opt_ PCWSTR ThemeFile)
 
static VOID WriteUserLocale (VOID)
 
static INT_PTR CALLBACK LocalePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry (PSETUPDATA SetupData, DWORD Index)
 
static LONG RetrieveTimeZone (IN HKEY hZoneKey, IN PVOID Context)
 
static VOID CreateTimeZoneList (PSETUPDATA SetupData)
 
static VOID DestroyTimeZoneList (PSETUPDATA SetupData)
 
static BOOL HasDaylightSavingTime (PTIMEZONE_ENTRY Entry)
 
static PTIMEZONE_ENTRY GetSelectedTimeZoneEntry (PSETUPDATA SetupData, DWORD dwEntryIndex)
 
static PTIMEZONE_ENTRY GetTimeZoneEntryByIndex (PSETUPDATA SetupData, DWORD dwComboIndex)
 
static VOID UpdateAutoDaylightCheckbox (HWND hwndDlg, PTIMEZONE_ENTRY Entry)
 
static VOID ShowTimeZoneList (HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
 
static VOID SetLocalTimeZone (HWND hwnd, PSETUPDATA SetupData)
 
static BOOL GetLocalSystemTime (HWND hwnd, PSETUPDATA SetupData)
 
static BOOL SetSystemLocalTime (HWND hwnd, PSETUPDATA SetupData)
 
static VOID UpdateLocalSystemTime (HWND hwnd, SYSTEMTIME LocalTime)
 
static BOOL WriteDateTimeSettings (HWND hwndDlg, PSETUPDATA SetupData)
 
static INT_PTR CALLBACK DateTimePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK ThemePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static UINT CALLBACK RegistrationNotificationProc (PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
 
static DWORD RegisterDlls (_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
 
static VOID RegisterComponents (PITEMSDATA pItemsData)
 
static VOID SaveSettings (PITEMSDATA pItemsData)
 
static DWORD CALLBACK ItemCompletionThread (LPVOID Parameter)
 
static BOOL RunItemCompletionThread (_In_ HWND hwndDlg)
 
static VOID ShowItemError (HWND hwndDlg, DWORD LastError)
 
static VOID ShowStepError (HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
 
static INT_PTR CALLBACK ProcessPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID SetInstallationCompleted (VOID)
 
static INT_PTR CALLBACK FinishDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL GetInstallSourceWin32 (OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
 
VOID ProcessUnattendSection (IN OUT PSETUPDATA pSetupData)
 
static BOOL PathIsEqual (IN LPCWSTR lpPath1, IN LPCWSTR lpPath2)
 
static VOID AddInstallationSource (IN HKEY hKey, IN LPWSTR lpPath)
 
VOID ProcessSetupInf (IN OUT PSETUPDATA pSetupData)
 
VOID InstallWizard (VOID)
 

Variables

static const WCHAR s_szProductOptions [] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions"
 
static const WCHAR s_szRosVersion [] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version"
 
static const WCHAR s_szControlWindows [] = L"SYSTEM\\CurrentControlSet\\Control\\Windows"
 
static const WCHAR s_szWinlogon [] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
 
static const WCHAR s_szDefaultSoundEvents [] = L"AppEvents\\Schemes\\Apps\\.Default"
 
static const WCHAR s_szExplorerSoundEvents [] = L"AppEvents\\Schemes\\Apps\\Explorer"
 
static const WCHAR s_szCurrentVersion [] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"
 
static const PRODUCT_OPTION_DATA s_ProductOptionData [INSTALLATION_TYPE_MAX]
 
static const WCHARInstallationTypes [INSTALLATION_TYPE_MAX]
 
static const WCHARs_DefaultSoundEvents [][2]
 
static const WCHARs_ExplorerSoundEvents [][2]
 
static struct ThemeInfo Themes []
 

Macro Definition Documentation

◆ MAX_LAYOUTS_PER_LANGID

#define MAX_LAYOUTS_PER_LANGID   0x10000

◆ NDEBUG

#define NDEBUG

Definition at line 27 of file wizard.c.

Typedef Documentation

◆ PFNREQUESTWIZARDPAGES

typedef DWORD(WINAPI * PFNREQUESTWIZARDPAGES) (PDWORD, HPROPSHEETPAGE *, PSETUPDATA)

Definition at line 3455 of file wizard.c.

◆ PREGISTRATIONDATA

◆ PRODUCT_OPTION_DATA

◆ PTIMEZONE_ENTRY

◆ REGISTRATIONDATA

◆ TIMEZONE_ENTRY

Function Documentation

◆ AckPageDlgProc()

static INT_PTR CALLBACK AckPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 286 of file wizard.c.

290{
291 LPNMHDR lpnm;
292 PWCHAR Projects;
293 PWCHAR End, CurrentProject;
294 INT ProjectsSize, ProjectsCount;
295 PSETUPDATA pSetupData;
296
297 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
298
299 switch (uMsg)
300 {
301 case WM_INITDIALOG:
302 {
303 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
304 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
305
306 Projects = NULL;
307 ProjectsSize = 256;
308 while (TRUE)
309 {
310 Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
311 if (NULL == Projects)
312 {
313 return FALSE;
314 }
315 ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
316 if (0 == ProjectsCount)
317 {
318 HeapFree(GetProcessHeap(), 0, Projects);
319 return FALSE;
320 }
321 if (ProjectsCount < ProjectsSize - 1)
322 {
323 break;
324 }
325 HeapFree(GetProcessHeap(), 0, Projects);
326 ProjectsSize *= 2;
327 }
328
329 CurrentProject = Projects;
330 while (*CurrentProject != L'\0')
331 {
332 End = wcschr(CurrentProject, L'\n');
333 if (NULL != End)
334 {
335 *End = L'\0';
336 }
337 (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
338 if (NULL != End)
339 {
340 CurrentProject = End + 1;
341 }
342 else
343 {
344 CurrentProject += wcslen(CurrentProject);
345 }
346 }
347 HeapFree(GetProcessHeap(), 0, Projects);
348 }
349 break;
350
351 case WM_COMMAND:
353 {
356 }
357 break;
358
359 case WM_NOTIFY:
360 {
361 lpnm = (LPNMHDR)lParam;
362
363 switch (lpnm->code)
364 {
365 case PSN_SETACTIVE:
366 /* Enable the Back and Next buttons */
368 if (pSetupData->UnattendSetup)
369 {
371 return TRUE;
372 }
373 break;
374
375 case PSN_WIZBACK:
376 pSetupData->UnattendSetup = FALSE;
377 break;
378
379 default:
380 break;
381 }
382 }
383 break;
384
385 default:
386 break;
387 }
388
389 return FALSE;
390}
struct _SETUPDATA * PSETUPDATA
static HINSTANCE hDllInstance
Definition: clb.c:9
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define IDC_VIEWGPL
Definition: resource.h:46
#define IDD_INSTALLATION
Definition: resource.h:109
#define IDD_GPL
Definition: resource.h:92
#define IDC_PROJECTS
Definition: resource.h:45
#define IDS_ACKPROJECTS
Definition: resource.h:137
#define L(x)
Definition: resources.c:13
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSWIZB_BACK
Definition: prsht.h:153
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZBACK
Definition: prsht.h:120
#define PSN_SETACTIVE
Definition: prsht.h:115
#define WM_NOTIFY
Definition: richedit.h:61
#define LoadStringW
Definition: utils.h:64
BOOL UnattendSetup
Definition: syssetup.h:50
UINT code
Definition: winuser.h:3267
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:122
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
#define HIWORD(l)
Definition: typedefs.h:247
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:472
#define DWLP_USER
Definition: winuser.h:883
#define WM_COMMAND
Definition: winuser.h:1768
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define WM_INITDIALOG
Definition: winuser.h:1767
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define BN_CLICKED
Definition: winuser.h:1954
#define DialogBox
Definition: winuser.h:5927

Referenced by InstallWizard().

◆ AddInstallationSource()

static VOID AddInstallationSource ( IN HKEY  hKey,
IN LPWSTR  lpPath 
)
static

Definition at line 3232 of file wizard.c.

3235{
3236 LONG res;
3237 DWORD dwRegType;
3238 DWORD dwPathLength = 0;
3239 DWORD dwNewLength = 0;
3240 LPWSTR Buffer = NULL;
3241 LPWSTR Path;
3242
3244 hKey,
3245 L"Installation Sources",
3246 NULL,
3247 &dwRegType,
3248 NULL,
3249 &dwPathLength);
3250
3251 if (res != ERROR_SUCCESS ||
3252 dwRegType != REG_MULTI_SZ ||
3253 dwPathLength == 0 ||
3254 dwPathLength % sizeof(WCHAR) != 0)
3255 {
3256 dwPathLength = 0;
3257 goto set;
3258 }
3259
3260 /* Reserve space for existing data + new string */
3261 dwNewLength = dwPathLength + (wcslen(lpPath) + 1) * sizeof(WCHAR);
3262 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3263 if (!Buffer)
3264 return;
3265
3266 ZeroMemory(Buffer, dwNewLength);
3267
3269 hKey,
3270 L"Installation Sources",
3271 NULL,
3272 NULL,
3273 (LPBYTE)Buffer,
3274 &dwPathLength);
3275
3276 if (res != ERROR_SUCCESS)
3277 {
3279 dwPathLength = 0;
3280 goto set;
3281 }
3282
3283 /* Sanity check, these should already be zeros */
3284 Buffer[dwPathLength / sizeof(WCHAR) - 2] = UNICODE_NULL;
3285 Buffer[dwPathLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3286
3287 for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
3288 {
3289 /* Check if path is already added */
3290 if (PathIsEqual(Path, lpPath))
3291 goto cleanup;
3292 }
3293
3294 Path = Buffer + dwPathLength / sizeof(WCHAR) - 1;
3295
3296set:
3297 if (dwPathLength == 0)
3298 {
3299 dwNewLength = (wcslen(lpPath) + 1 + 1) * sizeof(WCHAR);
3300 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3301 if (!Buffer)
3302 return;
3303
3304 Path = Buffer;
3305 }
3306
3307 StringCbCopyW(Path, dwNewLength - (Path - Buffer) * sizeof(WCHAR), lpPath);
3308 Buffer[dwNewLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3309
3311 hKey,
3312 L"Installation Sources",
3313 0,
3315 (LPBYTE)Buffer,
3316 dwNewLength);
3317
3318cleanup:
3320}
PRTL_UNICODE_STRING_BUFFER Path
Definition: bufpool.h:45
Definition: _set.h:50
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
static void cleanup(void)
Definition: main.c:1335
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint res
Definition: glext.h:9613
#define ZeroMemory
Definition: minwinbase.h:31
#define REG_MULTI_SZ
Definition: nt_native.h:1504
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
static BOOL PathIsEqual(IN LPCWSTR lpPath1, IN LPCWSTR lpPath2)
Definition: wizard.c:3206
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by ProcessSetupInf().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 56 of file wizard.c.

57{
59 RECT rcParent;
60 RECT rcWindow;
61
63 if (hWndParent == NULL)
65
66 GetWindowRect(hWndParent, &rcParent);
67 GetWindowRect(hWnd, &rcWindow);
68
71 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
72 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
73 0,
74 0,
76}
HWND hWnd
Definition: settings.c:17
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1256
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define HWND_TOP
Definition: winuser.h:1218

◆ ComputerPageDlgProc()

static INT_PTR CALLBACK ComputerPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1121 of file wizard.c.

1125{
1126 WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1127 WCHAR Password1[128];
1128 WCHAR Password2[128];
1130 WCHAR Title[64];
1131 WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
1132 LPNMHDR lpnm;
1133 PSETUPDATA pSetupData;
1134
1135 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1136
1138 {
1139 wcscpy(Title, L"ReactOS Setup");
1140 }
1141
1142 switch (uMsg)
1143 {
1144 case WM_INITDIALOG:
1145 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1146 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
1147
1148 /* Generate a new pseudo-random computer name */
1149 GenerateComputerName(ComputerName);
1150
1151 /* Display current computer name */
1152 SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
1153
1154 /* Set text limits */
1158
1159 /* Set focus to computer name */
1161 if (pSetupData->UnattendSetup)
1162 {
1168 }
1169
1170 /* Store the administrator account name as the default user name */
1172 break;
1173
1174
1175 case WM_NOTIFY:
1176 {
1177 lpnm = (LPNMHDR)lParam;
1178
1179 switch (lpnm->code)
1180 {
1181 case PSN_SETACTIVE:
1182 /* Enable the Back and Next buttons */
1184 if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
1185 {
1187 return TRUE;
1188 }
1189 break;
1190
1191 case PSN_WIZNEXT:
1192 if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
1193 {
1194 if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
1195 ARRAYSIZE(EmptyComputerName)))
1196 {
1197 wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
1198 }
1199 MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
1201 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1202 return TRUE;
1203 }
1204
1205 /* No need to check computer name for invalid characters,
1206 * SetComputerName() will do it for us */
1207
1208 if (!WriteComputerSettings(ComputerName, hwndDlg))
1209 {
1211 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1212 return TRUE;
1213 }
1214
1215#ifdef PASSWORDS_MANDATORY
1216 /* Check if admin passwords have been entered */
1217 if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
1218 (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1219 {
1220 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1221 ARRAYSIZE(EmptyPassword)))
1222 {
1223 wcscpy(EmptyPassword, L"You must enter a password !");
1224 }
1225 MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1226 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1227 return TRUE;
1228 }
1229#else
1230 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1231 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1232#endif
1233 /* Check if passwords match */
1234 if (wcscmp(Password1, Password2))
1235 {
1236 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1237 ARRAYSIZE(NotMatchPassword)))
1238 {
1239 wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1240 }
1241 MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1242 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1243 return TRUE;
1244 }
1245
1246 /* Check password for invalid characters */
1247 Password = (PWCHAR)Password1;
1248 while (*Password)
1249 {
1250 if (!isprint(*Password))
1251 {
1252 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1253 ARRAYSIZE(WrongPassword)))
1254 {
1255 wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1256 }
1257 MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1258 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1259 return TRUE;
1260 }
1261 Password++;
1262 }
1263
1264 /* Set admin password */
1265 SetAdministratorPassword(Password1);
1266 break;
1267
1268 case PSN_WIZBACK:
1269 pSetupData->UnattendSetup = FALSE;
1270 break;
1271
1272 default:
1273 break;
1274 }
1275 }
1276 break;
1277
1278 default:
1279 break;
1280 }
1281
1282 return FALSE;
1283}
#define isprint(c)
Definition: acclib.h:73
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define IDS_REACTOS_SETUP
Definition: resource.h:140
static const WCHAR Title[]
Definition: oid.c:1259
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
#define IDC_COMPUTERNAME
Definition: resource.h:15
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:1692
#define IDC_ADMINPASSWORD2
Definition: resource.h:55
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:152
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:154
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:155
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:153
#define IDC_ADMINPASSWORD1
Definition: resource.h:54
LONG_PTR LPARAM
Definition: minwindef.h:175
#define PSN_WIZNEXT
Definition: prsht.h:121
wcscpy
WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH+1]
Definition: syssetup.h:48
WCHAR AdminPassword[128]
Definition: syssetup.h:49
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:1051
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:1103
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:980
@ Password
Definition: telnetd.h:67
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:268
#define EM_LIMITTEXT
Definition: winuser.h:2029
#define GetDlgItemText
Definition: winuser.h:5951
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:798
#define WM_SETTEXT
Definition: winuser.h:1645
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SendMessage
Definition: winuser.h:6009
#define MB_OK
Definition: winuser.h:801
#define SendDlgItemMessage
Definition: winuser.h:6008

Referenced by InstallWizard().

◆ Control_RunDLLW()

void WINAPI Control_RunDLLW ( HWND  hWnd,
HINSTANCE  hInst,
LPCWSTR  cmd,
DWORD  nCmdShow 
)

Definition at line 1177 of file control.c.

1178{
1179 CPanel panel;
1180
1181 TRACE("(%p, %p, %s, 0x%08x)\n",
1182 hWnd, hInst, debugstr_w(cmd), nCmdShow);
1183
1184#ifndef __REACTOS__
1185 memset(&panel, 0, sizeof(panel));
1186 list_init( &panel.applets );
1187#endif
1188
1189 if (!cmd || !*cmd) {
1190 Control_DoWindow(&panel, hWnd, hInst);
1191 } else {
1192 Control_DoLaunch(&panel, hWnd, cmd);
1193 }
1194}
static void list_init(struct list_entry *head)
Definition: list.h:51
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:703
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:867
HINSTANCE hInst
Definition: dxdiag.c:13
#define debugstr_w
Definition: kernel32.h:32
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cpanel.h:56
struct list applets
Definition: cpanel.h:57
Definition: ftp_var.h:139

Referenced by FinishDlgProc().

◆ CreateBoldFont()

static HFONT CreateBoldFont ( VOID  )
static

Definition at line 101 of file wizard.c.

102{
103 LOGFONTW tmpFont = {0};
104 HFONT hBoldFont;
105 HDC hDc;
106
107 /* Grabs the Drawing Context */
108 hDc = GetDC(NULL);
109
110 tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
111 tmpFont.lfWeight = FW_BOLD;
112 wcscpy(tmpFont.lfFaceName, L"MS Shell Dlg");
113
114 hBoldFont = CreateFontIndirectW(&tmpFont);
115
116 ReleaseDC(NULL, hDc);
117
118 return hBoldFont;
119}
static HDC
Definition: imagelist.c:88
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by InstallWizard().

◆ CreateTimeZoneList()

static VOID CreateTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1735 of file wizard.c.

1736{
1738}
SETUPDATA SetupData
Definition: reactos.c:24
static LONG RetrieveTimeZone(IN HKEY hZoneKey, IN PVOID Context)
Definition: wizard.c:1654
VOID EnumerateTimeZoneList(IN PENUM_TIMEZONE_CALLBACK Callback, IN PVOID Context OPTIONAL)
Definition: tzlib.c:223

Referenced by DateTimePageDlgProc().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 80 of file wizard.c.

81{
82 LOGFONTW LogFont = {0};
83 HDC hdc;
84 HFONT hFont;
85
86 LogFont.lfWeight = FW_BOLD;
87 wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
88
89 hdc = GetDC(NULL);
90 LogFont.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
91
92 hFont = CreateFontIndirectW(&LogFont);
93
95
96 return hFont;
97}
HFONT hFont
Definition: main.c:53
HDC hdc
Definition: main.c:9

◆ DateTimePageDlgProc()

static INT_PTR CALLBACK DateTimePageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1968 of file wizard.c.

1972{
1974
1975 /* Retrieve pointer to the global setup data */
1977
1978 switch (uMsg)
1979 {
1980 case WM_INITDIALOG:
1981 {
1982 DWORD dwEntryIndex;
1984
1985 /* Save pointer to the global setup data */
1988
1990
1992 {
1995
1998 {
2001 }
2002 else
2003 {
2006 }
2007 }
2008 else
2009 {
2010 /* Get the default time zone index from the registry */
2011 dwEntryIndex = (DWORD)-1;
2012 GetTimeZoneListIndex(&dwEntryIndex);
2013
2015 SetupData, -1);
2016
2017 /* Set the auto-daylight checkbox based on whether
2018 * the selected timezone observes DST */
2019 Entry = GetSelectedTimeZoneEntry(SetupData, dwEntryIndex);
2021 }
2022 break;
2023 }
2024
2025 case WM_TIMER:
2026 {
2027 SYSTEMTIME LocalTime;
2028
2029 GetLocalTime(&LocalTime);
2030 UpdateLocalSystemTime(hwndDlg, LocalTime);
2031
2032 // Reset timeout.
2033 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
2034 break;
2035 }
2036
2037 case WM_COMMAND:
2039 {
2040 /* User changed the timezone selection */
2041 DWORD dwIndex = (DWORD)SendDlgItemMessage(hwndDlg, IDC_TIMEZONELIST, CB_GETCURSEL, 0, 0);
2044 }
2045 break;
2046
2047 case WM_NOTIFY:
2048 switch (((LPNMHDR)lParam)->code)
2049 {
2050 case PSN_SETACTIVE:
2051 {
2052 SYSTEMTIME LocalTime;
2053
2054 GetLocalTime(&LocalTime);
2055 UpdateLocalSystemTime(hwndDlg, LocalTime);
2056
2057 /* Enable the Back and Next buttons */
2059
2061 {
2063 return TRUE;
2064 }
2065
2066 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
2067 break;
2068 }
2069
2070 case PSN_KILLACTIVE:
2071 case DTN_DATETIMECHANGE:
2072 // NB: Not re-set until changing page (PSN_SETACTIVE).
2073 KillTimer(hwndDlg, 1);
2074 break;
2075
2076 case PSN_WIZNEXT:
2078 break;
2079
2080 case PSN_WIZBACK:
2082 break;
2083
2084 default:
2085 break;
2086 }
2087 break;
2088
2089 case WM_DESTROY:
2091 break;
2092
2093 default:
2094 break;
2095 }
2096
2097 return FALSE;
2098}
#define IDC_TIMEZONELIST
Definition: resource.h:16
#define IDC_AUTODAYLIGHT
Definition: resource.h:17
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:272
#define IDD_THEMEPAGE
Definition: resource.h:89
#define EnableDlgItem(hDlg, nID, bEnable)
Definition: eventvwr.h:55
UINT_PTR WPARAM
Definition: minwindef.h:174
#define DWORD
Definition: nt_native.h:44
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4371
Entry
Definition: section.c:5216
DWORD TimeZoneIndex
Definition: syssetup.h:56
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:57
WORD wMilliseconds
Definition: minwinbase.h:263
Definition: timezone.c:16
Definition: inflate.c:139
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1735
static VOID UpdateLocalSystemTime(HWND hwnd, SYSTEMTIME LocalTime)
Definition: wizard.c:1929
static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
Definition: wizard.c:1937
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1741
static PTIMEZONE_ENTRY GetSelectedTimeZoneEntry(PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1772
static PTIMEZONE_ENTRY GetTimeZoneEntryByIndex(PSETUPDATA SetupData, DWORD dwComboIndex)
Definition: wizard.c:1786
static BOOL HasDaylightSavingTime(PTIMEZONE_ENTRY Entry)
Definition: wizard.c:1763
static VOID UpdateAutoDaylightCheckbox(HWND hwndDlg, PTIMEZONE_ENTRY Entry)
Definition: wizard.c:1797
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1810
#define GWLP_USERDATA
Definition: treelist.c:63
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL GetTimeZoneListIndex(IN OUT PULONG pIndex)
Definition: tzlib.c:20
#define BST_UNCHECKED
Definition: winuser.h:199
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define BM_SETCHECK
Definition: winuser.h:1950
#define WM_TIMER
Definition: winuser.h:1770
#define WM_DESTROY
Definition: winuser.h:1637
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define CB_GETCURSEL
Definition: winuser.h:1972
#define BST_CHECKED
Definition: winuser.h:197

Referenced by InstallWizard().

◆ DestroyTimeZoneList()

static VOID DestroyTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1741 of file wizard.c.

1742{
1744
1745 while (SetupData->TimeZoneListHead != NULL)
1746 {
1748
1751 {
1753 }
1754
1756 }
1757
1759}
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:54
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:55

Referenced by DateTimePageDlgProc().

◆ DoWriteInstallationType()

static BOOL DoWriteInstallationType ( INSTALLATION_TYPE  nOption)
static

Definition at line 545 of file wizard.c.

546{
547 HKEY hKey;
548 LONG error;
549 LPCWSTR pszData;
550 DWORD dwValue, cbData;
552 ASSERT(0 <= nOption && nOption < INSTALLATION_TYPE_MAX);
553
554 /* open ProductOptions key */
556 if (error)
557 {
558 DPRINT1("RegOpenKeyExW failed\n");
559 goto Error;
560 }
561
562 /* write ProductSuite */
563 pszData = pData->ProductSuite;
564 cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
565 error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
566 if (error)
567 {
568 DPRINT1("RegSetValueExW failed\n");
569 goto Error;
570 }
571
572 /* write ProductType */
573 pszData = pData->ProductType;
574 cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
575 error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
576 if (error)
577 {
578 DPRINT1("RegSetValueExW failed\n");
579 goto Error;
580 }
581
583
584 /* open ReactOS version key */
586 if (error)
587 {
588 DPRINT1("RegOpenKeyExW failed\n");
589 goto Error;
590 }
591
592 /* write ReportAsWorkstation */
593 dwValue = pData->ReportAsWorkstation;
594 cbData = sizeof(dwValue);
595 error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
596 if (error)
597 {
598 DPRINT1("RegSetValueExW failed\n");
599 goto Error;
600 }
601
603
604 /* open Control Windows key */
606 if (error)
607 {
608 DPRINT1("RegOpenKeyExW failed\n");
609 goto Error;
610 }
611
612 /* write Control Windows CSDVersion */
613 dwValue = pData->CSDVersion;
614 cbData = sizeof(dwValue);
615 error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
616 if (error)
617 {
618 DPRINT1("RegSetValueExW failed\n");
619 goto Error;
620 }
621
623
624 /* open Winlogon key */
626 if (error)
627 {
628 DPRINT1("RegOpenKeyExW failed\n");
629 goto Error;
630 }
631
632 /* write LogonType */
633 dwValue = pData->LogonType;
634 cbData = sizeof(dwValue);
635 error = RegSetValueExW(hKey, L"LogonType", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
636 if (error)
637 {
638 DPRINT1("RegSetValueExW failed\n");
639 goto Error;
640 }
641
642 if (nOption == INSTALLATION_TYPE_WORKSTATION)
643 {
644 /* Write system sound events values for Workstation */
647 }
648
649 if (nOption == INSTALLATION_TYPE_SERVER_CORE)
650 {
651 /* Set the shell to command prompt */
652 WCHAR szShell[] = L"cmd.exe";
653 cbData = sizeof(szShell);
654 error = RegSetValueExW(hKey, L"Shell", 0, REG_SZ, (const BYTE *)szShell, cbData);
655 if (error)
656 {
657 DPRINT1("RegSetValueExW failed\n");
658 goto Error;
659 }
660 }
661
662 /* Open InstallationType key and write InstallationType value */
664 if (error)
665 {
666 DPRINT1("RegOpenKeyExW failed\n");
667 goto Error;
668 }
669
670 cbData = (DWORD)((wcslen(InstallationTypes[nOption]) + 1) * sizeof(WCHAR));
671 error = RegSetValueExW(hKey, L"InstallationType", 0, REG_SZ, (const BYTE *)InstallationTypes[nOption], cbData);
672 if (error)
673 {
674 DPRINT1("RegSetValueExW failed\n");
675 goto Error;
676 }
677
678Error:
679 if (hKey)
681
682 return error == ERROR_SUCCESS;
683}
#define DPRINT1
Definition: precomp.h:8
BOOL Error
Definition: chkdsk.c:66
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define lstrlenW
Definition: compat.h:750
#define REG_SZ
Definition: layer.c:22
#define error(str)
Definition: mkdosfs.c:1605
#define ASSERT(a)
Definition: mode.c:44
#define KEY_WRITE
Definition: nt_native.h:1034
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
#define REG_DWORD
Definition: sdbapi.c:615
#define _countof(array)
Definition: sndvol32.h:70
static const WCHAR * s_ExplorerSoundEvents[][2]
Definition: wizard.c:455
static BOOL DoWriteSoundEvents(HKEY hKey, LPCWSTR lpSubkey, LPCWSTR lpEventsArray[][2], DWORD dwSize)
Definition: wizard.c:462
static const WCHAR s_szRosVersion[]
Definition: wizard.c:393
static const WCHAR * InstallationTypes[INSTALLATION_TYPE_MAX]
Definition: wizard.c:417
static const WCHAR s_szWinlogon[]
Definition: wizard.c:395
static const PRODUCT_OPTION_DATA s_ProductOptionData[INSTALLATION_TYPE_MAX]
Definition: wizard.c:409
static const WCHAR * s_DefaultSoundEvents[][2]
Definition: wizard.c:425
static const WCHAR s_szCurrentVersion[]
Definition: wizard.c:398
static const WCHAR s_szExplorerSoundEvents[]
Definition: wizard.c:397
static const WCHAR s_szProductOptions[]
Definition: wizard.c:392
static const WCHAR s_szControlWindows[]
Definition: wizard.c:394
static const WCHAR s_szDefaultSoundEvents[]
Definition: wizard.c:396
@ INSTALLATION_TYPE_SERVER_CORE
Definition: syssetup.h:30
@ INSTALLATION_TYPE_WORKSTATION
Definition: syssetup.h:29
@ INSTALLATION_TYPE_MAX
Definition: syssetup.h:32
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
unsigned char BYTE
Definition: xxhash.c:193

Referenced by InstallTypePageDlgProc().

◆ DoWriteSoundEvents()

static BOOL DoWriteSoundEvents ( HKEY  hKey,
LPCWSTR  lpSubkey,
LPCWSTR  lpEventsArray[][2],
DWORD  dwSize 
)
static

Definition at line 462 of file wizard.c.

466{
467 HKEY hRootKey, hEventKey, hDefaultKey;
468 LONG error;
469 ULONG i;
470 WCHAR szDest[MAX_PATH];
471 DWORD dwAttribs;
473
474 /* Open the sound events key */
475 error = RegOpenKeyExW(hKey, lpSubkey, 0, KEY_READ, &hRootKey);
476 if (error)
477 {
478 DPRINT1("RegOpenKeyExW failed\n");
479 goto Error;
480 }
481
482 /* Set each sound event */
483 for (i = 0; i < dwSize; i++)
484 {
485 /*
486 * Verify that the sound file exists and is an actual file.
487 */
488
489 /* Expand the sound file path */
490 if (!ExpandEnvironmentStringsW(lpEventsArray[i][1], szDest, _countof(szDest)))
491 {
492 /* Failed to expand, continue with the next sound event */
493 continue;
494 }
495
496 /* Check if the sound file exists and isn't a directory */
497 dwAttribs = GetFileAttributesW(szDest);
498 if ((dwAttribs == INVALID_FILE_ATTRIBUTES) ||
499 (dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
500 {
501 /* It does not, just continue with the next sound event */
502 continue;
503 }
504
505 /*
506 * Create the sound event entry.
507 */
508
509 /* Open the sound event subkey */
510 error = RegOpenKeyExW(hRootKey, lpEventsArray[i][0], 0, KEY_READ, &hEventKey);
511 if (error)
512 {
513 /* Failed to open, continue with next sound event */
514 continue;
515 }
516
517 /* Open .Default subkey */
518 error = RegOpenKeyExW(hEventKey, L".Default", 0, KEY_WRITE, &hDefaultKey);
519 RegCloseKey(hEventKey);
520 if (error)
521 {
522 /* Failed to open, continue with next sound event */
523 continue;
524 }
525
526 /* Associate the sound file to this sound event */
527 cbData = (lstrlenW(lpEventsArray[i][1]) + 1) * sizeof(WCHAR);
528 error = RegSetValueExW(hDefaultKey, NULL, 0, REG_EXPAND_SZ, (const BYTE *)lpEventsArray[i][1], cbData);
529 RegCloseKey(hDefaultKey);
530 if (error)
531 {
532 /* Failed to set the value, continue with next sound event */
533 continue;
534 }
535 }
536
537Error:
538 if (hRootKey)
539 RegCloseKey(hRootKey);
540
541 return error == ERROR_SUCCESS;
542}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:492
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_READ
Definition: nt_native.h:1026
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
uint32_t ULONG
Definition: typedefs.h:59
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by DoWriteInstallationType().

◆ EnableVisualTheme()

VOID EnableVisualTheme ( _In_opt_ HWND  hwndParent,
_In_opt_ PCWSTR  ThemeFile 
)

Definition at line 1448 of file wizard.c.

1451{
1452 enum { THEME_FILE, STYLE_FILE, UNKNOWN } fType;
1453 WCHAR szPath[MAX_PATH]; // Expanded path of the file to use.
1454 WCHAR szStyleFile[MAX_PATH];
1455
1456 fType = THEME_FILE; // Default to Classic theme.
1457 if (ThemeFile)
1458 {
1459 /* Expand the path if possible */
1460 if (ExpandEnvironmentStringsW(ThemeFile, szPath, _countof(szPath)) != 0)
1461 ThemeFile = szPath;
1462
1463 /* Determine the file type from its extension */
1464 fType = UNKNOWN; {
1465 PCWSTR pszExt = wcsrchr(ThemeFile, L'.'); // PathFindExtensionW(ThemeFile);
1466 if (pszExt)
1467 {
1468 if (_wcsicmp(pszExt, L".theme") == 0)
1469 fType = THEME_FILE;
1470 else if (_wcsicmp(pszExt, L".msstyles") == 0)
1471 fType = STYLE_FILE;
1472 } }
1473 if (fType == UNKNOWN)
1474 {
1475 DPRINT1("EnableVisualTheme(): Unknown file '%S'\n", ThemeFile);
1476 return;
1477 }
1478 }
1479
1480 DPRINT1("Applying visual %s '%S'\n",
1481 (fType == THEME_FILE) ? "theme" : "style",
1482 ThemeFile ? ThemeFile : L"(Classic)");
1483
1484//
1485// TODO: Use instead uxtheme!SetSystemVisualStyle() once it is implemented,
1486// https://stackoverflow.com/a/1036903
1487// https://pinvoke.net/default.aspx/uxtheme.SetSystemVisualStyle
1488// or ApplyTheme(NULL, 0, NULL) for restoring the classic theme.
1489//
1490// NOTE: The '/Action:ActivateMSTheme' is ReactOS-specific.
1491//
1492
1493 if (ThemeFile && (fType == THEME_FILE))
1494 {
1495 /* Retrieve the visual style specified in the theme file.
1496 * If none, fall back to the classic theme. */
1497 if (GetPrivateProfileStringW(L"VisualStyles", L"Path", NULL,
1498 szStyleFile, _countof(szStyleFile), ThemeFile) && *szStyleFile)
1499 {
1500 /* Expand the path if possible */
1501 ThemeFile = szStyleFile;
1502 if (ExpandEnvironmentStringsW(ThemeFile, szPath, _countof(szPath)) != 0)
1503 ThemeFile = szPath;
1504 }
1505 else
1506 {
1507 ThemeFile = NULL;
1508 }
1509
1510 DPRINT1("--> Applying visual style '%S'\n",
1511 ThemeFile ? ThemeFile : L"(Classic)");
1512 }
1513
1514 if (ThemeFile)
1515 {
1516 WCHAR wszParams[1024];
1517 // FIXME: L"desk.cpl desk,@Appearance" regression, see commit 50d260a7f0
1518 PCWSTR format = L"desk.cpl,,2 /Action:ActivateMSTheme /file:\"%s\"";
1519
1520 StringCchPrintfW(wszParams, _countof(wszParams), format, ThemeFile);
1522 }
1523 else
1524 {
1525 RunControlPanelApplet(hwndParent, L"desk.cpl,,2 /Action:ActivateMSTheme");
1526 }
1527}
static HWND hwndParent
Definition: cryptui.c:299
#define wcsrchr
Definition: compat.h:16
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
void * UNKNOWN
Definition: ks.h:2676
LPCWSTR szPath
Definition: env.c:37
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
Definition: format.c:58
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1386
const uint16_t * PCWSTR
Definition: typedefs.h:57
struct _THEME_FILE THEME_FILE

Referenced by PreprocessUnattend(), and ThemePageDlgProc().

◆ FinishDlgProc()

static INT_PTR CALLBACK FinishDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2764 of file wizard.c.

2768{
2769 switch (uMsg)
2770 {
2771 case WM_INITDIALOG:
2772 {
2773 /* Get pointer to the global setup data */
2775
2777 {
2778 /* Run the Wine Gecko prompt */
2779 Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl,,install_gecko", SW_SHOW);
2780 }
2781
2782 /* Set title font */
2783 SendDlgItemMessage(hwndDlg,
2785 WM_SETFONT,
2787 (LPARAM)TRUE);
2789 {
2790 KillTimer(hwndDlg, 1);
2792 PostQuitMessage(0);
2793 }
2794
2795 /* Ensure that the installer wizard window is made visible and focused */
2796 ShowWindow(GetParent(hwndDlg), SW_SHOW);
2798 break;
2799 }
2800
2801 case WM_DESTROY:
2802 {
2804 PostQuitMessage(0);
2805 return TRUE;
2806 }
2807
2808 case WM_TIMER:
2809 {
2810 HWND hWndProgress;
2811 INT Position;
2812
2813 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2814 Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
2815 if (Position == 300)
2816 {
2817 KillTimer(hwndDlg, 1);
2819 }
2820 else
2821 {
2822 SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
2823 }
2824 return TRUE;
2825 }
2826
2827 case WM_NOTIFY:
2828 {
2829 LPNMHDR lpnm = (LPNMHDR)lParam;
2830
2831 switch (lpnm->code)
2832 {
2833 case PSN_SETACTIVE:
2834 {
2835 HWND hWndParent = GetParent(hwndDlg);
2836
2837 /* Only "Finish" for closing the wizard, and hide "Back" and "Next" */
2839 // PropSheet_ShowWizButtons(hWndParent, 0, PSWIZB_BACK | PSWIZB_NEXT | PSWIZB_CANCEL);
2842
2843 /* Set up the reboot progress bar and countdown timer.
2844 * 300 steps at 50 ms each: 15 seconds */
2847 SetTimer(hwndDlg, 1, 50, NULL);
2848 break;
2849 }
2850
2851 case PSN_WIZFINISH:
2852 DestroyWindow(GetParent(hwndDlg));
2853 break;
2854
2855 default:
2856 break;
2857 }
2858 break;
2859 }
2860
2861 default:
2862 break;
2863 }
2864
2865 return FALSE;
2866}
#define ShowDlgItem(hDlg, nID, nCmdShow)
Definition: reactos.h:34
#define ID_WIZNEXT
Definition: reactos.h:47
#define ID_WIZBACK
Definition: reactos.h:46
#define IDC_FINISHTITLE
Definition: resource.h:75
#define IDC_RESTART_PROGRESS
Definition: resource.h:77
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define PSWIZB_FINISH
Definition: prsht.h:155
#define PSBTN_FINISH
Definition: prsht.h:148
#define PSN_WIZFINISH
Definition: prsht.h:122
#define PBM_GETPOS
Definition: commctrl.h:2199
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
BOOL DisableGeckoInst
Definition: syssetup.h:51
HFONT hTitleFont
Definition: reactos.h:125
static COORD Position
Definition: mouse.c:34
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:1177
static VOID SetInstallationCompleted(VOID)
Definition: wizard.c:2735
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
#define SW_HIDE
Definition: winuser.h:779
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SETFONT
Definition: winuser.h:1678
#define SW_SHOW
Definition: winuser.h:786
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GenerateComputerName()

static void GenerateComputerName ( LPWSTR  lpBuffer)
static

Definition at line 1103 of file wizard.c.

1104{
1105 static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1106 static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
1107 unsigned i;
1108
1109 wcscpy(lpBuffer, L"REACTOS-");
1110
1112
1113 /* fill in 7 characters */
1114 for (i = 8; i < 15; i++)
1115 lpBuffer[i] = Chars[rand() % cChars];
1116
1117 lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
1118}
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
_ACRTIMP int __cdecl rand(void)
Definition: misc.c:59
_ACRTIMP void __cdecl srand(unsigned int)
Definition: misc.c:50
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68

Referenced by ComputerPageDlgProc().

◆ GetInstallSourceWin32()

static BOOL GetInstallSourceWin32 ( OUT PWSTR  pwszPath,
IN DWORD  cchPathMax,
IN PCWSTR  pwszNTPath 
)
static

Definition at line 2874 of file wizard.c.

2878{
2879 WCHAR wszDrives[512];
2880 WCHAR wszNTPath[512]; // MAX_PATH ?
2881 DWORD cchDrives;
2882 PWCHAR pwszDrive;
2883
2884 *pwszPath = UNICODE_NULL;
2885
2886 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2887 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2888 {
2889 /* Buffer too small or failure */
2890 LogItem(NULL, L"GetLogicalDriveStringsW failed");
2891 return FALSE;
2892 }
2893
2894 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2895 {
2896 WCHAR wszBuf[MAX_PATH];
2897
2898 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2899 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2900 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2901 pwszDrive[2] = L'\\'; // Restore the backslash
2902
2903 wcscat(wszNTPath, L"\\"); // Concat a backslash
2904
2905 /* Logging */
2906 wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2907 pwszDrive, wszNTPath,
2908 (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2909 LogItem(NULL, wszBuf);
2910
2911 /* Check whether the NT path corresponds to the NT installation source path */
2912 if (!_wcsicmp(wszNTPath, pwszNTPath))
2913 {
2914 /* Found it! */
2915 wcscpy(pwszPath, pwszDrive); // cchPathMax
2916
2917 /* Logging */
2918 wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2919 LogItem(NULL, wszBuf);
2920 wcscat(wszBuf, L"\n");
2921 OutputDebugStringW(wszBuf);
2922
2923 return TRUE;
2924 }
2925 }
2926
2927 return FALSE;
2928}
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
wcscat
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:102
#define DRIVE_CDROM
Definition: winbase.h:279
#define wsprintf
Definition: winuser.h:6031

Referenced by ProcessSetupInf().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  Index 
)
static

Definition at line 1637 of file wizard.c.

1638{
1640
1642 while (Entry != NULL)
1643 {
1644 if (Entry->Index >= Index)
1645 return Entry;
1646
1647 Entry = Entry->Next;
1648 }
1649
1650 return NULL;
1651}
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by RetrieveTimeZone().

◆ GetLocalSystemTime()

static BOOL GetLocalSystemTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1885 of file wizard.c.

1886{
1887 SYSTEMTIME Date;
1889
1891 {
1892 return FALSE;
1893 }
1894
1896 {
1897 return FALSE;
1898 }
1899
1903 SetupData->SystemTime.wDay = Date.wDay;
1904 SetupData->SystemTime.wHour = Time.wHour;
1905 SetupData->SystemTime.wMinute = Time.wMinute;
1906 SetupData->SystemTime.wSecond = Time.wSecond;
1907 SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1908
1909 return TRUE;
1910}
#define IDC_TIMEPICKER
Definition: resource.h:11
#define IDC_DATEPICKER
Definition: resource.h:64
static PLARGE_INTEGER Time
Definition: time.c:37
#define GDT_VALID
Definition: commctrl.h:4465
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4335
SYSTEMTIME SystemTime
Definition: syssetup.h:53
WORD wSecond
Definition: minwinbase.h:262
WORD wMinute
Definition: minwinbase.h:261
WORD wDayOfWeek
Definition: minwinbase.h:258
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by WriteDateTimeSettings().

◆ GetSelectedTimeZoneEntry()

static PTIMEZONE_ENTRY GetSelectedTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  dwEntryIndex 
)
static

Definition at line 1772 of file wizard.c.

1773{
1775
1776 for (Entry = SetupData->TimeZoneListHead; Entry != NULL; Entry = Entry->Next)
1777 {
1778 if (Entry->Index == dwEntryIndex)
1779 return Entry;
1780 }
1781
1782 return NULL;
1783}

Referenced by DateTimePageDlgProc().

◆ GetTimeZoneEntryByIndex()

static PTIMEZONE_ENTRY GetTimeZoneEntryByIndex ( PSETUPDATA  SetupData,
DWORD  dwComboIndex 
)
static

Definition at line 1786 of file wizard.c.

1787{
1789 DWORD i;
1790
1791 for (Entry = SetupData->TimeZoneListHead, i = 0; Entry != NULL && i < dwComboIndex; i++, Entry = Entry->Next);
1792
1793 return Entry;
1794}
STDMETHOD() Next(THIS_ ULONG celt, IAssociationElement *pElement, ULONG *pceltFetched) PURE

Referenced by DateTimePageDlgProc().

◆ GplDlgProc()

static INT_PTR CALLBACK GplDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 122 of file wizard.c.

126{
127 HRSRC GplTextResource;
128 HGLOBAL GplTextMem;
129 PVOID GplTextLocked;
130 PCHAR GplText;
131 DWORD Size;
132
133
134 switch (uMsg)
135 {
136 case WM_INITDIALOG:
137 GplTextResource = FindResourceW(hDllInstance, MAKEINTRESOURCE(IDR_GPL), L"RT_TEXT");
138 if (NULL == GplTextResource)
139 {
140 break;
141 }
142 Size = SizeofResource(hDllInstance, GplTextResource);
143 if (0 == Size)
144 {
145 break;
146 }
147 GplText = HeapAlloc(GetProcessHeap(), 0, Size + 1);
148 if (NULL == GplText)
149 {
150 break;
151 }
152 GplTextMem = LoadResource(hDllInstance, GplTextResource);
153 if (NULL == GplTextMem)
154 {
155 HeapFree(GetProcessHeap(), 0, GplText);
156 break;
157 }
158 GplTextLocked = LockResource(GplTextMem);
159 if (NULL == GplTextLocked)
160 {
161 HeapFree(GetProcessHeap(), 0, GplText);
162 break;
163 }
164 memcpy(GplText, GplTextLocked, Size);
165 GplText[Size] = '\0';
166 SendMessageA(GetDlgItem(hwndDlg, IDC_GPL_TEXT), WM_SETTEXT, 0, (LPARAM) GplText);
167 HeapFree(GetProcessHeap(), 0, GplText);
168 SetFocus(GetDlgItem(hwndDlg, IDOK));
169 return FALSE;
170
171 case WM_CLOSE:
172 EndDialog(hwndDlg, IDCANCEL);
173 break;
174
175 case WM_COMMAND:
176 if (HIWORD(wParam) == BN_CLICKED && IDOK == LOWORD(wParam))
177 {
178 EndDialog(hwndDlg, IDOK);
179 }
180 break;
181
182 default:
183 break;
184 }
185
186 return FALSE;
187}
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define IDR_GPL
Definition: resource.h:185
#define IDC_GPL_TEXT
Definition: resource.h:93
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
#define WM_CLOSE
Definition: winuser.h:1649
#define IDCANCEL
Definition: winuser.h:842
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDOK
Definition: winuser.h:841
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by AckPageDlgProc().

◆ HasDaylightSavingTime()

static BOOL HasDaylightSavingTime ( PTIMEZONE_ENTRY  Entry)
static

Definition at line 1763 of file wizard.c.

1764{
1765 /* If StandardDate.wMonth and DaylightDate.wMonth are zero,
1766 * the timezone does not observe daylight saving time */
1767 return (Entry->TimezoneInfo.StandardDate.wMonth != 0 &&
1768 Entry->TimezoneInfo.DaylightDate.wMonth != 0);
1769}

Referenced by DateTimePageDlgProc(), and UpdateAutoDaylightCheckbox().

◆ InstallTypePageDlgProc()

static INT_PTR CALLBACK InstallTypePageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 717 of file wizard.c.

718{
719 LPNMHDR lpnm;
720 PSETUPDATA pSetupData;
721 INT iItem;
722 WCHAR szText[64], szDefault[64];
723 HICON hIcon;
724
725 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
726
727 switch (uMsg)
728 {
729 case WM_INITDIALOG:
730 {
731 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
732 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
733
734 LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
735
738 {
739 StringCchCatW(szText, _countof(szText), L" ");
740 StringCchCatW(szText, _countof(szText), szDefault);
741 }
743
746 {
747 StringCchCatW(szText, _countof(szText), L" ");
748 StringCchCatW(szText, _countof(szText), szDefault);
749 }
751
754 {
755 StringCchCatW(szText, _countof(szText), L" ");
756 StringCchCatW(szText, _countof(szText), szDefault);
757 }
759
760#if 0
761 LoadStringW(hDllInstance, IDS_INSTALLATIONNANOSERVERNAME, szText, _countof(szText));
762 if (INSTALLATION_TYPE_DEFAULT == INSTALLATION_TYPE_NANO_SERVER)
763 {
764 StringCchCatW(szText, _countof(szText), L" ");
765 StringCchCatW(szText, _countof(szText), szDefault);
766 }
768#endif
769
772
775 return TRUE;
776 }
777
778 case WM_COMMAND:
780 {
783 }
784 break;
785
786 case WM_NOTIFY:
787 {
788 lpnm = (LPNMHDR)lParam;
789
790 switch (lpnm->code)
791 {
792 case PSN_SETACTIVE:
793 /* Enable the Back and Next buttons */
795 if (pSetupData->UnattendSetup)
796 {
797 OnChooseInstallationType(hwndDlg, pSetupData->InstallationType);
800 return TRUE;
801 }
802 break;
803
804 case PSN_WIZNEXT:
806 pSetupData->InstallationType = (INSTALLATION_TYPE)iItem;
808 break;
809
810 case PSN_WIZBACK:
811 pSetupData->UnattendSetup = FALSE;
812 break;
813
814 default:
815 break;
816 }
817 }
818 break;
819
820 default:
821 break;
822 }
823
824 return FALSE;
825}
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define IDC_INSTALLATION_ICON
Definition: resource.h:110
#define IDS_INSTALLATIONWORKSTATIONNAME
Definition: resource.h:177
#define IDC_INSTALLATION_TYPES
Definition: resource.h:111
#define IDS_DEFAULT
Definition: resource.h:183
#define IDS_INSTALLATIONSERVERNAME
Definition: resource.h:175
#define IDS_INSTALLATIONSERVERCORENAME
Definition: resource.h:179
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
INSTALLATION_TYPE InstallationType
Definition: syssetup.h:65
static void OnChooseInstallationType(HWND hwndDlg, INSTALLATION_TYPE nOption)
Definition: wizard.c:686
static BOOL DoWriteInstallationType(INSTALLATION_TYPE nOption)
Definition: wizard.c:545
@ INSTALLATION_TYPE_DEFAULT
Definition: syssetup.h:34
@ INSTALLATION_TYPE_SERVER
Definition: syssetup.h:28
enum _INSTALLATION_TYPE INSTALLATION_TYPE
#define STM_SETICON
Definition: winuser.h:2128
#define CB_SETCURSEL
Definition: winuser.h:1990
#define IDI_WINLOGO
Definition: winuser.h:717
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_ADDSTRING
Definition: winuser.h:1965
#define LoadIcon
Definition: winuser.h:5979

Referenced by InstallWizard().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 3458 of file wizard.c.

3459{
3460 PROPSHEETHEADER psh = {0};
3461 HPROPSHEETPAGE *phpage = NULL;
3462 PROPSHEETPAGE psp = {0};
3463 UINT nPages = 0;
3464 HWND hWnd;
3465 MSG msg;
3466 PSETUPDATA pSetupData = NULL;
3467 HMODULE hNetShell = NULL;
3469 DWORD dwPageCount = 10, dwNetworkPageCount = 0;
3470
3471 LogItem(L"BEGIN_SECTION", L"InstallWizard");
3472
3473 /* Allocate setup data */
3474 pSetupData = HeapAlloc(GetProcessHeap(),
3476 sizeof(SETUPDATA));
3477 if (pSetupData == NULL)
3478 {
3479 LogItem(NULL, L"SetupData allocation failed!");
3481 L"Setup failed to allocate global data!",
3482 L"ReactOS Setup",
3484 goto done;
3485 }
3487
3488 hNetShell = LoadLibraryW(L"netshell.dll");
3489 if (hNetShell != NULL)
3490 {
3491 DPRINT("Netshell.dll loaded!\n");
3492
3493 pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
3494 "NetSetupRequestWizardPages");
3495 if (pfn != NULL)
3496 {
3497 pfn(&dwNetworkPageCount, NULL, NULL);
3498 dwPageCount += dwNetworkPageCount;
3499 }
3500 }
3501
3502 DPRINT("PageCount: %lu\n", dwPageCount);
3503
3504 phpage = HeapAlloc(GetProcessHeap(),
3506 dwPageCount * sizeof(HPROPSHEETPAGE));
3507 if (phpage == NULL)
3508 {
3509 LogItem(NULL, L"Page array allocation failed!");
3511 L"Setup failed to allocate page array!",
3512 L"ReactOS Setup",
3514 goto done;
3515 }
3516
3517 /* Process the $winnt$.inf setup file */
3518 ProcessSetupInf(pSetupData);
3519
3520 /* Create the Welcome page */
3521 psp.dwSize = sizeof(PROPSHEETPAGE);
3522 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3523 psp.hInstance = hDllInstance;
3524 psp.lParam = (LPARAM)pSetupData;
3525 psp.pfnDlgProc = WelcomeDlgProc;
3526 psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
3527 phpage[nPages++] = CreatePropertySheetPage(&psp);
3528
3529 /* Create the Acknowledgements page */
3530 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3531 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
3532 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
3533 psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
3534 psp.pfnDlgProc = AckPageDlgProc;
3535 phpage[nPages++] = CreatePropertySheetPage(&psp);
3536
3537 /* Create the Installation Type page */
3538 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3539 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_INSTALLATIONTITLE);
3540 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_INSTALLATIONSUBTITLE);
3541 psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLATION);
3542 psp.pfnDlgProc = InstallTypePageDlgProc;
3543 phpage[nPages++] = CreatePropertySheetPage(&psp);
3544
3545 /* Create the Locale page */
3546 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3547 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
3548 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
3549 psp.pfnDlgProc = LocalePageDlgProc;
3550 psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
3551 phpage[nPages++] = CreatePropertySheetPage(&psp);
3552
3553 /* Create the Owner page */
3554 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3555 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
3556 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
3557 psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
3558 psp.pfnDlgProc = OwnerPageDlgProc;
3559 phpage[nPages++] = CreatePropertySheetPage(&psp);
3560
3561 /* Create the Computer page */
3562 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3563 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
3564 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
3565 psp.pfnDlgProc = ComputerPageDlgProc;
3566 psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
3567 phpage[nPages++] = CreatePropertySheetPage(&psp);
3568
3569 /* Create the DateTime page */
3570 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3571 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
3572 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
3573 psp.pfnDlgProc = DateTimePageDlgProc;
3574 psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
3575 phpage[nPages++] = CreatePropertySheetPage(&psp);
3576
3577 /* Create the theme selection page */
3578 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3579 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
3580 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
3581 psp.pfnDlgProc = ThemePageDlgProc;
3582 psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
3583 phpage[nPages++] = CreatePropertySheetPage(&psp);
3584
3587
3588 if (pfn)
3589 {
3590 pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
3591 nPages += dwNetworkPageCount;
3592 }
3593
3594 /* Create the Process page */
3595 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3596 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
3597 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
3598 psp.pfnDlgProc = ProcessPageDlgProc;
3599 psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
3600 phpage[nPages++] = CreatePropertySheetPage(&psp);
3601
3602 /* Create the Finish page */
3603 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3604 psp.pfnDlgProc = FinishDlgProc;
3605 psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
3606 phpage[nPages++] = CreatePropertySheetPage(&psp);
3607
3608 ASSERT(nPages == dwPageCount);
3609
3610 /* Create the property sheet */
3611 psh.dwSize = sizeof(PROPSHEETHEADER);
3612 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
3613 psh.hInstance = hDllInstance;
3614 psh.hwndParent = NULL;
3615 psh.nPages = nPages;
3616 psh.nStartPage = 0;
3617 psh.phpage = phpage;
3618 psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3619 psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3620
3621 /* Create title font */
3622 pSetupData->hTitleFont = CreateTitleFont();
3623 pSetupData->hBoldFont = CreateBoldFont();
3624
3625 /* Display the wizard */
3626 hWnd = (HWND)PropertySheet(&psh);
3628
3629 while (GetMessage(&msg, NULL, 0, 0))
3630 {
3631 if (!IsDialogMessage(hWnd, &msg))
3632 {
3635 }
3636 }
3637
3638 DeleteObject(pSetupData->hBoldFont);
3639 DeleteObject(pSetupData->hTitleFont);
3640
3641 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3642 SetupCloseInfFile(pSetupData->hSetupInf);
3643
3644done:
3645 if (phpage != NULL)
3646 HeapFree(GetProcessHeap(), 0, phpage);
3647
3648 if (hNetShell != NULL)
3649 FreeLibrary(hNetShell);
3650
3651 if (pSetupData != NULL)
3652 HeapFree(GetProcessHeap(), 0, pSetupData);
3653
3654 LogItem(L"END_SECTION", L"InstallWizard");
3655}
#define msg(x)
Definition: auth_time.c:54
#define IDB_HEADER
Definition: resource.h:30
#define IDS_PROCESSSUBTITLE
Definition: resource.h:109
#define IDS_PROCESSTITLE
Definition: resource.h:108
#define IDB_WATERMARK
Definition: resource.h:13
#define IDD_PROCESSPAGE
Definition: resource.h:69
#define IDD_FINISHPAGE
Definition: resource.h:74
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
HANDLE HWND
Definition: compat.h:19
#define LoadLibraryW(x)
Definition: compat.h:747
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:134
#define IDS_INSTALLATIONSUBTITLE
Definition: resource.h:174
#define IDS_LOCALESUBTITLE
Definition: resource.h:124
#define IDD_ACKPAGE
Definition: resource.h:44
#define IDS_ACKTITLE
Definition: resource.h:114
#define IDD_OWNERPAGE
Definition: resource.h:48
#define IDS_OWNERSUBTITLE
Definition: resource.h:118
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:121
#define IDS_INSTALLATIONTITLE
Definition: resource.h:173
#define IDS_DATETIMESUBTITLE
Definition: resource.h:129
#define IDS_LOCALETITLE
Definition: resource.h:123
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:135
#define IDS_COMPUTERTITLE
Definition: resource.h:120
#define IDD_COMPUTERPAGE
Definition: resource.h:52
#define IDS_OWNERTITLE
Definition: resource.h:117
#define IDS_ACKSUBTITLE
Definition: resource.h:115
#define IDS_DATETIMETITLE
Definition: resource.h:128
pKey DeleteObject()
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
unsigned int UINT
Definition: ndis.h:50
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:1347
static INT_PTR CALLBACK WelcomeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:469
static INT_PTR CALLBACK FinishDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1268
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_MODELESS
Definition: prsht.h:50
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
#define PropertySheet
Definition: prsht.h:400
#define PROPSHEETPAGE
Definition: prsht.h:389
#define DPRINT
Definition: sndvol32.h:73
HFONT hBoldFont
Definition: reactos.h:126
UINT uPostNetworkWizardPage
Definition: syssetup.h:63
UINT uFirstNetworkWizardPage
Definition: syssetup.h:62
HINF hSetupInf
Definition: syssetup.h:60
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1121
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1552
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:871
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1968
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:101
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:3323
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:3455
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2114
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:286
static INT_PTR CALLBACK InstallTypePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:717
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2616
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IsDialogMessage
Definition: winuser.h:5975
#define GetMessage
Definition: winuser.h:5956
#define DispatchMessage
Definition: winuser.h:5931

Referenced by InstallReactOS().

◆ ItemCompletionThread()

static DWORD CALLBACK ItemCompletionThread ( LPVOID  Parameter)
static

Definition at line 2466 of file wizard.c.

2468{
2469 PITEMSDATA pItemsData;
2470 HWND hwndDlg;
2471
2472 pItemsData = (PITEMSDATA)Parameter;
2473 hwndDlg = pItemsData->hwndDlg;
2474
2475 /* Step 0 - Registering components */
2476 RegisterComponents(pItemsData);
2477
2478 /* Step 1 - Installing start menu items */
2479 InstallStartMenuItems(pItemsData);
2480
2481 /* Step 2 - Saving Settings */
2482 SaveSettings(pItemsData);
2483
2484 /* Step 3 - Removing temporary files */
2485// RemoveTempFiles(pItemsData);
2486
2487 // FIXME: Move this call to a separate cleanup page!
2489
2490 /* Free the items data */
2491 HeapFree(GetProcessHeap(), 0, pItemsData);
2492
2493 /* Tell the wizard page that we are done */
2494 PostMessage(hwndDlg, PM_ITEMS_DONE, 0, 0);
2495
2496 return 0;
2497}
void SaveSettings(void)
Definition: settings.c:115
struct _ITEMSDATA * PITEMSDATA
#define PM_ITEMS_DONE
Definition: globals.h:64
VOID InstallStartMenuItems(_In_ PITEMSDATA pItemsData)
Definition: install.c:313
NTSTATUS NTAPI RtlCreateBootStatusDataFile(VOID)
Definition: bootdata.c:98
HWND hwndDlg
Definition: globals.h:31
static VOID RegisterComponents(PITEMSDATA pItemsData)
Definition: wizard.c:2392
#define PostMessage
Definition: winuser.h:5998
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336

Referenced by RunItemCompletionThread().

◆ LocalePageDlgProc()

static INT_PTR CALLBACK LocalePageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1552 of file wizard.c.

1556{
1558
1559 /* Retrieve pointer to the global setup data */
1561
1562 switch (uMsg)
1563 {
1564 case WM_INITDIALOG:
1565 {
1566 /* Save pointer to the global setup data */
1570
1573 }
1574 break;
1575
1576 case WM_COMMAND:
1577 if (HIWORD(wParam) == BN_CLICKED)
1578 {
1579 switch (LOWORD(wParam))
1580 {
1581 case IDC_CUSTOMLOCALE:
1582 RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1584 break;
1585
1586 case IDC_CUSTOMLAYOUT:
1587 RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1589 break;
1590 }
1591 }
1592 break;
1593
1594 case WM_NOTIFY:
1595 {
1596 LPNMHDR lpnm = (LPNMHDR)lParam;
1597
1598 switch (lpnm->code)
1599 {
1600 case PSN_SETACTIVE:
1601 /* Enable the Back and Next buttons */
1604 {
1605 // if (!*SetupData->SourcePath)
1606 {
1607 RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1608 }
1609
1611 return TRUE;
1612 }
1613 break;
1614
1615 case PSN_WIZNEXT:
1616 break;
1617
1618 case PSN_WIZBACK:
1620 break;
1621
1622 default:
1623 break;
1624 }
1625 }
1626 break;
1627
1628 default:
1629 break;
1630 }
1631
1632 return FALSE;
1633}
#define IDC_LOCALETEXT
Definition: resource.h:58
#define IDC_LAYOUTTEXT
Definition: resource.h:60
#define IDC_CUSTOMLOCALE
Definition: resource.h:59
#define IDC_CUSTOMLAYOUT
Definition: resource.h:61
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1304
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1531
static VOID SetUserLocaleName(HWND hwnd)
Definition: wizard.c:1287

Referenced by InstallWizard().

◆ OnChooseInstallationType()

static void OnChooseInstallationType ( HWND  hwndDlg,
INSTALLATION_TYPE  nOption 
)
static

Definition at line 686 of file wizard.c.

687{
688 WCHAR szText[256];
689 ASSERT(0 <= nOption && nOption < INSTALLATION_TYPE_MAX);
690
691 switch (nOption)
692 {
695 break;
696
699 break;
700
703 break;
704
705 // case INSTALLATION_TYPE_NANO_SERVER:
706 // LoadStringW(hDllInstance, IDS_INSTALLATIONSERVERINFO, szText, _countof(szText));
707 // break;
708
709 default:
710 return;
711 }
712
714}
#define IDS_INSTALLATIONSERVERINFO
Definition: resource.h:176
#define IDC_INSTALLATION_DESCRIPTION
Definition: resource.h:112
#define IDS_INSTALLATIONWORKSTATIONINFO
Definition: resource.h:178
#define IDS_INSTALLATIONSERVERCOREINFO
Definition: resource.h:180

Referenced by InstallTypePageDlgProc().

◆ OwnerPageDlgProc()

static INT_PTR CALLBACK OwnerPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 871 of file wizard.c.

875{
876 WCHAR OwnerName[51];
877 WCHAR OwnerOrganization[51];
878 WCHAR Title[64];
879 WCHAR ErrorName[256];
880 LPNMHDR lpnm;
881 PSETUPDATA pSetupData;
882
883 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
884
885 switch (uMsg)
886 {
887 case WM_INITDIALOG:
888 {
889 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
890 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
891
892 /* set a localized ('Owner') placeholder string as default */
893 if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
894 {
895 SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
896 }
897
900
901 /* Set focus to owner name */
903
904 /* Select the default text to quickly overwrite it by typing */
906 }
907 break;
908
909
910 case WM_NOTIFY:
911 {
912 lpnm = (LPNMHDR)lParam;
913
914 switch (lpnm->code)
915 {
916 case PSN_SETACTIVE:
917 /* Enable the Back and Next buttons */
919 if (pSetupData->UnattendSetup)
920 {
921 SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
923 if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
924 {
926 return TRUE;
927 }
928 }
929 break;
930
931 case PSN_WIZNEXT:
932 OwnerName[0] = 0;
933 if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
934 {
936 {
937 wcscpy(Title, L"ReactOS Setup");
938 }
939 if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
940 {
941 wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
942 }
943 MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
944
946 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
947
948 return TRUE;
949 }
950
951 OwnerOrganization[0] = 0;
952 GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
953
954 if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
955 {
957 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
958 return TRUE;
959 }
960
961 case PSN_WIZBACK:
962 pSetupData->UnattendSetup = FALSE;
963 break;
964
965 default:
966 break;
967 }
968 }
969 break;
970
971 default:
972 break;
973 }
974
975 return FALSE;
976}
#define IDC_OWNERORGANIZATION
Definition: resource.h:50
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:148
#define IDS_WZD_NAME
Definition: resource.h:150
#define IDC_OWNERNAME
Definition: resource.h:49
WCHAR OwnerName[51]
Definition: syssetup.h:46
WCHAR OwnerOrganization[51]
Definition: syssetup.h:47
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:829
#define EM_SETSEL
Definition: winuser.h:2047

Referenced by InstallWizard().

◆ PathIsEqual()

static BOOL PathIsEqual ( IN LPCWSTR  lpPath1,
IN LPCWSTR  lpPath2 
)
static

Definition at line 3206 of file wizard.c.

3209{
3210 WCHAR szPath1[MAX_PATH];
3211 WCHAR szPath2[MAX_PATH];
3212
3213 /* If something goes wrong, better return TRUE,
3214 * so the calling function returns early.
3215 */
3216 if (!PathCanonicalizeW(szPath1, lpPath1))
3217 return TRUE;
3218
3219 if (!PathAddBackslashW(szPath1))
3220 return TRUE;
3221
3222 if (!PathCanonicalizeW(szPath2, lpPath2))
3223 return TRUE;
3224
3225 if (!PathAddBackslashW(szPath2))
3226 return TRUE;
3227
3228 return (_wcsicmp(szPath1, szPath2) == 0);
3229}
#define PathCanonicalizeW
Definition: pathcch.h:314
#define PathAddBackslashW
Definition: pathcch.h:302

Referenced by AddInstallationSource().

◆ ProcessPageDlgProc()

static INT_PTR CALLBACK ProcessPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2616 of file wizard.c.

2620{
2622 PREGISTRATIONNOTIFY RegistrationNotify;
2623 static HICON s_hCheckIcon, s_hArrowIcon, s_hCrossIcon;
2624 static HFONT s_hNormalFont;
2625
2626 /* Retrieve pointer to the global setup data */
2628
2629 switch (uMsg)
2630 {
2631 case WM_INITDIALOG:
2632 {
2633 /* Save pointer to the global setup data */
2637 ShowDlgItem(hwndDlg, IDC_CHECK4, SW_HIDE);
2638 s_hCheckIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CHECKICON), IMAGE_ICON, 16, 16, 0);
2639 s_hArrowIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_ARROWICON), IMAGE_ICON, 16, 16, 0);
2640 s_hCrossIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CROSSICON), IMAGE_ICON, 16, 16, 0);
2641 s_hNormalFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1, WM_GETFONT, 0, 0);
2642 break;
2643 }
2644
2645 case WM_DESTROY:
2646 DestroyIcon(s_hCheckIcon);
2647 DestroyIcon(s_hArrowIcon);
2648 DestroyIcon(s_hCrossIcon);
2649 break;
2650
2651 case WM_NOTIFY:
2652 switch (((LPNMHDR)lParam)->code)
2653 {
2654 case PSN_SETACTIVE:
2655 {
2656 LogItem(L"BEGIN", L"ProcessPage");
2657
2658 /* Disable all buttons during installation; hide "Back" */
2660 // PropSheet_ShowWizButtons(GetParent(hwndDlg), 0, PSWIZB_BACK);
2662
2663 RunItemCompletionThread(hwndDlg);
2664 break;
2665 }
2666
2667 case PSN_WIZNEXT:
2668 LogItem(L"END", L"ProcessPage");
2669 break;
2670
2671 case PSN_WIZBACK:
2673 break;
2674
2675 default:
2676 break;
2677 }
2678 break;
2679
2680 case PM_ITEM_START:
2681 DPRINT("PM_ITEM_START %lu\n", (ULONG)lParam);
2686 break;
2687
2688 case PM_ITEM_END:
2689 DPRINT("PM_ITEM_END\n");
2690 SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1 + wParam, WM_SETFONT, (WPARAM)s_hNormalFont, (LPARAM)TRUE);
2691 if (lParam == ERROR_SUCCESS)
2692 {
2694 }
2695 else
2696 {
2698 ShowItemError(hwndDlg, (DWORD)lParam);
2699 }
2700 break;
2701
2702 case PM_STEP_START:
2703 DPRINT("PM_STEP_START\n");
2704 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2706 (LPARAM)((RegistrationNotify->CurrentItem != NULL)? RegistrationNotify->CurrentItem : L""));
2707 break;
2708
2709 case PM_STEP_END:
2710 DPRINT("PM_STEP_END\n");
2711 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2712 SendDlgItemMessage(hwndDlg, IDC_PROCESSPROGRESS, PBM_SETPOS, RegistrationNotify->Progress, 0);
2713 if (RegistrationNotify->LastError != ERROR_SUCCESS)
2714 {
2715 ShowStepError(hwndDlg, RegistrationNotify);
2716 }
2717 break;
2718
2719 case PM_ITEMS_DONE:
2720 DPRINT("PM_ITEMS_DONE\n");
2721 /* Enable the Back and Next buttons */
2724 break;
2725
2726 default:
2727 break;
2728 }
2729
2730 return FALSE;
2731}
#define IDC_PROCESSPROGRESS
Definition: resource.h:72
#define IDC_ITEM
Definition: resource.h:71
#define IDC_CHECK1
Definition: resource.h:319
#define PM_STEP_START
Definition: globals.h:62
#define PM_ITEM_START
Definition: globals.h:52
#define PM_ITEM_END
Definition: globals.h:57
struct _REGISTRATIONNOTIFY * PREGISTRATIONNOTIFY
#define PM_STEP_END
Definition: globals.h:63
#define IDC_TASKTEXT4
Definition: resource.h:75
#define IDC_TASKTEXT1
Definition: resource.h:72
#define IDI_ARROWICON
Definition: resource.h:36
#define IDC_CHECK4
Definition: resource.h:83
#define IDI_CHECKICON
Definition: resource.h:35
#define IDI_CROSSICON
Definition: resource.h:37
#define PSBTN_NEXT
Definition: prsht.h:147
LPCWSTR CurrentItem
Definition: globals.h:38
static VOID ShowItemError(HWND hwndDlg, DWORD LastError)
Definition: wizard.c:2535
static BOOL RunItemCompletionThread(_In_ HWND hwndDlg)
Definition: wizard.c:2502
static VOID ShowStepError(HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
Definition: wizard.c:2578
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572
#define WM_GETFONT
Definition: winuser.h:1679
#define STM_SETIMAGE
Definition: winuser.h:2129
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422

Referenced by InstallWizard().

◆ ProcessSetupInf()

VOID ProcessSetupInf ( IN OUT PSETUPDATA  pSetupData)

Definition at line 3323 of file wizard.c.

3325{
3327 WCHAR szValue[MAX_PATH];
3328 INFCONTEXT InfContext;
3329 DWORD LineLength;
3330 HKEY hKey;
3331 LONG res;
3332
3333 pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
3334
3335 /* Retrieve the path of the setup INF */
3337 wcscat(szPath, L"\\$winnt$.inf");
3338
3339 /* Open the setup INF */
3340 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3341 NULL,
3343 NULL);
3344 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3345 {
3346 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3347 return;
3348 }
3349
3350
3351 /* Retrieve the NT source path from which the 1st-stage installer was run */
3352 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
3353 L"data",
3354 L"sourcepath",
3355 &InfContext))
3356 {
3357 DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
3358 return;
3359 }
3360
3361 if (!SetupGetStringFieldW(&InfContext,
3362 1,
3363 szValue,
3364 ARRAYSIZE(szValue),
3365 &LineLength))
3366 {
3367 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3368 return;
3369 }
3370
3371 *pSetupData->SourcePath = UNICODE_NULL;
3372
3373 /* Close the setup INF as we are going to modify it manually */
3374 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3375 SetupCloseInfFile(pSetupData->hSetupInf);
3376
3377
3378 /* Find the installation source path in Win32 format */
3379 if (!GetInstallSourceWin32(pSetupData->SourcePath,
3380 _countof(pSetupData->SourcePath),
3381 szValue))
3382 {
3383 *pSetupData->SourcePath = UNICODE_NULL;
3384 }
3385
3386 /* Save the path in Win32 format in the setup INF */
3387 _swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
3388 WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
3389
3390 /*
3391 * Save it also in the registry, in the following keys:
3392 * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
3393 * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
3394 * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
3395 * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
3396 */
3397#if 0
3399 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
3400 0,
3402 &hKey);
3403
3404 if (res != ERROR_SUCCESS)
3405 {
3406 return FALSE;
3407 }
3408#endif
3409
3411 L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
3412 0, NULL,
3414 KEY_ALL_ACCESS, // KEY_WRITE
3415 NULL,
3416 &hKey,
3417 NULL);
3418 if (res == ERROR_SUCCESS)
3419 {
3420 AddInstallationSource(hKey, pSetupData->SourcePath);
3421
3423 L"SourcePath",
3424 0,
3425 REG_SZ,
3426 (LPBYTE)pSetupData->SourcePath,
3427 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3428
3430 L"ServicePackSourcePath",
3431 0,
3432 REG_SZ,
3433 (LPBYTE)pSetupData->SourcePath,
3434 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3435
3437 }
3438
3439
3440 /* Now, re-open the setup INF (this must succeed) */
3441 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3442 NULL,
3444 NULL);
3445 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3446 {
3447 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3448 return;
3449 }
3450
3451 /* Process the unattended section of the setup file */
3452 ProcessUnattendSection(pSetupData);
3453}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2232
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
#define INF_STYLE_OLDNT
Definition: infsupp.h:39
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2874
static VOID AddInstallationSource(IN HKEY hKey, IN LPWSTR lpPath)
Definition: wizard.c:3232
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2931
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by InstallWizard().

◆ ProcessUnattendSection()

VOID ProcessUnattendSection ( IN OUT PSETUPDATA  pSetupData)

Definition at line 2931 of file wizard.c.

2933{
2934 INFCONTEXT InfContext;
2935 WCHAR szName[256];
2936 WCHAR szValue[MAX_PATH];
2937 DWORD LineLength;
2938 HKEY hKey;
2939
2940 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2941 L"Unattend",
2942 L"UnattendSetupEnabled",
2943 &InfContext))
2944 {
2945 DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2946 return;
2947 }
2948
2949 if (!SetupGetStringFieldW(&InfContext,
2950 1,
2951 szValue,
2952 ARRAYSIZE(szValue),
2953 &LineLength))
2954 {
2955 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2956 return;
2957 }
2958
2959 if (_wcsicmp(szValue, L"yes") != 0)
2960 {
2961 DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2962 return;
2963 }
2964
2965 pSetupData->UnattendSetup = TRUE;
2966
2967 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2968 L"Unattend",
2969 NULL,
2970 &InfContext))
2971 {
2972 DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2973 return;
2974 }
2975
2976 do
2977 {
2978 if (!SetupGetStringFieldW(&InfContext,
2979 0,
2980 szName,
2982 &LineLength))
2983 {
2984 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2985 return;
2986 }
2987
2988 if (!SetupGetStringFieldW(&InfContext,
2989 1,
2990 szValue,
2991 ARRAYSIZE(szValue),
2992 &LineLength))
2993 {
2994 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2995 return;
2996 }
2997 DPRINT1("Name %S Value %S\n", szName, szValue);
2998 if (!_wcsicmp(szName, L"FullName"))
2999 {
3000 if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
3001 {
3002 wcscpy(pSetupData->OwnerName, szValue);
3003 }
3004 }
3005 else if (!_wcsicmp(szName, L"OrgName"))
3006 {
3007 if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
3008 {
3009 wcscpy(pSetupData->OwnerOrganization, szValue);
3010 }
3011 }
3012 else if (!_wcsicmp(szName, L"ComputerName"))
3013 {
3014 if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
3015 {
3016 wcscpy(pSetupData->ComputerName, szValue);
3017 }
3018 }
3019 else if (!_wcsicmp(szName, L"AdminPassword"))
3020 {
3021 if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
3022 {
3023 wcscpy(pSetupData->AdminPassword, szValue);
3024 }
3025 }
3026 else if (!_wcsicmp(szName, L"TimeZoneIndex"))
3027 {
3028 pSetupData->TimeZoneIndex = _wtoi(szValue);
3029 }
3030 else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
3031 {
3032 pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
3033 }
3034 else if (!_wcsicmp(szName, L"DisableGeckoInst"))
3035 {
3036 if (!_wcsicmp(szValue, L"yes"))
3037 pSetupData->DisableGeckoInst = TRUE;
3038 else
3039 pSetupData->DisableGeckoInst = FALSE;
3040 }
3041 else if (!_wcsicmp(szName, L"InstallationType"))
3042 {
3043 pSetupData->InstallationType = (INSTALLATION_TYPE)_wtoi(szValue);
3044 }
3045 } while (SetupFindNextLine(&InfContext, &InfContext));
3046
3047 if (SetupFindFirstLineW(pSetupData->hSetupInf,
3048 L"Display",
3049 NULL,
3050 &InfContext))
3051 {
3052 DEVMODEW dm = { { 0 } };
3053 dm.dmSize = sizeof(dm);
3055 {
3056 do
3057 {
3058 int iValue;
3059 if (!SetupGetStringFieldW(&InfContext,
3060 0,
3061 szName,
3063 &LineLength))
3064 {
3065 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3066 return;
3067 }
3068
3069 if (!SetupGetStringFieldW(&InfContext,
3070 1,
3071 szValue,
3072 ARRAYSIZE(szValue),
3073 &LineLength))
3074 {
3075 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3076 return;
3077 }
3078 iValue = _wtoi(szValue);
3079 DPRINT1("Name %S Value %i\n", szName, iValue);
3080
3081 if (!iValue)
3082 continue;
3083
3084 if (!_wcsicmp(szName, L"BitsPerPel"))
3085 {
3086 dm.dmFields |= DM_BITSPERPEL;
3087 dm.dmBitsPerPel = iValue;
3088 }
3089 else if (!_wcsicmp(szName, L"XResolution"))
3090 {
3091 dm.dmFields |= DM_PELSWIDTH;
3092 dm.dmPelsWidth = iValue;
3093 }
3094 else if (!_wcsicmp(szName, L"YResolution"))
3095 {
3096 dm.dmFields |= DM_PELSHEIGHT;
3097 dm.dmPelsHeight = iValue;
3098 }
3099 else if (!_wcsicmp(szName, L"VRefresh"))
3100 {
3102 dm.dmDisplayFrequency = iValue;
3103 }
3104 } while (SetupFindNextLine(&InfContext, &InfContext));
3105
3107 }
3108 }
3109
3111 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
3112 0,
3114 &hKey) != ERROR_SUCCESS)
3115 {
3116 DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
3117 return;
3118 }
3119
3120 if (SetupFindFirstLineW(pSetupData->hSetupInf,
3121 L"GuiRunOnce",
3122 NULL,
3123 &InfContext))
3124 {
3125 int i = 0;
3126 do
3127 {
3128 if (SetupGetStringFieldW(&InfContext,
3129 0,
3130 szValue,
3131 ARRAYSIZE(szValue),
3132 NULL))
3133 {
3135 _swprintf(szName, L"%d", i);
3136 DPRINT("szName %S szValue %S\n", szName, szValue);
3137
3139 {
3140 DPRINT("value %S\n", szPath);
3141 if (RegSetValueExW(hKey,
3142 szName,
3143 0,
3144 REG_SZ,
3145 (const BYTE*)szPath,
3146 (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
3147 {
3148 i++;
3149 }
3150 }
3151 }
3152 } while (SetupFindNextLine(&InfContext, &InfContext));
3153 }
3154
3156
3157 if (SetupFindFirstLineW(pSetupData->hSetupInf,
3158 L"Env",
3159 NULL,
3160 &InfContext))
3161 {
3162 if (RegCreateKeyExW(
3163 HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, NULL,
3165 {
3166 DPRINT1("Error: failed to open HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\n");
3167 return;
3168 }
3169 do
3170 {
3171 if (!SetupGetStringFieldW(&InfContext,
3172 0,
3173 szName,
3175 &LineLength))
3176 {
3177 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3178 return;
3179 }
3180
3181 if (!SetupGetStringFieldW(&InfContext,
3182 1,
3183 szValue,
3184 ARRAYSIZE(szValue),
3185 &LineLength))
3186 {
3187 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3188 return;
3189 }
3190 DPRINT1("[ENV] %S=%S\n", szName, szValue);
3191
3192 DWORD dwType = wcschr(szValue, '%') != NULL ? REG_EXPAND_SZ : REG_SZ;
3193
3194 if (RegSetValueExW(hKey, szName, 0, dwType, (const BYTE*)szValue, (DWORD)(wcslen(szValue) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
3195 {
3196 DPRINT1(" - Error %d\n", GetLastError());
3197 }
3198
3199 } while (SetupFindNextLine(&InfContext, &InfContext));
3200
3202 }
3203}
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
Definition: wcs.c:2778
char TCHAR
Definition: tchar.h:1402
#define KEY_SET_VALUE
Definition: nt_native.h:1020
static const WCHAR szName[]
Definition: powrprof.c:45
DWORD dmBitsPerPel
Definition: wingdi.h:2093
DWORD dmFields
Definition: wingdi.h:2068
DWORD dmPelsWidth
Definition: wingdi.h:2094
DWORD dmPelsHeight
Definition: wingdi.h:2095
DWORD dmDisplayFrequency
Definition: wingdi.h:2100
WORD dmSize
Definition: wingdi.h:2066
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:82
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179

Referenced by ProcessSetupInf().

◆ RegisterComponents()

static VOID RegisterComponents ( PITEMSDATA  pItemsData)
static

Definition at line 2392 of file wizard.c.

2394{
2395 WCHAR SectionName[512];
2397 LONG Steps = 0;
2400
2401 ZeroMemory(&Notify, sizeof(Notify));
2402
2403 /* Count the 'RegisterDlls' steps */
2404 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2405 L"RegisterDlls", &Context))
2406 {
2407 DPRINT1("No RegistrationPhase2 section found\n");
2408 return;
2409 }
2410
2411 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2412 ARRAYSIZE(SectionName),
2413 NULL))
2414 {
2415 DPRINT1("Unable to retrieve section name\n");
2416 return;
2417 }
2418
2419 Steps += SetupGetLineCountW(hSysSetupInf, SectionName);
2420
2421 /* Count the 'TypeLibratries' steps */
2422 Steps += SetupGetLineCountW(hSysSetupInf, L"TypeLibraries");
2423
2424 /* Start the item */
2425 DPRINT("Register Components: %ld Steps\n", Steps);
2426 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 0, (LPARAM)Steps);
2427
2428 Error = RegisterDlls(pItemsData, &Notify);
2429 if (Error == ERROR_SUCCESS)
2430 RegisterTypeLibraries(pItemsData, &Notify, hSysSetupInf, L"TypeLibraries");
2431
2432 /* End the item */
2433 DPRINT("Register Components: done\n");
2434 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 0, Error);
2435}
#define NO_ERROR
Definition: dderror.h:5
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
static const WCHAR RegisterDlls[]
Definition: install.c:118
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1501
HINF hSysSetupInf
Definition: install.c:37
BOOL RegisterTypeLibraries(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ HINF hinf, _In_ LPCWSTR szSection)
Definition: install.c:539
_In_ PVOID Context
Definition: storport.h:2269

Referenced by ItemCompletionThread().

◆ RegisterDlls()

static DWORD RegisterDlls ( _In_ PITEMSDATA  pItemsData,
_In_ PREGISTRATIONNOTIFY  pNotify 
)
static

Definition at line 2321 of file wizard.c.

2324{
2325 REGISTRATIONDATA RegistrationData;
2326 WCHAR SectionName[512];
2328 LONG DllCount = 0;
2330
2331 ZeroMemory(&RegistrationData, sizeof(REGISTRATIONDATA));
2332 RegistrationData.hwndDlg = pItemsData->hwndDlg;
2333 RegistrationData.Registered = 0;
2334
2335 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2336 L"RegisterDlls", &Context))
2337 {
2338 DPRINT1("No RegistrationPhase2 section found\n");
2339 return GetLastError();
2340 }
2341
2342 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2343 ARRAYSIZE(SectionName),
2344 NULL))
2345 {
2346 DPRINT1("Unable to retrieve section name\n");
2347 return GetLastError();
2348 }
2349
2350 DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2351 DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
2352 if (DllCount < 0)
2353 {
2354 return STATUS_NOT_FOUND;
2355 }
2356
2357 RegistrationData.DllCount = (ULONG)DllCount;
2358 RegistrationData.DefaultContext = SetupInitDefaultQueueCallback(RegistrationData.hwndDlg);
2359 RegistrationData.pNotify = pNotify;
2360
2361 _SEH2_TRY
2362 {
2363 if (!SetupInstallFromInfSectionW(GetParent(RegistrationData.hwndDlg),
2365 L"RegistrationPhase2",
2366 SPINST_REGISTRY | SPINST_REGISTERCALLBACKAWARE | SPINST_REGSVR,
2367 0,
2368 NULL,
2369 0,
2371 &RegistrationData,
2372 NULL,
2373 NULL))
2374 {
2375 Error = GetLastError();
2376 }
2377 }
2379 {
2380 DPRINT("Catching exception\n");
2382 }
2383 _SEH2_END;
2384
2386
2387 return Error;
2388}
BOOL WINAPI SetupInstallFromInfSectionW(HWND owner, HINF hinf, PCWSTR section, UINT flags, HKEY key_root, PCWSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
Definition: install.c:1330
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1656
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1629
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:204
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:104
#define _SEH2_END
Definition: pseh2_64.h:194
#define _SEH2_TRY
Definition: pseh2_64.h:93
#define SPINST_REGSVR
Definition: setupapi.h:597
#define SPINST_REGISTRY
Definition: setupapi.h:593
#define STATUS_NOT_FOUND
Definition: shellext.h:72
PVOID DefaultContext
Definition: wizard.c:35
PREGISTRATIONNOTIFY pNotify
Definition: wizard.c:36
ULONG Registered
Definition: wizard.c:34
ULONG DllCount
Definition: wizard.c:33
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:2225
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ RegistrationNotificationProc()

static UINT CALLBACK RegistrationNotificationProc ( PVOID  Context,
UINT  Notification,
UINT_PTR  Param1,
UINT_PTR  Param2 
)
static

Definition at line 2225 of file wizard.c.

2229{
2230 PREGISTRATIONDATA RegistrationData;
2233
2234 RegistrationData = (PREGISTRATIONDATA)Context;
2235
2238 {
2239 StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
2240 RegistrationData->pNotify->CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
2241 if (RegistrationData->pNotify->CurrentItem == NULL)
2242 {
2243 RegistrationData->pNotify->CurrentItem = StatusInfo->FileName;
2244 }
2245 else
2246 {
2247 RegistrationData->pNotify->CurrentItem++;
2248 }
2249
2251 {
2252 DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
2253 StatusInfo->FileName);
2254 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2255
2256 DPRINT("RegisterDll: Start step %ld\n", RegistrationData->pNotify->Progress);
2257 SendMessage(RegistrationData->hwndDlg, PM_STEP_START, 0, (LPARAM)RegistrationData->pNotify);
2258 }
2259 else
2260 {
2261 DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
2262 StatusInfo->FileName);
2263 DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
2264 StatusInfo->FailureCode);
2265 if (StatusInfo->FailureCode != SPREG_SUCCESS)
2266 {
2267 switch (StatusInfo->FailureCode)
2268 {
2269 case SPREG_LOADLIBRARY:
2271 break;
2272 case SPREG_GETPROCADDR:
2274 break;
2275 case SPREG_REGSVR:
2277 break;
2278 case SPREG_DLLINSTALL:
2280 break;
2281 case SPREG_TIMEOUT:
2283 break;
2284 default:
2286 break;
2287 }
2288
2289 RegistrationData->pNotify->MessageID = MessageID;
2290 RegistrationData->pNotify->LastError = StatusInfo->Win32Error;
2291 }
2292 else
2293 {
2294 RegistrationData->pNotify->MessageID = 0;
2295 RegistrationData->pNotify->LastError = ERROR_SUCCESS;
2296 }
2297
2298 if (RegistrationData->Registered < RegistrationData->DllCount)
2299 {
2300 RegistrationData->Registered++;
2301 }
2302
2303 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2304 DPRINT("RegisterDll: End step %ld\n", RegistrationData->pNotify->Progress);
2305 SendMessage(RegistrationData->hwndDlg, PM_STEP_END, 0, (LPARAM)RegistrationData->pNotify);
2306 }
2307
2308 return FILEOP_DOIT;
2309 }
2310 else
2311 {
2312 DPRINT1("Received unexpected notification %u\n", Notification);
2313 return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
2314 Notification, Param1, Param2);
2315 }
2316}
#define IDS_TIMEOUT
Definition: resource.h:14
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:144
#define IDS_REGSVR_FAILED
Definition: resource.h:143
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:141
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:142
#define IDS_REASON_UNKNOWN
Definition: resource.h:146
#define FILEOP_DOIT
Definition: fileqsup.h:48
#define SPREG_GETPROCADDR
Definition: setupapi.h:657
#define SPREG_REGSVR
Definition: setupapi.h:658
#define SetupDefaultQueueCallback
Definition: setupapi.h:2593
#define SPFILENOTIFY_STARTREGISTRATION
Definition: setupapi.h:573
#define SPREG_SUCCESS
Definition: setupapi.h:655
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define SPREG_TIMEOUT
Definition: setupapi.h:660
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:574
#define SPREG_DLLINSTALL
Definition: setupapi.h:659
#define SPREG_LOADLIBRARY
Definition: setupapi.h:656
struct _REGISTRATIONDATA * PREGISTRATIONDATA
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
_In_ ULONG MessageID
Definition: wdfinterrupt.h:92

Referenced by RegisterDlls().

◆ RetrieveTimeZone()

static LONG RetrieveTimeZone ( IN HKEY  hZoneKey,
IN PVOID  Context 
)
static

Definition at line 1654 of file wizard.c.

1657{
1658 LONG lError;
1661 PTIMEZONE_ENTRY Current;
1662 ULONG DescriptionSize;
1663 ULONG StandardNameSize;
1664 ULONG DaylightNameSize;
1665
1667 if (Entry == NULL)
1668 {
1670 }
1671
1672 DescriptionSize = sizeof(Entry->Description);
1673 StandardNameSize = sizeof(Entry->StandardName);
1674 DaylightNameSize = sizeof(Entry->DaylightName);
1675
1676 lError = QueryTimeZoneData(hZoneKey,
1677 &Entry->Index,
1678 &Entry->TimezoneInfo,
1679 Entry->Description,
1680 &DescriptionSize,
1681 Entry->StandardName,
1682 &StandardNameSize,
1683 Entry->DaylightName,
1684 &DaylightNameSize);
1685 if (lError != ERROR_SUCCESS)
1686 {
1688 return lError;
1689 }
1690
1693 {
1694 Entry->Prev = NULL;
1695 Entry->Next = NULL;
1698 }
1699 else
1700 {
1701 Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1702 if (Current != NULL)
1703 {
1704 if (Current == SetupData->TimeZoneListHead)
1705 {
1706 /* Prepend to head */
1707 Entry->Prev = NULL;
1711 }
1712 else
1713 {
1714 /* Insert before current */
1715 Entry->Prev = Current->Prev;
1716 Entry->Next = Current;
1717 Current->Prev->Next = Entry;
1718 Current->Prev = Entry;
1719 }
1720 }
1721 else
1722 {
1723 /* Append to tail */
1725 Entry->Next = NULL;
1728 }
1729 }
1730
1731 return ERROR_SUCCESS;
1732}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:17
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1637
LONG QueryTimeZoneData(IN HKEY hZoneKey, OUT PULONG Index OPTIONAL, OUT PREG_TZI_FORMAT TimeZoneInfo, OUT PWCHAR Description OPTIONAL, IN OUT PULONG DescriptionSize OPTIONAL, OUT PWCHAR StandardName OPTIONAL, IN OUT PULONG StandardNameSize OPTIONAL, OUT PWCHAR DaylightName OPTIONAL, IN OUT PULONG DaylightNameSize OPTIONAL)
Definition: tzlib.c:141

Referenced by CreateTimeZoneList().

◆ RunControlPanelApplet()

static BOOL RunControlPanelApplet ( HWND  hwnd,
PCWSTR  pwszCPLParameters 
)
static

Definition at line 1386 of file wizard.c.

1387{
1388 MSG msg;
1389 HWND MainWindow = GetParent(hwnd);
1390 STARTUPINFOW StartupInfo;
1391 PROCESS_INFORMATION ProcessInformation;
1392 WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1393
1394 if (!pwszCPLParameters)
1395 {
1396 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1397 return FALSE;
1398 }
1399
1400 ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1401 StartupInfo.cb = sizeof(StartupInfo);
1402 ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1403
1404 ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1405 wcscat(CmdLine, pwszCPLParameters);
1406
1407 if (!CreateProcessW(NULL,
1408 CmdLine,
1409 NULL,
1410 NULL,
1411 FALSE,
1412 0,
1413 NULL,
1414 NULL,
1415 &StartupInfo,
1416 &ProcessInformation))
1417 {
1418 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1419 return FALSE;
1420 }
1421
1422 /* Disable the Back and Next buttons and the main window
1423 * while we're interacting with the control panel applet */
1424 PropSheet_SetWizButtons(MainWindow, 0);
1425 EnableWindow(MainWindow, FALSE);
1426
1428 {
1429 /* We still need to process main window messages to avoid freeze */
1430 while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1431 {
1434 }
1435 }
1436 CloseHandle(ProcessInformation.hThread);
1437 CloseHandle(ProcessInformation.hProcess);
1438
1439 /* Enable the Back and Next buttons and the main window again */
1441 EnableWindow(MainWindow, TRUE);
1442
1443 return TRUE;
1444}
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4441
static const WCHAR CmdLine[]
Definition: install.c:48
#define INFINITE
Definition: serial.h:102
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:893
#define QS_ALLINPUT
Definition: winuser.h:914
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1207
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by EnableVisualTheme(), and LocalePageDlgProc().

◆ RunItemCompletionThread()

static BOOL RunItemCompletionThread ( _In_ HWND  hwndDlg)
static

Definition at line 2502 of file wizard.c.

2504{
2505 HANDLE hCompletionThread;
2506 PITEMSDATA pItemsData;
2507
2508 pItemsData = HeapAlloc(GetProcessHeap(), 0, sizeof(ITEMSDATA));
2509 if (pItemsData == NULL)
2510 return FALSE;
2511
2512 pItemsData->hwndDlg = hwndDlg;
2513
2514 hCompletionThread = CreateThread(NULL,
2515 0,
2517 pItemsData,
2518 0,
2519 NULL);
2520 if (hCompletionThread == NULL)
2521 {
2522 HeapFree(GetProcessHeap(), 0, pItemsData);
2523 }
2524 else
2525 {
2526 CloseHandle(hCompletionThread);
2527 return TRUE;
2528 }
2529
2530 return FALSE;
2531}
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
static DWORD CALLBACK ItemCompletionThread(LPVOID Parameter)
Definition: wizard.c:2466

Referenced by ProcessPageDlgProc().

◆ SaveSettings()

static VOID SaveSettings ( PITEMSDATA  pItemsData)
static

Definition at line 2439 of file wizard.c.

2441{
2442 LONG Steps = 0;
2445
2446 ZeroMemory(&Notify, sizeof(Notify));
2447
2448 /* Count steps */
2449 Steps = CountSecuritySteps();
2450
2451 /* Start the item */
2452 DPRINT("Install security: %ld Steps\n", Steps);
2453 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 2, (LPARAM)Steps);
2454
2455 /* Install steps */
2456 Error = InstallSecurity(pItemsData, &Notify);
2457
2458 /* End the item */
2459 DPRINT("Install security: done\n");
2460 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 2, Error);
2461}
LONG CountSecuritySteps(VOID)
Definition: security.c:1607
DWORD InstallSecurity(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
Definition: security.c:1648

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2735 of file wizard.c.

2736{
2737 HKEY hKey = 0;
2738 DWORD InProgress = 0;
2739 DWORD InstallDate;
2740
2742 L"SYSTEM\\Setup",
2743 0,
2744 KEY_WRITE,
2745 &hKey ) == ERROR_SUCCESS)
2746 {
2747 RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2748 RegCloseKey( hKey );
2749 }
2750
2752 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2753 0,
2754 KEY_WRITE,
2755 &hKey ) == ERROR_SUCCESS)
2756 {
2757 InstallDate = (DWORD)time(NULL);
2758 RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2759 RegCloseKey( hKey );
2760 }
2761}
__u16 time
Definition: mkdosfs.c:8

Referenced by FinishDlgProc().

◆ SetKeyboardLayoutName()

static VOID SetKeyboardLayoutName ( HWND  hwnd)
static

Definition at line 1304 of file wizard.c.

1305{
1306 HKL hkl;
1307 BOOL LayoutSpecial = FALSE;
1308 WCHAR LayoutPath[256];
1309 WCHAR LocaleName[32];
1310 WCHAR SpecialId[5] = L"";
1311 WCHAR ResText[256] = L"";
1312 DWORD dwValueSize;
1313 HKEY hKey;
1314 UINT i;
1315
1316 /* Get the default input language and method */
1317 if (!SystemParametersInfoW(SPI_GETDEFAULTINPUTLANG, 0, (LPDWORD)&hkl, 0))
1318 {
1320 }
1321
1322 if ((HIWORD(hkl) & 0xF000) == 0xF000)
1323 {
1324 /* Process keyboard layout with special id */
1325 StringCchPrintfW(SpecialId, ARRAYSIZE(SpecialId), L"%04x", (HIWORD(hkl) & 0x0FFF));
1326 LayoutSpecial = TRUE;
1327 }
1328
1329#define MAX_LAYOUTS_PER_LANGID 0x10000
1330 for (i = 0; i < (LayoutSpecial ? MAX_LAYOUTS_PER_LANGID : 1); i++)
1331 {
1332 /* Generate a hexadecimal identifier for keyboard layout registry key */
1334
1335 StringCchCopyW(LayoutPath, ARRAYSIZE(LayoutPath), L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\");
1336 StringCchCatW(LayoutPath, ARRAYSIZE(LayoutPath), LocaleName);
1338
1340 LayoutPath,
1341 0,
1343 &hKey) == ERROR_SUCCESS)
1344 {
1345 /* Make sure the keyboard layout key we opened is the one we need.
1346 * If the layout has no special id, just pass this check. */
1347 dwValueSize = sizeof(LocaleName);
1348 if (!LayoutSpecial ||
1350 L"Layout Id",
1351 NULL,
1352 NULL,
1353 (PVOID)&LocaleName,
1354 &dwValueSize) == ERROR_SUCCESS) &&
1355 (wcscmp(LocaleName, SpecialId) == 0)))
1356 {
1358 dwValueSize = sizeof(LocaleName);
1360 L"Layout Text",
1361 NULL,
1362 NULL,
1363 (PVOID)&LocaleName,
1364 &dwValueSize);
1365 /* Let the loop know where to stop */
1367 }
1369 }
1370 else
1371 {
1372 /* Keyboard layout registry keys are expected to go in order without gaps */
1373 break;
1374 }
1375 }
1376#undef MAX_LAYOUTS_PER_LANGID
1377
1378 LoadStringW(hDllInstance, IDS_LAYOUTTEXT, ResText, ARRAYSIZE(ResText));
1379 StringCchPrintfW(LayoutPath, ARRAYSIZE(LayoutPath), ResText, LocaleName);
1380
1381 SetWindowTextW(hwnd, LayoutPath);
1382}
static _In_ LPCWSTR LocaleName
#define IDS_LAYOUTTEXT
Definition: resource.h:126
unsigned int BOOL
Definition: ntddk_ex.h:94
HKL hkl
Definition: msctf.idl:632
UINT_PTR HKL
Definition: msctf.idl:125
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define MAX_LAYOUTS_PER_LANGID
uint32_t * LPDWORD
Definition: typedefs.h:59
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

Referenced by LocalePageDlgProc().

◆ SetLocalTimeZone()

static VOID SetLocalTimeZone ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1840 of file wizard.c.

1841{
1842 TIME_ZONE_INFORMATION TimeZoneInformation;
1844 DWORD dwIndex;
1845 DWORD i;
1846
1847 dwIndex = SendMessage(hwnd,
1849 0,
1850 0);
1851
1852 i = 0;
1854 while (i < dwIndex)
1855 {
1856 if (Entry == NULL)
1857 return;
1858
1859 i++;
1860 Entry = Entry->Next;
1861 }
1862
1863 wcscpy(TimeZoneInformation.StandardName,
1864 Entry->StandardName);
1865 wcscpy(TimeZoneInformation.DaylightName,
1866 Entry->DaylightName);
1867
1868 TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1869 TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1870 TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1871
1872 memcpy(&TimeZoneInformation.StandardDate,
1873 &Entry->TimezoneInfo.StandardDate,
1874 sizeof(SYSTEMTIME));
1875 memcpy(&TimeZoneInformation.DaylightDate,
1876 &Entry->TimezoneInfo.DaylightDate,
1877 sizeof(SYSTEMTIME));
1878
1879 /* Set time zone information */
1880 SetTimeZoneInformation(&TimeZoneInformation);
1881}
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
SYSTEMTIME DaylightDate
Definition: timezoneapi.h:30
SYSTEMTIME StandardDate
Definition: timezoneapi.h:27

Referenced by WriteDateTimeSettings().

◆ SetSystemLocalTime()

static BOOL SetSystemLocalTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1914 of file wizard.c.

1915{
1916 BOOL Ret = FALSE;
1917
1918 /*
1919 * Call SetLocalTime twice to ensure correct results
1920 */
1923
1924 return Ret;
1925}
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:328

Referenced by WriteDateTimeSettings().

◆ SetUserLocaleName()

static VOID SetUserLocaleName ( HWND  hwnd)
static

Definition at line 1287 of file wizard.c.

1288{
1289 WCHAR CurLocale[256] = L"";
1290 WCHAR CurGeo[256] = L"";
1291 WCHAR ResText[256] = L"";
1292 WCHAR LocaleText[256 * 2];
1293
1296
1297 LoadStringW(hDllInstance, IDS_LOCALETEXT, ResText, ARRAYSIZE(ResText));
1298 StringCchPrintfW(LocaleText, ARRAYSIZE(LocaleText), ResText, CurLocale, CurGeo);
1299
1300 SetWindowTextW(hwnd, LocaleText);
1301}
GEOID WINAPI GetUserGeoID(GEOCLASS GeoClass)
Definition: locale.c:4747
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2803
INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len, LANGID lang)
Definition: locale.c:5401
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1216
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
#define IDS_LOCALETEXT
Definition: resource.h:125
@ GEO_FRIENDLYNAME
Definition: winnls.h:646
#define LOCALE_SLANGUAGE
Definition: winnls.h:31
@ GEOCLASS_NATION
Definition: winnls.h:633

Referenced by LocalePageDlgProc().

◆ ShowItemError()

static VOID ShowItemError ( HWND  hwndDlg,
DWORD  LastError 
)
static

Definition at line 2535 of file wizard.c.

2538{
2540 WCHAR UnknownError[84];
2541 WCHAR Title[64];
2542
2544 NULL, LastError, 0, ErrorMessage, 0, NULL) == 0)
2545 {
2547 UnknownError,
2548 ARRAYSIZE(UnknownError) - 20) == 0)
2549 {
2550 wcscpy(UnknownError, L"Unknown error");
2551 }
2552 wcscat(UnknownError, L" ");
2553 _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
2554 ErrorMessage = UnknownError;
2555 }
2556
2557 if (ErrorMessage != NULL)
2558 {
2560 Title, ARRAYSIZE(Title)) == 0)
2561 {
2562 wcscpy(Title, L"ReactOS Setup");
2563 }
2564
2566 }
2567
2568 if (ErrorMessage != NULL &&
2569 ErrorMessage != UnknownError)
2570 {
2572 }
2573}
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
Definition: attrib.c:32
#define IDS_UNKNOWN_ERROR
Definition: resource.h:91
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
_ACRTIMP wchar_t *__cdecl _ultow(__msvcrt_ulong, wchar_t *, int)
Definition: string.c:2204
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:400
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396

Referenced by ProcessPageDlgProc().

◆ ShowStepError()

static VOID ShowStepError ( HWND  hwndDlg,
PREGISTRATIONNOTIFY  RegistrationNotify 
)
static

Definition at line 2578 of file wizard.c.

2581{
2582 WCHAR ErrorMessage[128];
2583 WCHAR Title[64];
2584
2585 if (LoadStringW(hDllInstance, RegistrationNotify->MessageID,
2587 ARRAYSIZE(ErrorMessage)) == 0)
2588 {
2589 ErrorMessage[0] = L'\0';
2590 }
2591
2592 if (RegistrationNotify->MessageID != IDS_TIMEOUT)
2593 {
2595 RegistrationNotify->LastError, 0,
2598 NULL);
2599 }
2600
2601 if (ErrorMessage[0] != L'\0')
2602 {
2604 Title, ARRAYSIZE(Title)) == 0)
2605 {
2606 wcscpy(Title, L"ReactOS Setup");
2607 }
2608
2609 MessageBoxW(hwndDlg, ErrorMessage,
2611 }
2612}

Referenced by ProcessPageDlgProc().

◆ ShowTimeZoneList()

static VOID ShowTimeZoneList ( HWND  hwnd,
PSETUPDATA  SetupData,
DWORD  dwEntryIndex 
)
static

Definition at line 1810 of file wizard.c.

1811{
1813 DWORD dwIndex = 0;
1814 DWORD dwCount;
1815
1816 GetTimeZoneListIndex(&dwEntryIndex);
1817
1819 while (Entry != NULL)
1820 {
1821 dwCount = SendMessage(hwnd,
1823 0,
1824 (LPARAM)Entry->Description);
1825
1826 if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1827 dwIndex = dwCount;
1828
1829 Entry = Entry->Next;
1830 }
1831
1834 (WPARAM)dwIndex,
1835 0);
1836}

Referenced by DateTimePageDlgProc().

◆ ThemePageDlgProc()

static INT_PTR CALLBACK ThemePageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2114 of file wizard.c.

2118{
2120 LPNMLISTVIEW pnmv;
2121
2122 /* Retrieve pointer to the global setup data */
2124
2125 switch (uMsg)
2126 {
2127 case WM_INITDIALOG:
2128 {
2129 HWND hListView;
2131 DWORD n;
2132 LVITEM lvi = {0};
2133
2134 /* Save pointer to the global setup data */
2137
2138 hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
2139
2140 /* Common */
2142 lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
2143
2144 for (n = 0; n < ARRAYSIZE(Themes); ++n)
2145 {
2146 WCHAR DisplayName[100] = {0};
2147 /* Load the bitmap */
2149 ImageList_AddMasked(himl, image, RGB(255,0,255));
2150
2151 /* Load the string */
2152 LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
2153 DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
2154
2155 /* Add the listview item */
2156 lvi.iItem = n;
2157 lvi.iImage = n;
2158 lvi.pszText = DisplayName;
2159 ListView_InsertItem(hListView, &lvi);
2160 }
2161
2162 /* Register the imagelist */
2164 /* Transparent background */
2165 ListView_SetBkColor(hListView, CLR_NONE);
2167 /* Reduce the size between the items */
2168 ListView_SetIconSpacing(hListView, 190, 173);
2169 break;
2170 }
2171
2172 case WM_NOTIFY:
2173 switch (((LPNMHDR)lParam)->code)
2174 {
2175 //case LVN_ITEMCHANGING:
2176 case LVN_ITEMCHANGED:
2177 pnmv = (LPNMLISTVIEW)lParam;
2178 if ((pnmv->uChanged & LVIF_STATE) && (pnmv->uNewState & LVIS_SELECTED))
2179 {
2180 int iTheme = pnmv->iItem;
2181 DPRINT1("Selected theme: %u\n", Themes[iTheme].DisplayName);
2182
2183 if (Themes[iTheme].ThemeFile)
2184 {
2185 WCHAR wszTheme[MAX_PATH];
2186 SHGetFolderPathAndSubDirW(0, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, Themes[iTheme].ThemeFile, wszTheme);
2187 EnableVisualTheme(hwndDlg, wszTheme);
2188 }
2189 else
2190 {
2191 EnableVisualTheme(hwndDlg, Themes[iTheme].ThemeFile);
2192 }
2193 }
2194 break;
2195 case PSN_SETACTIVE:
2196 /* Enable the Back and Next buttons */
2199 {
2201 return TRUE;
2202 }
2203 break;
2204
2205 case PSN_WIZNEXT:
2206 break;
2207
2208 case PSN_WIZBACK:
2210 break;
2211
2212 default:
2213 break;
2214 }
2215 break;
2216
2217 default:
2218 break;
2219 }
2220
2221 return FALSE;
2222}
HIMAGELIST himl
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:573
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2781
#define IDC_THEMEPICKER
Definition: resource.h:90
#define RGB(r, g, b)
Definition: precomp.h:67
GLdouble n
Definition: glext.h:7729
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2413
#define ListView_SetIconSpacing(hwndLV, cx, cy)
Definition: commctrl.h:2728
#define LVIF_STATE
Definition: commctrl.h:2317
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2309
#define CLR_NONE
Definition: commctrl.h:319
#define ListView_SetBkColor(hwnd, clrBk)
Definition: commctrl.h:2299
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define LVITEM
Definition: commctrl.h:2380
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVIF_TEXT
Definition: commctrl.h:2314
#define ILC_MASK
Definition: commctrl.h:351
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define ListView_SetTextBkColor(hwnd, clrTextBk)
Definition: commctrl.h:2668
#define LVN_ITEMCHANGED
Definition: commctrl.h:3136
#define LVSIL_NORMAL
Definition: commctrl.h:2303
@ SHGFP_TYPE_DEFAULT
Definition: shlobj.h:2158
#define CSIDL_RESOURCES
Definition: shlobj.h:2233
UINT uNewState
Definition: commctrl.h:3041
VOID EnableVisualTheme(_In_opt_ HWND hwndParent, _In_opt_ PCWSTR ThemeFile)
Definition: wizard.c:1448
static struct ThemeInfo Themes[]
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109

Referenced by InstallWizard().

◆ UpdateAutoDaylightCheckbox()

static VOID UpdateAutoDaylightCheckbox ( HWND  hwndDlg,
PTIMEZONE_ENTRY  Entry 
)
static

Definition at line 1797 of file wizard.c.

1798{
1799 BOOL bHasDST = (Entry != NULL && HasDaylightSavingTime(Entry));
1800
1801 /* Enable or disable the checkbox based on DST support */
1802 EnableDlgItem(hwndDlg, IDC_AUTODAYLIGHT, bHasDST);
1803
1804 /* Check the checkbox only if DST is supported, otherwise uncheck it */
1806 (WPARAM)(bHasDST ? BST_CHECKED : BST_UNCHECKED), 0);
1807}

Referenced by DateTimePageDlgProc().

◆ UpdateLocalSystemTime()

static VOID UpdateLocalSystemTime ( HWND  hwnd,
SYSTEMTIME  LocalTime 
)
static

Definition at line 1929 of file wizard.c.

1930{
1933}
#define DateTime_SetSystemtime(hdp, gd, pst)
Definition: commctrl.h:4337

Referenced by DateTimePageDlgProc().

◆ WelcomeDlgProc()

static INT_PTR CALLBACK WelcomeDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 191 of file wizard.c.

195{
196 PSETUPDATA pSetupData;
197
198 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
199
200 switch (uMsg)
201 {
202 case WM_INITDIALOG:
203 {
204 HWND hwndControl;
205 DWORD dwStyle;
206
207 /* Get pointer to the global setup data */
208 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
209 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
210
211 hwndControl = GetParent(hwndDlg);
212
213 /* Center the wizard window */
214 CenterWindow(hwndControl);
215
216 /* Hide the system menu */
217 dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
218 SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
219
220 /* Hide and disable the 'Cancel' button */
221 hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
222 ShowWindow(hwndControl, SW_HIDE);
223 EnableWindow(hwndControl, FALSE);
224
225 /* Set title font */
226 SendDlgItemMessage(hwndDlg,
229 (WPARAM)pSetupData->hTitleFont,
230 (LPARAM)TRUE);
231 }
232 break;
233
234 case WM_NOTIFY:
235 {
236 LPNMHDR lpnm = (LPNMHDR)lParam;
237
238 switch (lpnm->code)
239 {
240 case PSN_SETACTIVE:
241 {
242 LogItem(L"BEGIN", L"WelcomePage");
243 /* Only "Next" for the first page and hide "Back" */
245 // PropSheet_ShowWizButtons(GetParent(hwndDlg), 0, PSWIZB_BACK);
247 if (pSetupData->UnattendSetup)
248 {
250 return TRUE;
251 }
252 break;
253 }
254
255 case PSN_KILLACTIVE:
256 {
257 /* Show "Back" button */
258 // PropSheet_ShowWizButtons(GetParent(hwndDlg), PSWIZB_BACK, PSWIZB_BACK);
260 break;
261 }
262
263 case PSN_WIZNEXT:
264 LogItem(L"END", L"WelcomePage");
265 break;
266
267 case PSN_WIZBACK:
268 pSetupData->UnattendSetup = FALSE;
269 break;
270
271 default:
272 break;
273 }
274 }
275 break;
276
277 default:
278 break;
279 }
280
281 return FALSE;
282}
#define IDC_WELCOMETITLE
Definition: resource.h:16
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
#define WS_SYSMENU
Definition: pedump.c:629
#define GWL_STYLE
Definition: winuser.h:863

◆ WriteComputerSettings()

static BOOL WriteComputerSettings ( WCHAR ComputerName,
HWND  hwndDlg 
)
static

Definition at line 980 of file wizard.c.

981{
982 WCHAR Title[64];
983 WCHAR ErrorComputerName[256];
984 LONG lError;
985 HKEY hKey = NULL;
986
987 if (!SetComputerNameW(ComputerName))
988 {
989 if (hwndDlg != NULL)
990 {
992 {
993 wcscpy(Title, L"ReactOS Setup");
994 }
995 if (0 == LoadStringW(hDllInstance, IDS_WZD_SETCOMPUTERNAME, ErrorComputerName,
996 ARRAYSIZE(ErrorComputerName)))
997 {
998 wcscpy(ErrorComputerName, L"Setup failed to set the computer name.");
999 }
1000 MessageBoxW(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK);
1001 }
1002
1003 return FALSE;
1004 }
1005
1006 /* Set the physical DNS domain */
1007 SetComputerNameExW(ComputerNamePhysicalDnsDomain, L"");
1008
1009 /* Set the physical DNS hostname */
1010 SetComputerNameExW(ComputerNamePhysicalDnsHostname, ComputerName);
1011
1012 /* Set the accounts domain name */
1013 SetAccountsDomainSid(NULL, ComputerName);
1014
1015 /* Now we need to set the Hostname */
1017 L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
1018 0,
1019 NULL,
1021 KEY_WRITE,
1022 NULL,
1023 &hKey,
1024 NULL);
1025 if (lError == ERROR_SUCCESS)
1026 {
1027 lError = RegSetValueEx(hKey,
1028 L"Hostname",
1029 0,
1030 REG_SZ,
1031 (LPBYTE)ComputerName,
1032 (wcslen(ComputerName) + 1) * sizeof(WCHAR));
1033 if (lError != ERROR_SUCCESS)
1034 {
1035 DPRINT1("RegSetValueEx(\"Hostname\") failed (%08lX)\n", lError);
1036 }
1037
1039 }
1040 else
1041 {
1042 DPRINT1("RegCreateKeyExW for Tcpip\\Parameters failed (%08lX)\n", lError);
1043 }
1044
1045 return TRUE;
1046}
BOOL WINAPI SetComputerNameW(LPCWSTR lpComputerName)
Definition: compname.c:616
BOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPCWSTR lpBuffer)
Definition: compname.c:648
#define IDS_WZD_SETCOMPUTERNAME
Definition: resource.h:151
NTSTATUS WINAPI SetAccountsDomainSid(PSID DomainSid, LPCWSTR DomainName)
Definition: security.c:28
#define RegSetValueEx
Definition: winreg.h:565

Referenced by ComputerPageDlgProc().

◆ WriteDateTimeSettings()

static BOOL WriteDateTimeSettings ( HWND  hwndDlg,
PSETUPDATA  SetupData 
)
static

Definition at line 1937 of file wizard.c.

1938{
1939 WCHAR Title[64];
1940 WCHAR ErrorLocalTime[256];
1941
1942 GetLocalSystemTime(hwndDlg, SetupData);
1944 SetupData);
1945
1947 BM_GETCHECK, 0, 0) != BST_UNCHECKED);
1948 if (!SetSystemLocalTime(hwndDlg, SetupData))
1949 {
1951 {
1952 wcscpy(Title, L"ReactOS Setup");
1953 }
1954 if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime,
1955 ARRAYSIZE(ErrorLocalTime)))
1956 {
1957 wcscpy(ErrorLocalTime, L"Setup was unable to set the local time.");
1958 }
1959 MessageBoxW(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK);
1960 return FALSE;
1961 }
1962
1963 return TRUE;
1964}
#define IDS_WZD_LOCALTIME
Definition: resource.h:156
static BOOL SetSystemLocalTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1914
static BOOL GetLocalSystemTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1885
static VOID SetLocalTimeZone(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1840
VOID SetAutoDaylight(IN BOOL EnableAutoDaylightTime)
Definition: tzlib.c:323
#define MB_ICONWARNING
Definition: winuser.h:797
#define BM_GETCHECK
Definition: winuser.h:1947

Referenced by DateTimePageDlgProc().

◆ WriteDefaultLogonData()

static BOOL WriteDefaultLogonData ( LPWSTR  Domain)
static

Definition at line 1051 of file wizard.c.

1052{
1053 WCHAR szAdministratorName[256];
1054 HKEY hKey = NULL;
1055 LONG lError;
1056
1059 szAdministratorName,
1060 ARRAYSIZE(szAdministratorName)) == 0)
1061 {
1062 wcscpy(szAdministratorName, L"Administrator");
1063 }
1064
1066 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1067 0,
1069 &hKey);
1070 if (lError != ERROR_SUCCESS)
1071 return FALSE;
1072
1073 lError = RegSetValueEx(hKey,
1074 L"DefaultDomainName",
1075 0,
1076 REG_SZ,
1077 (LPBYTE)Domain,
1078 (wcslen(Domain)+ 1) * sizeof(WCHAR));
1079 if (lError != ERROR_SUCCESS)
1080 {
1081 DPRINT1("RegSetValueEx(\"DefaultDomainName\") failed!\n");
1082 }
1083
1084 lError = RegSetValueEx(hKey,
1085 L"DefaultUserName",
1086 0,
1087 REG_SZ,
1088 (LPBYTE)szAdministratorName,
1089 (wcslen(szAdministratorName)+ 1) * sizeof(WCHAR));
1090 if (lError != ERROR_SUCCESS)
1091 {
1092 DPRINT1("RegSetValueEx(\"DefaultUserName\") failed!\n");
1093 }
1094
1096
1097 return TRUE;
1098}
#define IDS_ADMINISTRATOR_NAME
Definition: resource.h:147
_In_ ULONG Domain
Definition: haltypes.h:1814

Referenced by ComputerPageDlgProc().

◆ WriteOwnerSettings()

static BOOL WriteOwnerSettings ( WCHAR OwnerName,
WCHAR OwnerOrganization 
)
static

Definition at line 829 of file wizard.c.

831{
832 HKEY hKey;
833 LONG res;
834
836 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
837 0,
839 &hKey);
840
841 if (res != ERROR_SUCCESS)
842 {
843 return FALSE;
844 }
845
847 L"RegisteredOwner",
848 0,
849 REG_SZ,
850 (LPBYTE)OwnerName,
851 (wcslen(OwnerName) + 1) * sizeof(WCHAR));
852
853 if (res != ERROR_SUCCESS)
854 {
856 return FALSE;
857 }
858
860 L"RegisteredOrganization",
861 0,
862 REG_SZ,
863 (LPBYTE)OwnerOrganization,
864 (wcslen(OwnerOrganization) + 1) * sizeof(WCHAR));
865
867 return (res == ERROR_SUCCESS);
868}

Referenced by OwnerPageDlgProc().

◆ WriteUserLocale()

static VOID WriteUserLocale ( VOID  )
static

Definition at line 1531 of file wizard.c.

1532{
1533 HKEY hKey;
1534 LCID lcid;
1535 WCHAR Locale[9] = L"0000";
1536
1538
1539 if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, &Locale[4], _countof(Locale) - 4) != 0)
1540 {
1541 if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International",
1544 {
1545 RegSetValueExW(hKey, L"Locale", 0, REG_SZ, (LPBYTE)Locale, (wcslen(Locale) + 1) * sizeof(WCHAR));
1547 }
1548 }
1549}
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1235
LCID lcid
Definition: locale.c:5660
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
DWORD LCID
Definition: nls.h:13
#define LOCALE_ILANGUAGE
Definition: winnls.h:30

Referenced by LocalePageDlgProc().

Variable Documentation

◆ InstallationTypes

const WCHAR* InstallationTypes[INSTALLATION_TYPE_MAX]
static
Initial value:
=
{
L"Server",
L"Client",
L"Server Core",
}

Definition at line 417 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_DefaultSoundEvents

const WCHAR* s_DefaultSoundEvents[][2]
static
Initial value:
=
{
{ L".Default", L"%SystemRoot%\\Media\\ReactOS_Default.wav" },
{ L"AppGPFault", L"" },
{ L"Close", L"" },
{ L"CriticalBatteryAlarm", L"%SystemRoot%\\Media\\ReactOS_Battery_Critical.wav" },
{ L"DeviceConnect", L"%SystemRoot%\\Media\\ReactOS_Hardware_Insert.wav" },
{ L"DeviceDisconnect", L"%SystemRoot%\\Media\\ReactOS_Hardware_Remove.wav" },
{ L"DeviceFail", L"%SystemRoot%\\Media\\ReactOS_Hardware_Fail.wav" },
{ L"LowBatteryAlarm", L"%SystemRoot%\\Media\\ReactOS_Battery_Low.wav" },
{ L"MailBeep", L"%SystemRoot%\\Media\\ReactOS_Notify.wav" },
{ L"Maximize", L"%SystemRoot%\\Media\\ReactOS_Restore.wav" },
{ L"MenuCommand", L"%SystemRoot%\\Media\\ReactOS_Menu_Command.wav" },
{ L"MenuPopup", L"" },
{ L"Minimize", L"%SystemRoot%\\Media\\ReactOS_Minimize.wav" },
{ L"Open", L"" },
{ L"PrintComplete", L"%SystemRoot%\\Media\\ReactOS_Print_Complete.wav" },
{ L"RestoreDown", L"" },
{ L"RestoreUp", L"" },
{ L"SystemAsterisk", L"%SystemRoot%\\Media\\ReactOS_Ding.wav" },
{ L"SystemExclamation", L"%SystemRoot%\\Media\\ReactOS_Exclamation.wav" },
{ L"SystemExit", L"%SystemRoot%\\Media\\ReactOS_Shutdown.wav" },
{ L"SystemHand", L"%SystemRoot%\\Media\\ReactOS_Critical_Stop.wav" },
{ L"SystemNotification", L"%SystemRoot%\\Media\\ReactOS_Balloon.wav" },
{ L"SystemQuestion", L"%SystemRoot%\\Media\\ReactOS_Ding.wav" },
{ L"SystemStart", L"%SystemRoot%\\Media\\ReactOS_Startup.wav" },
{ L"WindowsLogoff", L"%SystemRoot%\\Media\\ReactOS_LogOff.wav" }
}

Definition at line 425 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_ExplorerSoundEvents

const WCHAR* s_ExplorerSoundEvents[][2]
static
Initial value:
=
{
{ L"EmptyRecycleBin", L"%SystemRoot%\\Media\\ReactOS_Recycle.wav" },
{ L"Navigating", L"%SystemRoot%\\Media\\ReactOS_Start.wav" }
}

Definition at line 455 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_ProductOptionData

const PRODUCT_OPTION_DATA s_ProductOptionData[INSTALLATION_TYPE_MAX]
static
Initial value:
=
{
{ L"Terminal Server\0", L"ServerNT", 0, 0x200, 0 },
{ L"\0", L"WinNT", 1, 0x300, 1 },
{ L"Terminal Server\0", L"ServerNT", 0, 0x200, 0 }
}

Definition at line 409 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_szControlWindows

const WCHAR s_szControlWindows[] = L"SYSTEM\\CurrentControlSet\\Control\\Windows"
static

Definition at line 394 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_szCurrentVersion

const WCHAR s_szCurrentVersion[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"
static

Definition at line 398 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_szDefaultSoundEvents

const WCHAR s_szDefaultSoundEvents[] = L"AppEvents\\Schemes\\Apps\\.Default"
static

Definition at line 396 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_szExplorerSoundEvents

const WCHAR s_szExplorerSoundEvents[] = L"AppEvents\\Schemes\\Apps\\Explorer"
static

Definition at line 397 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_szProductOptions

const WCHAR s_szProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions"
static

Definition at line 392 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_szRosVersion

const WCHAR s_szRosVersion[] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version"
static

Definition at line 393 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ s_szWinlogon

const WCHAR s_szWinlogon[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
static

Definition at line 395 of file wizard.c.

Referenced by DoWriteInstallationType().

◆ Themes

struct ThemeInfo Themes[]
static
Initial value:
= {
{ MAKEINTRESOURCE(IDB_LAUTUS), IDS_LAUTUS, L"themes\\lautus\\lautus.msstyles" },
{ MAKEINTRESOURCE(IDB_LUNAR), IDS_LUNAR, L"themes\\lunar\\lunar.msstyles" },
{ MAKEINTRESOURCE(IDB_MIZU), IDS_MIZU, L"themes\\mizu\\mizu.msstyles"},
}
#define IDS_LAUTUS
Definition: resource.h:169
#define IDB_LUNAR
Definition: resource.h:25
#define IDB_MIZU
Definition: resource.h:26
#define IDS_CLASSIC
Definition: resource.h:168
#define IDS_LUNAR
Definition: resource.h:170
#define IDS_MIZU
Definition: resource.h:171
#define IDB_LAUTUS
Definition: resource.h:24
#define IDB_CLASSIC
Definition: resource.h:23

Referenced by ThemePageDlgProc().