- basic install drive listing code (due to lack of reactos functionality not working yet)

- add and enable advanced settings dialog
- get install directory from txtsetup.sif
- set changed install directory
- fix dialog resource for several languages

svn path=/trunk/; revision=37309
This commit is contained in:
Matthias Kupfer 2008-11-12 16:08:28 +00:00
parent 3414ea909e
commit 121e7e4d60
14 changed files with 115 additions and 3 deletions

View file

@ -76,6 +76,8 @@ BEGIN
CONTROL "Ñëàãàíå íà íà÷àëåí çàðåæäà÷ (MBR) íà òâúðäèÿ äèñê", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "Áåç ñëàãàíå íà íà÷àëåí çàðåæäà÷", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -78,6 +78,8 @@ BEGIN
CONTROL "Install boot loader on the hard disk (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "No installation of bootloader", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -76,6 +76,8 @@ BEGIN
CONTROL "Install boot loader on the hard disk (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "No installation of bootloader", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -76,6 +76,8 @@ BEGIN
CONTROL "Install boot loader on the hard disk (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "No installation of bootloader", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -79,6 +79,8 @@ BEGIN
CONTROL "Instalar el cargador de arranque en el disco duro (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "No instalar el cargador de arranque", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -74,6 +74,8 @@ BEGIN
CONTROL "Install boot loader on the hard disk (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "No installation of bootloader", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -76,6 +76,8 @@ BEGIN
CONTROL "Installazione del Boot loader sul disco fisso (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "Non installare il Boot loader", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -76,6 +76,8 @@ BEGIN
CONTROL "Installer oppstartslaster på harddiskens (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "Ikke installer oppstartslaster", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -82,6 +82,8 @@ BEGIN
CONTROL "Install boot loader on the hard disk (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "No installation of bootloader", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -76,6 +76,8 @@ BEGIN
CONTROL "Óñòàíîâèòü çàãðóç÷èê íà äèñê (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,49,278,11
CONTROL "Íå óñòàíàâëèâàòü çàãðóç÷èê", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,60,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -81,6 +81,8 @@ BEGIN
CONTROL "Install boot loader on the hard disk (MBR)", IDC_INSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 10,46,278,11
CONTROL "No installation of bootloader", IDC_NOINSTFREELDR, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP | WS_DISABLED , 10,57,278,11
PUSHBUTTON "&OK", IDOK, 180,83,50,15, WS_TABSTOP | WS_VISIBLE
PUSHBUTTON "&Cancel", IDCANCEL, 240,83,50,15, WS_TABSTOP | WS_VISIBLE
END
IDD_PROCESSPAGE DIALOGEX 0, 0, 317, 193

View file

