mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 14:37:45 +00:00
[SETUP:REACTOS] Populate the list of existing installations.
- In the 1st-stage GUI setup, display the list of existing discovered NTOS installations, with its name, installation path and vendor name, and an associated icon.
This commit is contained in:
parent
f7ee1e2ffd
commit
4bf9f6fa4a
|
@ -29,6 +29,9 @@
|
||||||
|
|
||||||
/* GLOBALS ******************************************************************/
|
/* GLOBALS ******************************************************************/
|
||||||
|
|
||||||
|
#define IDS_LIST_COLUMN_FIRST IDS_PARTITION_NAME
|
||||||
|
#define IDS_LIST_COLUMN_LAST IDS_PARTITION_TYPE
|
||||||
|
|
||||||
#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
|
#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
|
||||||
static const UINT column_ids[MAX_LIST_COLUMNS] = {IDS_LIST_COLUMN_FIRST, IDS_LIST_COLUMN_FIRST + 1, IDS_LIST_COLUMN_FIRST + 2};
|
static const UINT column_ids[MAX_LIST_COLUMNS] = {IDS_LIST_COLUMN_FIRST, IDS_LIST_COLUMN_FIRST + 1, IDS_LIST_COLUMN_FIRST + 2};
|
||||||
static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 150};
|
static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 150};
|
||||||
|
|
|
@ -39,8 +39,6 @@ SETUPDATA SetupData;
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
LONG LoadGenentry(HINF hinf,PCTSTR name,PGENENTRY *gen,PINFCONTEXT context);
|
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
CenterWindow(HWND hWnd)
|
CenterWindow(HWND hWnd)
|
||||||
{
|
{
|
||||||
|
@ -112,14 +110,14 @@ StartDlgProc(
|
||||||
PSETUPDATA pSetupData;
|
PSETUPDATA pSetupData;
|
||||||
|
|
||||||
/* Retrieve pointer to the global setup data */
|
/* Retrieve pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
|
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Save pointer to the global setup data */
|
/* Save pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
||||||
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
||||||
|
|
||||||
/* Center the wizard window */
|
/* Center the wizard window */
|
||||||
CenterWindow(GetParent(hwndDlg));
|
CenterWindow(GetParent(hwndDlg));
|
||||||
|
@ -166,96 +164,34 @@ TypeDlgProc(
|
||||||
PSETUPDATA pSetupData;
|
PSETUPDATA pSetupData;
|
||||||
|
|
||||||
/* Retrieve pointer to the global setup data */
|
/* Retrieve pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
|
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
/* Save pointer to the global setup data */
|
/* Save pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
||||||
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
||||||
|
|
||||||
/* Check the 'install' radio button */
|
/* Check the 'install' radio button */
|
||||||
CheckDlgButton(hwndDlg, IDC_INSTALL, BST_CHECKED);
|
CheckDlgButton(hwndDlg, IDC_INSTALL, BST_CHECKED);
|
||||||
|
|
||||||
/* Disable the 'update' radio button and text */
|
/*
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
|
* Enable the 'update' radio button and text only if we have
|
||||||
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATETEXT), FALSE);
|
* available NT installations, otherwise disable them.
|
||||||
break;
|
*/
|
||||||
|
if (pSetupData->NtOsInstallsList &&
|
||||||
case WM_NOTIFY:
|
GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0)
|
||||||
{
|
|
||||||
LPNMHDR lpnm = (LPNMHDR)lParam;
|
|
||||||
|
|
||||||
switch (lpnm->code)
|
|
||||||
{
|
{
|
||||||
case PSN_SETACTIVE:
|
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), TRUE);
|
||||||
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK);
|
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATETEXT), TRUE);
|
||||||
break;
|
}
|
||||||
|
else
|
||||||
case PSN_QUERYCANCEL:
|
{
|
||||||
SetWindowLongPtr(hwndDlg,
|
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE);
|
||||||
DWLP_MSGRESULT,
|
EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATETEXT), FALSE);
|
||||||
MessageBox(GetParent(hwndDlg),
|
|
||||||
pSetupData->szAbortMessage,
|
|
||||||
pSetupData->szAbortTitle,
|
|
||||||
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case PSN_WIZNEXT: // set the selected data
|
|
||||||
pSetupData->RepairUpdateFlag = !(SendMessage(GetDlgItem(hwndDlg, IDC_INSTALL),
|
|
||||||
BM_GETCHECK,
|
|
||||||
(WPARAM) 0,
|
|
||||||
(LPARAM) 0) == BST_CHECKED);
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
|
|
||||||
static const UINT column_ids[MAX_LIST_COLUMNS] = {IDS_LIST_COLUMN_FIRST, IDS_LIST_COLUMN_FIRST + 1, IDS_LIST_COLUMN_FIRST + 2};
|
|
||||||
static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 150};
|
|
||||||
static const INT column_alignment[MAX_LIST_COLUMNS] = {LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT};
|
|
||||||
|
|
||||||
static INT_PTR CALLBACK
|
|
||||||
UpgradeRepairDlgProc(
|
|
||||||
IN HWND hwndDlg,
|
|
||||||
IN UINT uMsg,
|
|
||||||
IN WPARAM wParam,
|
|
||||||
IN LPARAM lParam)
|
|
||||||
{
|
|
||||||
PSETUPDATA pSetupData;
|
|
||||||
HWND hList;
|
|
||||||
|
|
||||||
/* Retrieve pointer to the global setup data */
|
|
||||||
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWL_USERDATA);
|
|
||||||
|
|
||||||
switch (uMsg)
|
|
||||||
{
|
|
||||||
case WM_INITDIALOG:
|
|
||||||
{
|
|
||||||
/* Save pointer to the global setup data */
|
|
||||||
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
|
||||||
SetWindowLongPtrW(hwndDlg, GWL_USERDATA, (DWORD_PTR)pSetupData);
|
|
||||||
|
|
||||||
hList = GetDlgItem(hwndDlg, IDC_LIST1);
|
|
||||||
|
|
||||||
CreateListViewColumns(pSetupData->hInstance,
|
|
||||||
hList,
|
|
||||||
column_ids,
|
|
||||||
column_widths,
|
|
||||||
column_alignment,
|
|
||||||
MAX_LIST_COLUMNS);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -272,18 +208,316 @@ UpgradeRepairDlgProc(
|
||||||
|
|
||||||
case PSN_QUERYCANCEL:
|
case PSN_QUERYCANCEL:
|
||||||
SetWindowLongPtrW(hwndDlg,
|
SetWindowLongPtrW(hwndDlg,
|
||||||
DWL_MSGRESULT,
|
DWLP_MSGRESULT,
|
||||||
MessageBox(GetParent(hwndDlg),
|
MessageBoxW(GetParent(hwndDlg),
|
||||||
pSetupData->szAbortMessage,
|
pSetupData->szAbortMessage,
|
||||||
pSetupData->szAbortTitle,
|
pSetupData->szAbortTitle,
|
||||||
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case PSN_WIZNEXT: // set the selected data
|
case PSN_WIZNEXT: /* Set the selected data */
|
||||||
pSetupData->RepairUpdateFlag = !(SendMessageW(GetDlgItem(hwndDlg, IDC_INSTALL),
|
{
|
||||||
BM_GETCHECK,
|
pSetupData->RepairUpdateFlag =
|
||||||
(WPARAM) 0,
|
!(SendMessageW(GetDlgItem(hwndDlg, IDC_INSTALL),
|
||||||
(LPARAM) 0) == BST_CHECKED);
|
BM_GETCHECK,
|
||||||
|
0, 0) == BST_CHECKED);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Display the existing NT installations page only
|
||||||
|
* if we have more than one available NT installations.
|
||||||
|
*/
|
||||||
|
if (pSetupData->NtOsInstallsList &&
|
||||||
|
GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
|
||||||
|
{
|
||||||
|
/* Actually the best would be to dynamically insert the page only when needed */
|
||||||
|
SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, IDD_UPDATEREPAIRPAGE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, IDD_DEVICEPAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PGET_ENTRY_DESCRIPTION)(
|
||||||
|
IN PGENERIC_LIST_ENTRY Entry,
|
||||||
|
OUT PWSTR Buffer,
|
||||||
|
IN SIZE_T cchBufferSize);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
InitGenericComboList(
|
||||||
|
IN HWND hWndList,
|
||||||
|
IN PGENERIC_LIST List,
|
||||||
|
IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
|
||||||
|
{
|
||||||
|
INT Index, CurrentEntryIndex = 0;
|
||||||
|
PGENERIC_LIST_ENTRY ListEntry;
|
||||||
|
PLIST_ENTRY Entry;
|
||||||
|
WCHAR CurrentItemText[256];
|
||||||
|
|
||||||
|
for (Entry = List->ListHead.Flink;
|
||||||
|
Entry != &List->ListHead;
|
||||||
|
Entry = Entry->Flink)
|
||||||
|
{
|
||||||
|
ListEntry = CONTAINING_RECORD(Entry, GENERIC_LIST_ENTRY, Entry);
|
||||||
|
|
||||||
|
if (GetEntryDescriptionProc)
|
||||||
|
{
|
||||||
|
GetEntryDescriptionProc(ListEntry,
|
||||||
|
CurrentItemText,
|
||||||
|
ARRAYSIZE(CurrentItemText));
|
||||||
|
Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)CurrentItemText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)L"n/a");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ListEntry == List->CurrentEntry)
|
||||||
|
CurrentEntryIndex = Index;
|
||||||
|
|
||||||
|
SendMessageW(hWndList, CB_SETITEMDATA, Index, (LPARAM)ListEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
SendMessageW(hWndList, CB_SETCURSEL, CurrentEntryIndex, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
INT
|
||||||
|
GetSelectedComboListItem(
|
||||||
|
IN HWND hWndList)
|
||||||
|
{
|
||||||
|
LRESULT Index;
|
||||||
|
|
||||||
|
Index = SendMessageW(hWndList, CB_GETCURSEL, 0, 0);
|
||||||
|
if (Index == CB_ERR)
|
||||||
|
return CB_ERR;
|
||||||
|
|
||||||
|
// TODO: Update List->CurrentEntry?
|
||||||
|
// return SendMessageW(hWndList, CB_GETITEMDATA, (WPARAM)Index, 0);
|
||||||
|
return Index;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PADD_ENTRY_ITEM)(
|
||||||
|
IN HWND hWndList,
|
||||||
|
IN LVITEM* plvItem,
|
||||||
|
IN PGENERIC_LIST_ENTRY Entry,
|
||||||
|
IN OUT PWSTR Buffer,
|
||||||
|
IN SIZE_T cchBufferSize);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
InitGenericListView(
|
||||||
|
IN HWND hWndList,
|
||||||
|
IN PGENERIC_LIST List,
|
||||||
|
IN PADD_ENTRY_ITEM AddEntryItemProc)
|
||||||
|
{
|
||||||
|
INT CurrentEntryIndex = 0;
|
||||||
|
LVITEM lvItem;
|
||||||
|
PGENERIC_LIST_ENTRY ListEntry;
|
||||||
|
PLIST_ENTRY Entry;
|
||||||
|
WCHAR CurrentItemText[256];
|
||||||
|
|
||||||
|
for (Entry = List->ListHead.Flink;
|
||||||
|
Entry != &List->ListHead;
|
||||||
|
Entry = Entry->Flink)
|
||||||
|
{
|
||||||
|
ListEntry = CONTAINING_RECORD(Entry, GENERIC_LIST_ENTRY, Entry);
|
||||||
|
|
||||||
|
if (!AddEntryItemProc)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
AddEntryItemProc(hWndList,
|
||||||
|
&lvItem,
|
||||||
|
ListEntry,
|
||||||
|
CurrentItemText,
|
||||||
|
ARRAYSIZE(CurrentItemText));
|
||||||
|
|
||||||
|
if (ListEntry == List->CurrentEntry)
|
||||||
|
CurrentEntryIndex = lvItem.iItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
SendMessageW(hWndList, LVM_ENSUREVISIBLE, CurrentEntryIndex, FALSE);
|
||||||
|
ListView_SetItemState(hWndList, CurrentEntryIndex, LVIS_SELECTED, LVIS_SELECTED);
|
||||||
|
ListView_SetItemState(hWndList, CurrentEntryIndex, LVIS_FOCUSED, LVIS_FOCUSED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
NTAPI
|
||||||
|
GetSettingDescription(
|
||||||
|
IN PGENERIC_LIST_ENTRY Entry,
|
||||||
|
OUT PWSTR Buffer,
|
||||||
|
IN SIZE_T cchBufferSize)
|
||||||
|
{
|
||||||
|
StringCchCopyW(Buffer, cchBufferSize,
|
||||||
|
((PGENENTRY)GetListEntryData(Entry))->Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
NTAPI
|
||||||
|
AddNTOSInstallationItem(
|
||||||
|
IN HWND hWndList,
|
||||||
|
IN LVITEM* plvItem,
|
||||||
|
IN PGENERIC_LIST_ENTRY Entry,
|
||||||
|
IN OUT PWSTR Buffer, // SystemRootPath
|
||||||
|
IN SIZE_T cchBufferSize)
|
||||||
|
{
|
||||||
|
PNTOS_INSTALLATION NtOsInstall = (PNTOS_INSTALLATION)GetListEntryData(Entry);
|
||||||
|
PPARTENTRY PartEntry = NtOsInstall->PartEntry;
|
||||||
|
|
||||||
|
if (PartEntry && PartEntry->DriveLetter)
|
||||||
|
{
|
||||||
|
/* We have retrieved a partition that is mounted */
|
||||||
|
StringCchPrintfW(Buffer, cchBufferSize,
|
||||||
|
L"%C:%s",
|
||||||
|
PartEntry->DriveLetter,
|
||||||
|
NtOsInstall->PathComponent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We failed somewhere, just show the NT path */
|
||||||
|
StringCchPrintfW(Buffer, cchBufferSize,
|
||||||
|
L"%wZ",
|
||||||
|
&NtOsInstall->SystemNtPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
plvItem->mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
|
||||||
|
plvItem->iItem = 0;
|
||||||
|
plvItem->iSubItem = 0;
|
||||||
|
plvItem->lParam = (LPARAM)Entry;
|
||||||
|
plvItem->pszText = NtOsInstall->InstallationName;
|
||||||
|
|
||||||
|
/* Associate vendor icon */
|
||||||
|
if (FindSubStrI(NtOsInstall->VendorName, VENDOR_REACTOS))
|
||||||
|
{
|
||||||
|
plvItem->mask |= LVIF_IMAGE;
|
||||||
|
plvItem->iImage = 0;
|
||||||
|
}
|
||||||
|
else if (FindSubStrI(NtOsInstall->VendorName, VENDOR_MICROSOFT))
|
||||||
|
{
|
||||||
|
plvItem->mask |= LVIF_IMAGE;
|
||||||
|
plvItem->iImage = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
plvItem->iItem = SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)plvItem);
|
||||||
|
|
||||||
|
plvItem->iSubItem = 1;
|
||||||
|
plvItem->pszText = Buffer; // SystemRootPath;
|
||||||
|
SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
|
||||||
|
|
||||||
|
plvItem->iSubItem = 2;
|
||||||
|
plvItem->pszText = NtOsInstall->VendorName;
|
||||||
|
SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define IDS_LIST_COLUMN_FIRST IDS_INSTALLATION_NAME
|
||||||
|
#define IDS_LIST_COLUMN_LAST IDS_INSTALLATION_VENDOR
|
||||||
|
|
||||||
|
#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
|
||||||
|
static const UINT column_ids[MAX_LIST_COLUMNS] = {IDS_LIST_COLUMN_FIRST, IDS_LIST_COLUMN_FIRST + 1, IDS_LIST_COLUMN_FIRST + 2};
|
||||||
|
static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 100};
|
||||||
|
static const INT column_alignment[MAX_LIST_COLUMNS] = {LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT};
|
||||||
|
|
||||||
|
static INT_PTR CALLBACK
|
||||||
|
UpgradeRepairDlgProc(
|
||||||
|
IN HWND hwndDlg,
|
||||||
|
IN UINT uMsg,
|
||||||
|
IN WPARAM wParam,
|
||||||
|
IN LPARAM lParam)
|
||||||
|
{
|
||||||
|
PSETUPDATA pSetupData;
|
||||||
|
HWND hList;
|
||||||
|
HIMAGELIST hSmall;
|
||||||
|
|
||||||
|
/* Retrieve pointer to the global setup data */
|
||||||
|
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
||||||
|
|
||||||
|
switch (uMsg)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
|
/* Save pointer to the global setup data */
|
||||||
|
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
||||||
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
||||||
|
|
||||||
|
hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
|
||||||
|
|
||||||
|
CreateListViewColumns(pSetupData->hInstance,
|
||||||
|
hList,
|
||||||
|
column_ids,
|
||||||
|
column_widths,
|
||||||
|
column_alignment,
|
||||||
|
MAX_LIST_COLUMNS);
|
||||||
|
|
||||||
|
/* Create the ImageList */
|
||||||
|
hSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON),
|
||||||
|
GetSystemMetrics(SM_CYSMICON),
|
||||||
|
ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
|
||||||
|
1, 1);
|
||||||
|
|
||||||
|
/* Add event type icons to the ImageList */
|
||||||
|
ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_ROSICON)));
|
||||||
|
ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_WINICON)));
|
||||||
|
|
||||||
|
/* Assign the ImageList to the List View */
|
||||||
|
ListView_SetImageList(hList, hSmall, LVSIL_SMALL);
|
||||||
|
|
||||||
|
InitGenericListView(hList, pSetupData->NtOsInstallsList, AddNTOSInstallationItem);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_DESTROY:
|
||||||
|
{
|
||||||
|
hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
|
||||||
|
hSmall = ListView_GetImageList(hList, LVSIL_SMALL);
|
||||||
|
ListView_SetImageList(hList, NULL, LVSIL_SMALL);
|
||||||
|
ImageList_Destroy(hSmall);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_NOTIFY:
|
||||||
|
{
|
||||||
|
LPNMHDR lpnm = (LPNMHDR)lParam;
|
||||||
|
|
||||||
|
switch (lpnm->code)
|
||||||
|
{
|
||||||
|
case PSN_SETACTIVE:
|
||||||
|
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PSN_QUERYCANCEL:
|
||||||
|
SetWindowLongPtrW(hwndDlg,
|
||||||
|
DWLP_MSGRESULT,
|
||||||
|
MessageBoxW(GetParent(hwndDlg),
|
||||||
|
pSetupData->szAbortMessage,
|
||||||
|
pSetupData->szAbortTitle,
|
||||||
|
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
case PSN_WIZNEXT: /* Set the selected data */
|
||||||
|
pSetupData->RepairUpdateFlag =
|
||||||
|
!(SendMessageW(GetDlgItem(hwndDlg, IDC_INSTALL),
|
||||||
|
BM_GETCHECK,
|
||||||
|
0, 0) == BST_CHECKED);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -307,47 +541,33 @@ DeviceDlgProc(
|
||||||
IN LPARAM lParam)
|
IN LPARAM lParam)
|
||||||
{
|
{
|
||||||
PSETUPDATA pSetupData;
|
PSETUPDATA pSetupData;
|
||||||
LONG i;
|
|
||||||
LRESULT tindex;
|
|
||||||
HWND hList;
|
HWND hList;
|
||||||
|
|
||||||
/* Retrieve pointer to the global setup data */
|
/* Retrieve pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
|
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
|
{
|
||||||
/* Save pointer to the global setup data */
|
/* Save pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
||||||
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
||||||
|
|
||||||
hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
|
hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
|
||||||
|
InitGenericComboList(hList, pSetupData->ComputerList, GetSettingDescription);
|
||||||
for (i=0; i < pSetupData->CompCount; i++)
|
|
||||||
{
|
|
||||||
tindex = SendMessage(hList, CB_ADDSTRING, (WPARAM) 0, (LPARAM) pSetupData->pComputers[i].Value);
|
|
||||||
SendMessage(hList, CB_SETITEMDATA, tindex, i);
|
|
||||||
}
|
|
||||||
SendMessage(hList, CB_SETCURSEL, 0, 0); // set first as default
|
|
||||||
|
|
||||||
hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
|
hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
|
||||||
|
InitGenericComboList(hList, pSetupData->DisplayList, GetSettingDescription);
|
||||||
for (i=0; i < pSetupData->DispCount; i++)
|
|
||||||
{
|
|
||||||
tindex = SendMessage(hList, CB_ADDSTRING, (WPARAM) 0, (LPARAM) pSetupData->pDisplays[i].Value);
|
|
||||||
SendMessage(hList, CB_SETITEMDATA, tindex, i);
|
|
||||||
}
|
|
||||||
SendMessage(hList, CB_SETCURSEL, 0, 0); // set first as default
|
|
||||||
|
|
||||||
hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
|
hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
|
||||||
|
InitGenericComboList(hList, pSetupData->KeyboardList, GetSettingDescription);
|
||||||
|
|
||||||
|
// hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
|
||||||
|
// InitGenericComboList(hList, pSetupData->LayoutList, GetSettingDescription);
|
||||||
|
|
||||||
for (i=0; i < pSetupData->KeybCount; i++)
|
|
||||||
{
|
|
||||||
tindex = SendMessage(hList,CB_ADDSTRING,(WPARAM)0,(LPARAM)pSetupData->pKeyboards[i].Value);
|
|
||||||
SendMessage(hList,CB_SETITEMDATA,tindex,i);
|
|
||||||
}
|
|
||||||
SendMessage(hList,CB_SETCURSEL,0,0); // set first as default
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
{
|
{
|
||||||
|
@ -360,48 +580,25 @@ DeviceDlgProc(
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PSN_QUERYCANCEL:
|
case PSN_QUERYCANCEL:
|
||||||
SetWindowLongPtr(hwndDlg,
|
SetWindowLongPtrW(hwndDlg,
|
||||||
DWLP_MSGRESULT,
|
DWLP_MSGRESULT,
|
||||||
MessageBox(GetParent(hwndDlg),
|
MessageBoxW(GetParent(hwndDlg),
|
||||||
pSetupData->szAbortMessage,
|
pSetupData->szAbortMessage,
|
||||||
pSetupData->szAbortTitle,
|
pSetupData->szAbortTitle,
|
||||||
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case PSN_WIZNEXT: // set the selected data
|
case PSN_WIZNEXT: /* Set the selected data */
|
||||||
{
|
{
|
||||||
hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
|
hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
|
||||||
|
pSetupData->SelectedComputer = GetSelectedComboListItem(hList);
|
||||||
tindex = SendMessage(hList, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
|
|
||||||
if (tindex != CB_ERR)
|
|
||||||
{
|
|
||||||
pSetupData->SelectedComputer = SendMessage(hList,
|
|
||||||
CB_GETITEMDATA,
|
|
||||||
(WPARAM) tindex,
|
|
||||||
(LPARAM) 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
|
hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
|
||||||
|
pSetupData->SelectedDisplay = GetSelectedComboListItem(hList);
|
||||||
|
|
||||||
tindex = SendMessage(hList, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
|
hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
|
||||||
if (tindex != CB_ERR)
|
pSetupData->SelectedKeyboard = GetSelectedComboListItem(hList);
|
||||||
{
|
|
||||||
pSetupData->SelectedDisplay = SendMessage(hList,
|
|
||||||
CB_GETITEMDATA,
|
|
||||||
(WPARAM) tindex,
|
|
||||||
(LPARAM) 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
hList =GetDlgItem(hwndDlg, IDC_KEYBOARD);
|
|
||||||
|
|
||||||
tindex = SendMessage(hList, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
|
|
||||||
if (tindex != CB_ERR)
|
|
||||||
{
|
|
||||||
pSetupData->SelectedKeyboard = SendMessage(hList,
|
|
||||||
CB_GETITEMDATA,
|
|
||||||
(WPARAM) tindex,
|
|
||||||
(LPARAM) 0);
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,14 +625,14 @@ SummaryDlgProc(
|
||||||
PSETUPDATA pSetupData;
|
PSETUPDATA pSetupData;
|
||||||
|
|
||||||
/* Retrieve pointer to the global setup data */
|
/* Retrieve pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
|
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Save pointer to the global setup data */
|
/* Save pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
||||||
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
|
@ -444,18 +641,19 @@ SummaryDlgProc(
|
||||||
|
|
||||||
switch (lpnm->code)
|
switch (lpnm->code)
|
||||||
{
|
{
|
||||||
case PSN_SETACTIVE:
|
case PSN_SETACTIVE:
|
||||||
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK);
|
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT | PSWIZB_BACK);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PSN_QUERYCANCEL:
|
case PSN_QUERYCANCEL:
|
||||||
SetWindowLongPtr(hwndDlg,
|
SetWindowLongPtrW(hwndDlg,
|
||||||
DWLP_MSGRESULT,
|
DWLP_MSGRESULT,
|
||||||
MessageBox(GetParent(hwndDlg),
|
MessageBoxW(GetParent(hwndDlg),
|
||||||
pSetupData->szAbortMessage,
|
pSetupData->szAbortMessage,
|
||||||
pSetupData->szAbortTitle,
|
pSetupData->szAbortTitle,
|
||||||
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -479,14 +677,14 @@ ProcessDlgProc(
|
||||||
PSETUPDATA pSetupData;
|
PSETUPDATA pSetupData;
|
||||||
|
|
||||||
/* Retrieve pointer to the global setup data */
|
/* Retrieve pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
|
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Save pointer to the global setup data */
|
/* Save pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
||||||
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
|
@ -501,13 +699,14 @@ ProcessDlgProc(
|
||||||
// PropSheet_SetWizButtons(GetParent(hwndDlg), 0 );
|
// PropSheet_SetWizButtons(GetParent(hwndDlg), 0 );
|
||||||
break;
|
break;
|
||||||
case PSN_QUERYCANCEL:
|
case PSN_QUERYCANCEL:
|
||||||
SetWindowLongPtr(hwndDlg,
|
SetWindowLongPtrW(hwndDlg,
|
||||||
DWLP_MSGRESULT,
|
DWLP_MSGRESULT,
|
||||||
MessageBox(GetParent(hwndDlg),
|
MessageBoxW(GetParent(hwndDlg),
|
||||||
pSetupData->szAbortMessage,
|
pSetupData->szAbortMessage,
|
||||||
pSetupData->szAbortTitle,
|
pSetupData->szAbortTitle,
|
||||||
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
MB_YESNO | MB_ICONQUESTION) != IDYES);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -532,14 +731,14 @@ RestartDlgProc(
|
||||||
PSETUPDATA pSetupData;
|
PSETUPDATA pSetupData;
|
||||||
|
|
||||||
/* Retrieve pointer to the global setup data */
|
/* Retrieve pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
|
pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Save pointer to the global setup data */
|
/* Save pointer to the global setup data */
|
||||||
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
|
||||||
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
|
||||||
|
|
||||||
/* Set title font */
|
/* Set title font */
|
||||||
/*SendDlgItemMessage(hwndDlg,
|
/*SendDlgItemMessage(hwndDlg,
|
||||||
|
@ -555,7 +754,7 @@ RestartDlgProc(
|
||||||
HWND hWndProgress;
|
HWND hWndProgress;
|
||||||
|
|
||||||
hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
|
hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
|
||||||
Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
|
Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
|
||||||
if (Position == 300)
|
if (Position == 300)
|
||||||
{
|
{
|
||||||
KillTimer(hwndDlg, 1);
|
KillTimer(hwndDlg, 1);
|
||||||
|
@ -563,7 +762,7 @@ RestartDlgProc(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
|
SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -602,78 +801,34 @@ BOOL LoadSetupData(
|
||||||
IN OUT PSETUPDATA pSetupData)
|
IN OUT PSETUPDATA pSetupData)
|
||||||
{
|
{
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
INFCONTEXT InfContext;
|
// INFCONTEXT InfContext;
|
||||||
TCHAR tmp[10];
|
// TCHAR tmp[10];
|
||||||
//TCHAR szValue[MAX_PATH];
|
// DWORD LineLength;
|
||||||
DWORD LineLength;
|
// LONG Count;
|
||||||
LONG Count;
|
|
||||||
|
|
||||||
// get language list
|
/* Load the hardware, language and keyboard layout lists */
|
||||||
pSetupData->LangCount = SetupGetLineCount(pSetupData->SetupInf, _T("Language"));
|
|
||||||
if (pSetupData->LangCount > 0)
|
|
||||||
{
|
|
||||||
pSetupData->pLanguages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LANG) * pSetupData->LangCount);
|
|
||||||
if (pSetupData->pLanguages == NULL)
|
|
||||||
{
|
|
||||||
ret = FALSE;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
Count = 0;
|
pSetupData->ComputerList = CreateComputerTypeList(pSetupData->SetupInf);
|
||||||
if (SetupFindFirstLine(pSetupData->SetupInf, _T("Language"), NULL, &InfContext))
|
pSetupData->DisplayList = CreateDisplayDriverList(pSetupData->SetupInf);
|
||||||
{
|
pSetupData->KeyboardList = CreateKeyboardDriverList(pSetupData->SetupInf);
|
||||||
do
|
|
||||||
{
|
|
||||||
SetupGetStringField(&InfContext,
|
|
||||||
0,
|
|
||||||
pSetupData->pLanguages[Count].LangId,
|
|
||||||
sizeof(pSetupData->pLanguages[Count].LangId) / sizeof(TCHAR),
|
|
||||||
&LineLength);
|
|
||||||
|
|
||||||
SetupGetStringField(&InfContext,
|
pSetupData->LanguageList = CreateLanguageList(pSetupData->SetupInf, pSetupData->DefaultLanguage);
|
||||||
1,
|
|
||||||
pSetupData->pLanguages[Count].LangName,
|
|
||||||
sizeof(pSetupData->pLanguages[Count].LangName) / sizeof(TCHAR),
|
|
||||||
&LineLength);
|
|
||||||
++Count;
|
|
||||||
}
|
|
||||||
while (SetupFindNextLine(&InfContext, &InfContext) && Count < pSetupData->LangCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get keyboard layout list
|
pSetupData->PartitionList = CreatePartitionList();
|
||||||
pSetupData->KbLayoutCount = SetupGetLineCount(pSetupData->SetupInf, _T("KeyboardLayout"));
|
|
||||||
if (pSetupData->KbLayoutCount > 0)
|
|
||||||
{
|
|
||||||
pSetupData->pKbLayouts = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(KBLAYOUT) * pSetupData->KbLayoutCount);
|
|
||||||
if (pSetupData->pKbLayouts == NULL)
|
|
||||||
{
|
|
||||||
ret = FALSE;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
Count = 0;
|
pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
|
||||||
if (SetupFindFirstLine(pSetupData->SetupInf, _T("KeyboardLayout"), NULL, &InfContext))
|
if (!pSetupData->NtOsInstallsList)
|
||||||
{
|
DPRINT1("Failed to get a list of NTOS installations; continue installation...\n");
|
||||||
do
|
|
||||||
{
|
|
||||||
SetupGetStringField(&InfContext,
|
|
||||||
0,
|
|
||||||
pSetupData->pKbLayouts[Count].LayoutId,
|
|
||||||
sizeof(pSetupData->pKbLayouts[Count].LayoutId) / sizeof(TCHAR),
|
|
||||||
&LineLength);
|
|
||||||
|
|
||||||
SetupGetStringField(&InfContext,
|
|
||||||
1,
|
|
||||||
pSetupData->pKbLayouts[Count].LayoutName,
|
|
||||||
sizeof(pSetupData->pKbLayouts[Count].LayoutName) / sizeof(TCHAR),
|
|
||||||
&LineLength);
|
|
||||||
++Count;
|
|
||||||
}
|
|
||||||
while (SetupFindNextLine(&InfContext, &InfContext) && Count < pSetupData->KbLayoutCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* new part */
|
||||||
|
pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
|
||||||
|
wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID);
|
||||||
|
pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
|
||||||
|
|
||||||
|
pSetupData->LayoutList = CreateKeyboardLayoutList(pSetupData->SetupInf, pSetupData->SelectedLanguageId, pSetupData->DefaultKBLayout);
|
||||||
|
|
||||||
|
#if 0
|
||||||
// get default for keyboard and language
|
// get default for keyboard and language
|
||||||
pSetupData->DefaultKBLayout = -1;
|
pSetupData->DefaultKBLayout = -1;
|
||||||
pSetupData->DefaultLang = -1;
|
pSetupData->DefaultLang = -1;
|
||||||
|
@ -681,7 +836,7 @@ BOOL LoadSetupData(
|
||||||
// TODO: get defaults from underlaying running system
|
// TODO: get defaults from underlaying running system
|
||||||
if (SetupFindFirstLine(pSetupData->SetupInf, _T("NLS"), _T("DefaultLayout"), &InfContext))
|
if (SetupFindFirstLine(pSetupData->SetupInf, _T("NLS"), _T("DefaultLayout"), &InfContext))
|
||||||
{
|
{
|
||||||
SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
|
SetupGetStringField(&InfContext, 1, tmp, ARRAYSIZE(tmp), &LineLength);
|
||||||
for (Count = 0; Count < pSetupData->KbLayoutCount; Count++)
|
for (Count = 0; Count < pSetupData->KbLayoutCount; Count++)
|
||||||
{
|
{
|
||||||
if (_tcscmp(tmp, pSetupData->pKbLayouts[Count].LayoutId) == 0)
|
if (_tcscmp(tmp, pSetupData->pKbLayouts[Count].LayoutId) == 0)
|
||||||
|
@ -694,7 +849,7 @@ BOOL LoadSetupData(
|
||||||
|
|
||||||
if (SetupFindFirstLine(pSetupData->SetupInf, _T("NLS"), _T("DefaultLanguage"), &InfContext))
|
if (SetupFindFirstLine(pSetupData->SetupInf, _T("NLS"), _T("DefaultLanguage"), &InfContext))
|
||||||
{
|
{
|
||||||
SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
|
SetupGetStringField(&InfContext, 1, tmp, ARRAYSIZE(tmp), &LineLength);
|
||||||
for (Count = 0; Count < pSetupData->LangCount; Count++)
|
for (Count = 0; Count < pSetupData->LangCount; Count++)
|
||||||
{
|
{
|
||||||
if (_tcscmp(tmp, pSetupData->pLanguages[Count].LangId) == 0)
|
if (_tcscmp(tmp, pSetupData->pLanguages[Count].LangId) == 0)
|
||||||
|
@ -704,82 +859,11 @@ BOOL LoadSetupData(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// get computers list
|
|
||||||
pSetupData->CompCount = LoadGenentry(pSetupData->SetupInf,_T("Computer"),&pSetupData->pComputers,&InfContext);
|
|
||||||
|
|
||||||
// get display list
|
|
||||||
pSetupData->DispCount = LoadGenentry(pSetupData->SetupInf,_T("Display"),&pSetupData->pDisplays,&InfContext);
|
|
||||||
|
|
||||||
// get keyboard list
|
|
||||||
pSetupData->KeybCount = LoadGenentry(pSetupData->SetupInf, _T("Keyboard"),&pSetupData->pKeyboards,&InfContext);
|
|
||||||
|
|
||||||
// get install directory
|
|
||||||
if (SetupFindFirstLine(pSetupData->SetupInf, _T("SetupData"), _T("DefaultPath"), &InfContext))
|
|
||||||
{
|
|
||||||
SetupGetStringField(&InfContext,
|
|
||||||
1,
|
|
||||||
pSetupData->USetupData.InstallationDirectory,
|
|
||||||
sizeof(pSetupData->USetupData.InstallationDirectory) / sizeof(TCHAR),
|
|
||||||
&LineLength);
|
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
|
||||||
if (ret == FALSE)
|
|
||||||
{
|
|
||||||
if (pSetupData->pKbLayouts != NULL)
|
|
||||||
{
|
|
||||||
HeapFree(GetProcessHeap(), 0, pSetupData->pKbLayouts);
|
|
||||||
pSetupData->pKbLayouts = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pSetupData->pLanguages != NULL)
|
|
||||||
{
|
|
||||||
HeapFree(GetProcessHeap(), 0, pSetupData->pLanguages);
|
|
||||||
pSetupData->pLanguages = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
LONG LoadGenentry(HINF hinf,PCTSTR name,PGENENTRY *gen,PINFCONTEXT context)
|
|
||||||
{
|
|
||||||
LONG TotalCount;
|
|
||||||
DWORD LineLength;
|
|
||||||
|
|
||||||
TotalCount = SetupGetLineCount(hinf, name);
|
|
||||||
if (TotalCount > 0)
|
|
||||||
{
|
|
||||||
*gen = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GENENTRY) * TotalCount);
|
|
||||||
if (*gen != NULL)
|
|
||||||
{
|
|
||||||
if (SetupFindFirstLine(hinf, name, NULL, context))
|
|
||||||
{
|
|
||||||
LONG Count = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
SetupGetStringField(context,
|
|
||||||
0,
|
|
||||||
(*gen)[Count].Id,
|
|
||||||
sizeof((*gen)[Count].Id) / sizeof(TCHAR),
|
|
||||||
&LineLength);
|
|
||||||
|
|
||||||
SetupGetStringField(context,
|
|
||||||
1,
|
|
||||||
(*gen)[Count].Value,
|
|
||||||
sizeof((*gen)[Count].Value) / sizeof(TCHAR),
|
|
||||||
&LineLength);
|
|
||||||
++Count;
|
|
||||||
}
|
|
||||||
while (SetupFindNextLine(context, context) && Count < TotalCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else return 0;
|
|
||||||
}
|
|
||||||
return TotalCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attempts to convert a pure NT file path into a corresponding Win32 path.
|
* Attempts to convert a pure NT file path into a corresponding Win32 path.
|
||||||
* Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
|
* Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
|
||||||
|
@ -866,6 +950,7 @@ _tWinMain(HINSTANCE hInst,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG Error;
|
ULONG Error;
|
||||||
|
INITCOMMONCONTROLSEX iccx;
|
||||||
PROPSHEETHEADER psh;
|
PROPSHEETHEADER psh;
|
||||||
HPROPSHEETPAGE ahpsp[8];
|
HPROPSHEETPAGE ahpsp[8];
|
||||||
PROPSHEETPAGE psp = {0};
|
PROPSHEETPAGE psp = {0};
|
||||||
|
@ -920,9 +1005,17 @@ _tWinMain(HINSTANCE hInst,
|
||||||
CheckUnattendedSetup(&SetupData.USetupData);
|
CheckUnattendedSetup(&SetupData.USetupData);
|
||||||
SetupData.bUnattend = IsUnattendedSetup;
|
SetupData.bUnattend = IsUnattendedSetup;
|
||||||
|
|
||||||
|
/* Cache commonly-used strings */
|
||||||
LoadStringW(hInst, IDS_ABORTSETUP, SetupData.szAbortMessage, ARRAYSIZE(SetupData.szAbortMessage));
|
LoadStringW(hInst, IDS_ABORTSETUP, SetupData.szAbortMessage, ARRAYSIZE(SetupData.szAbortMessage));
|
||||||
LoadStringW(hInst, IDS_ABORTSETUP2, SetupData.szAbortTitle, ARRAYSIZE(SetupData.szAbortTitle));
|
LoadStringW(hInst, IDS_ABORTSETUP2, SetupData.szAbortTitle, ARRAYSIZE(SetupData.szAbortTitle));
|
||||||
|
|
||||||
|
/* Whenever any of the common controls are used in your app,
|
||||||
|
* you must call InitCommonControlsEx() to register the classes
|
||||||
|
* for those controls. */
|
||||||
|
iccx.dwSize = sizeof(iccx);
|
||||||
|
iccx.dwICC = ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES /* | ICC_PROGRESS_CLASS */;
|
||||||
|
InitCommonControlsEx(&iccx);
|
||||||
|
|
||||||
/* Create title font */
|
/* Create title font */
|
||||||
SetupData.hTitleFont = CreateTitleFont();
|
SetupData.hTitleFont = CreateTitleFont();
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,11 @@
|
||||||
#include <wingdi.h>
|
#include <wingdi.h>
|
||||||
#include <winuser.h>
|
#include <winuser.h>
|
||||||
|
|
||||||
|
#include <strsafe.h>
|
||||||
|
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
/**/#include <setupapi.h>/**/
|
/**/#include <setupapi.h>/**/
|
||||||
#include <devguid.h>
|
#include <devguid.h>
|
||||||
// #include <wine/unicode.h>
|
|
||||||
|
|
||||||
#define NTOS_MODE_USER
|
#define NTOS_MODE_USER
|
||||||
#include <ndk/cmtypes.h> // For CM_DISK stuff
|
#include <ndk/cmtypes.h> // For CM_DISK stuff
|
||||||
|
@ -56,26 +57,14 @@
|
||||||
#include <../lib/setuplib.h>
|
#include <../lib/setuplib.h>
|
||||||
// #include "errorcode.h"
|
// #include "errorcode.h"
|
||||||
|
|
||||||
|
#if 0
|
||||||
typedef struct _LANG
|
|
||||||
{
|
|
||||||
TCHAR LangId[9];
|
|
||||||
TCHAR LangName[128];
|
|
||||||
} LANG, *PLANG;
|
|
||||||
|
|
||||||
typedef struct _KBLAYOUT
|
typedef struct _KBLAYOUT
|
||||||
{
|
{
|
||||||
TCHAR LayoutId[9];
|
TCHAR LayoutId[9];
|
||||||
TCHAR LayoutName[128];
|
TCHAR LayoutName[128];
|
||||||
TCHAR DllName[128];
|
TCHAR DllName[128];
|
||||||
} KBLAYOUT, *PKBLAYOUT;
|
} KBLAYOUT, *PKBLAYOUT;
|
||||||
|
#endif
|
||||||
// generic entries with simple 1:1 mapping
|
|
||||||
typedef struct _GENENTRY
|
|
||||||
{
|
|
||||||
TCHAR Id[24];
|
|
||||||
TCHAR Value[128];
|
|
||||||
} GENENTRY, *PGENENTRY;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _SETUPDATA
|
typedef struct _SETUPDATA
|
||||||
|
@ -92,7 +81,7 @@ typedef struct _SETUPDATA
|
||||||
USETUP_DATA USetupData;
|
USETUP_DATA USetupData;
|
||||||
HINF SetupInf;
|
HINF SetupInf;
|
||||||
|
|
||||||
// Settings
|
/* Settings */
|
||||||
LONG DestPartSize; // if partition doesn't exist, size of partition
|
LONG DestPartSize; // if partition doesn't exist, size of partition
|
||||||
LONG FSType; // file system type on partition
|
LONG FSType; // file system type on partition
|
||||||
LONG FormatPart; // type of format the partition
|
LONG FormatPart; // type of format the partition
|
||||||
|
@ -106,26 +95,10 @@ typedef struct _SETUPDATA
|
||||||
BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
|
BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
|
||||||
|
|
||||||
|
|
||||||
// txtsetup.sif data
|
/* txtsetup.sif data */
|
||||||
#if 1
|
|
||||||
LONG DefaultLang; // default language (table index)
|
|
||||||
PLANG pLanguages;
|
|
||||||
LONG LangCount;
|
|
||||||
LONG DefaultKBLayout; // default keyboard layout (table index)
|
|
||||||
PKBLAYOUT pKbLayouts;
|
|
||||||
LONG KbLayoutCount;
|
|
||||||
PGENENTRY pComputers;
|
|
||||||
LONG CompCount;
|
|
||||||
PGENENTRY pDisplays;
|
|
||||||
LONG DispCount;
|
|
||||||
PGENENTRY pKeyboards;
|
|
||||||
LONG KeybCount;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
// LONG DefaultLang; // default language (table index)
|
// LONG DefaultLang; // default language (table index)
|
||||||
// LONG DefaultKBLayout; // default keyboard layout (table index)
|
// LONG DefaultKBLayout; // default keyboard layout (table index)
|
||||||
PWCHAR SelectedLanguageId;
|
PCWSTR SelectedLanguageId;
|
||||||
WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
|
WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
|
||||||
WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
|
WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
|
||||||
|
|
||||||
|
@ -138,7 +111,6 @@ typedef struct _SETUPDATA
|
||||||
PPARTLIST PartitionList;
|
PPARTLIST PartitionList;
|
||||||
PNTOS_INSTALLATION CurrentInstallation;
|
PNTOS_INSTALLATION CurrentInstallation;
|
||||||
PGENERIC_LIST NtOsInstallsList;
|
PGENERIC_LIST NtOsInstallsList;
|
||||||
#endif
|
|
||||||
|
|
||||||
} SETUPDATA, *PSETUPDATA;
|
} SETUPDATA, *PSETUPDATA;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
|
|
||||||
/* Icons */
|
/* Icons */
|
||||||
IDI_MAIN ICON "res/setup.ico"
|
IDI_MAIN ICON "res/setup.ico"
|
||||||
|
IDI_ROSICON ICON "res/roslogo.ico"
|
||||||
|
IDI_WINICON ICON "res/winlogo.ico"
|
||||||
|
|
||||||
/* Bitmaps */
|
/* Bitmaps */
|
||||||
IDB_WATERMARK BITMAP "res/watermark.bmp"
|
IDB_WATERMARK BITMAP "res/watermark.bmp"
|
||||||
|
|
12
base/setup/reactos/res/README.txt
Normal file
12
base/setup/reactos/res/README.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
roslogo.ico
|
||||||
|
-----------
|
||||||
|
(C) 2018 ReactOS Team & Contributors
|
||||||
|
Distributed under CC-BY-SA 4.0 International License Terms.
|
||||||
|
|
||||||
|
winlogo.ico
|
||||||
|
-----------
|
||||||
|
Adapted from the WinTango IconPack, by 'heebijeebi'
|
||||||
|
See http://heebijeebi.deviantart.com and http://wintango.blogspot.com/
|
||||||
|
Distributed under CC-BY-SA 3.0 International License Terms.
|
||||||
|
Slightly modified by Hermès Bélusca-Maïto.
|
BIN
base/setup/reactos/res/roslogo.ico
Normal file
BIN
base/setup/reactos/res/roslogo.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
BIN
base/setup/reactos/res/roslogo_2.ico
Normal file
BIN
base/setup/reactos/res/roslogo_2.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
BIN
base/setup/reactos/res/winlogo.ico
Normal file
BIN
base/setup/reactos/res/winlogo.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.9 KiB |
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
/* Icons */
|
/* Icons */
|
||||||
#define IDI_MAIN 3000
|
#define IDI_MAIN 3000
|
||||||
|
#define IDI_ROSICON 3001
|
||||||
|
#define IDI_WINICON 3002
|
||||||
|
|
||||||
|
|
||||||
#define IDC_STATIC -1
|
#define IDC_STATIC -1
|
||||||
|
@ -84,6 +86,3 @@
|
||||||
#define IDS_PARTITION_NAME 5200
|
#define IDS_PARTITION_NAME 5200
|
||||||
#define IDS_PARTITION_SIZE 5201
|
#define IDS_PARTITION_SIZE 5201
|
||||||
#define IDS_PARTITION_TYPE 5202
|
#define IDS_PARTITION_TYPE 5202
|
||||||
|
|
||||||
#define IDS_LIST_COLUMN_FIRST IDS_PARTITION_NAME
|
|
||||||
#define IDS_LIST_COLUMN_LAST IDS_PARTITION_TYPE
|
|
||||||
|
|
Loading…
Reference in a new issue