diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c index 600f00645f8..d9d01da88a1 100644 --- a/dll/win32/syssetup/wizard.c +++ b/dll/win32/syssetup/wizard.c @@ -8,6 +8,7 @@ * Ismael Ferreras Morezuelas * Katayama Hirofumi MZ * Oleg Dubinskiy + * Whindmar Saksit */ /* INCLUDES *****************************************************************/ @@ -1160,9 +1161,13 @@ ComputerPageDlgProc(HWND hwndDlg, SetFocus(GetDlgItem(hwndDlg, IDC_COMPUTERNAME)); if (pSetupData->UnattendSetup) { - SendMessage(GetDlgItem(hwndDlg, IDC_COMPUTERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->ComputerName); - SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD1), WM_SETTEXT, 0, (LPARAM)pSetupData->AdminPassword); - SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD2), WM_SETTEXT, 0, (LPARAM)pSetupData->AdminPassword); + /* "*" means use random name (we have already generated it above) */ + if (pSetupData->ComputerName[0] == L'*' && !pSetupData->ComputerName[1]) + wcscpy(pSetupData->ComputerName, ComputerName); + else + SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, pSetupData->ComputerName); + SetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, pSetupData->AdminPassword); + SetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, pSetupData->AdminPassword); WriteComputerSettings(pSetupData->ComputerName, NULL); SetAdministratorPassword(pSetupData->AdminPassword); }