@ -29,6 +29,8 @@
#include <commctrl.h>
#include <tchar.h>
#include <setupapi.h>
#include <initguid.h>
#include <devguid.h>
#include <wine/unicode.h>
#include "resource.h"
@ -69,7 +71,7 @@ struct
LONG FormatPart; // type of format the partition
LONG SelectedLangId; // selected language (table index)
LONG SelectedKBLayout; // selected keyboard layout (table index)
WCHAR InstallationDirectory[MAX_PATH]; // installation directory on hdd
TCHAR InstallDir[MAX_PATH]; // installation directory on hdd
LONG SelectedComputer; // selected computer type (table index)
LONG SelectedDisplay; // selected display type (table index)
LONG SelectedKeyboard; // selected keyboard type (table index)
@ -512,12 +514,47 @@ DeviceDlgProc(HWND hwndDlg,
return FALSE;
}
static INT_PTR CALLBACK
MoreOptDlgProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
CheckDlgButton(hwndDlg, IDC_INSTFREELDR, BST_CHECKED);
SendMessage(GetDlgItem(hwndDlg, IDC_PATH),WM_SETTEXT,
(WPARAM)0,(LPARAM)SetupData.InstallDir);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
SendMessage(GetDlgItem(hwndDlg, IDC_PATH),WM_GETTEXT,
(WPARAM)sizeof(SetupData.InstallDir)/sizeof(TCHAR),(LPARAM)SetupData.InstallDir);
EndDialog(hwndDlg, IDOK);
break;
case IDCANCEL:
EndDialog(hwndDlg, IDCANCEL);
break;
}
}
return FALSE;
}
static INT_PTR CALLBACK
DriveDlgProc(HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
HDEVINFO h;
HWND hList;
SP_DEVINFO_DATA DevInfoData;
DWORD i;
switch (uMsg)
{
case WM_INITDIALOG:
@ -530,15 +567,55 @@ DriveDlgProc(HWND hwndDlg,
dwStyle = GetWindowLong(hwndControl, GWL_STYLE);
SetWindowLong(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
CheckDlgButton(hwndDlg, IDC_INSTFREELDR, BST_CHECKED);
/* Set title font */
/*SendDlgItemMessage(hwndDlg,
IDC_STARTTITLE,
WM_SETFONT,
(WPARAM)hTitleFont,
(LPARAM)TRUE);*/
}
h = SetupDiGetClassDevs(&GUID_DEVCLASS_DISKDRIVE, NULL, NULL,
DIGCF_PRESENT);
if (h != INVALID_HANDLE_VALUE)
{
hList =GetDlgItem(hwndDlg, IDC_PARTITION);
DevInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
for (i=0;SetupDiEnumDeviceInfo(h,i,&DevInfoData);i++)
{
DWORD DataT;
LPTSTR buffer = NULL;
DWORD buffersize = 0;
while (!SetupDiGetDeviceRegistryProperty(
h,&DevInfoData,
SPDRP_DEVICEDESC,&DataT,(PBYTE)buffer,
buffersize,&buffersize))
{
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
if (buffer) LocalFree(buffer);
buffer = LocalAlloc(LPTR,buffersize * 2);
} else
break;
}
if (buffer)
{
SendMessage(hList,LB_ADDSTRING,(WPARAM)0,(LPARAM)buffer);
LocalFree(buffer);
}
}
SetupDiDestroyDeviceInfoList(h);
}
}
break;
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case IDC_PARTMOREOPTS:
DialogBox(hInstance,MAKEINTRESOURCE(IDD_BOOTOPTIONS),hwndDlg,MoreOptDlgProc);
break;
}
}
case WM_NOTIFY:
{
LPNMHDR lpnm = (LPNMHDR)lParam;
@ -601,6 +678,8 @@ ProcessDlgProc(HWND hwndDlg,
{
case PSN_SETACTIVE:
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT );
// disable all buttons during installation process
// PropSheet_SetWizButtons(GetParent(hwndDlg), 0 );
break;
default:
break;
@ -827,6 +906,14 @@ void LoadSetupData()
while (SetupFindNextLine(&InfContext, &InfContext) && Count < SetupData.KeybCount);
}
}
// get install directory
if (SetupFindFirstLine(hTxtsetupSif, _T("SetupData"),
_T("DefaultPath"),&InfContext))
{
SetupGetStringField(&InfContext, 1,
SetupData.InstallDir,
sizeof(SetupData.InstallDir) / sizeof(TCHAR), &LineLength);
}
SetupCloseInfFile(hTxtsetupSif);
}
}
@ -859,6 +946,7 @@ BOOL isUnattendSetup()
(_tcsicmp(szValue, _T("yes"))==0))
{
result = 1; // unattendSetup enabled
// read values and store in SetupData
}
}

View file

@ -8,6 +8,7 @@
<library>user32</library>
<library>comctl32</library>
<library>setupapi</library>
<library>uuid</library>
<file>reactos.c</file>
<file>reactos.rc</file>
</module>

View file

@ -50,6 +50,7 @@
#define IDS_ABORTSETUP2 2039
#define IDC_ACTION 2040
#define IDC_PARTMOREOPTS 2041
#define IDD_BOOTOPTIONS 2042
#define IDI_MAIN 3000