From 722728fd5c5f2963574cdac26e218121199c8795 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 21 Mar 2004 14:37:19 +0000 Subject: [PATCH] - A message box with timeout informing about successful installation and restart. svn path=/trunk/; revision=8829 --- reactos/lib/syssetup/Makefile | 10 +++--- reactos/lib/syssetup/dllmain.c | 9 ++--- reactos/lib/syssetup/install.c | 51 +++++++++++++++++++++++++++-- reactos/lib/syssetup/resource.h | 25 ++++++++++++++ reactos/lib/syssetup/syssetup.rc | 13 ++++++-- reactos/lib/syssetup/syssetup_Cz.rc | 31 ++++++++++++++++++ reactos/lib/syssetup/syssetup_En.rc | 31 ++++++++++++++++++ 7 files changed, 155 insertions(+), 15 deletions(-) create mode 100644 reactos/lib/syssetup/resource.h create mode 100644 reactos/lib/syssetup/syssetup_Cz.rc create mode 100644 reactos/lib/syssetup/syssetup_En.rc diff --git a/reactos/lib/syssetup/Makefile b/reactos/lib/syssetup/Makefile index 40dbc727040..e5c237bcbcb 100644 --- a/reactos/lib/syssetup/Makefile +++ b/reactos/lib/syssetup/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 2004/01/23 10:34:23 ekohl Exp $ +# $Id: Makefile,v 1.6 2004/03/21 14:37:18 navaraf Exp $ PATH_TO_TOP = ../.. @@ -8,20 +8,18 @@ TARGET_NAME = syssetup TARGET_BASE = 0x74A30000 -TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a gdi32.a user32.a samlib.a userenv.a -# comctl32.a +TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a gdi32.a user32.a samlib.a userenv.a comctl32.a TARGET_CFLAGS = -Wall -Werror -fno-builtin -# require os code to explicitly request A/W version of structs/functions -TARGET_CFLAGS += -D_DISABLE_TIDENTS +TARGET_CFLAGS += -D__USE_W32API -D_WIN32_IE=0x0500 +TARGET_RCFLAGS += -D__USE_W32API -D_WIN32_IE=0x0500 TARGET_LFLAGS = -nostartfiles -nostdlib TARGET_OBJECTS = dllmain.o install.o logfile.o # wizard.o - include $(PATH_TO_TOP)/rules.mak include $(TOOLS_PATH)/helper.mk diff --git a/reactos/lib/syssetup/dllmain.c b/reactos/lib/syssetup/dllmain.c index 0306eef43e6..cc9485bdf73 100644 --- a/reactos/lib/syssetup/dllmain.c +++ b/reactos/lib/syssetup/dllmain.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dllmain.c,v 1.1 2003/05/02 18:07:55 ekohl Exp $ +/* $Id: dllmain.c,v 1.2 2004/03/21 14:37:19 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -28,11 +28,10 @@ /* INCLUDES *****************************************************************/ #include - +#include /* GLOBALS *******************************************************************/ - /* FUNCTIONS *****************************************************************/ BOOL STDCALL @@ -40,8 +39,10 @@ DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { + if (dwReason == DLL_PROCESS_ATTACH) + InitCommonControls(); - return TRUE; + return TRUE; } /* EOF */ diff --git a/reactos/lib/syssetup/install.c b/reactos/lib/syssetup/install.c index e0a6f247f45..840f0d572d4 100644 --- a/reactos/lib/syssetup/install.c +++ b/reactos/lib/syssetup/install.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: install.c,v 1.8 2004/01/23 16:51:41 navaraf Exp $ +/* $Id: install.c,v 1.9 2004/03/21 14:37:19 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -29,11 +29,14 @@ #include #include +#include #include #include #include +#include "resource.h" + // #define NO_GUI #if 0 @@ -132,6 +135,44 @@ AppendRidToSid (PSID *Dst, Dst); } +INT_PTR CALLBACK +RestartDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_INITDIALOG: + SendDlgItemMessage(hWnd, IDC_RESTART_PROGRESS, PBM_SETRANGE, 0, + MAKELPARAM(0, 300)); + SetTimer(hWnd, 0, 50, NULL); + return TRUE; + + case WM_TIMER: + { + INT Position; + HWND hWndProgress; + + hWndProgress = GetDlgItem(hWnd, IDC_RESTART_PROGRESS); + Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0); + if (Position == 300) + EndDialog(hWnd, 0); + else + SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0); + } + return TRUE; + + case WM_COMMAND: + switch (wParam) + { + case IDOK: + case IDCANCEL: + EndDialog(hWnd, 0); + return TRUE; + } + break; + } + + return FALSE; +} DWORD STDCALL InstallReactOS (HINSTANCE hInstance) @@ -225,12 +266,16 @@ InstallReactOS (HINSTANCE hInstance) RtlFreeSid (AdminSid); RtlFreeSid (DomainSid); - DebugPrint ("System setup successful\n"); - #if 0 Wizard (); #endif + DialogBox( + GetModuleHandle(TEXT("syssetup.dll")), + MAKEINTRESOURCE(IDD_RESTART), + NULL, + RestartDlgProc); + return 0; } diff --git a/reactos/lib/syssetup/resource.h b/reactos/lib/syssetup/resource.h new file mode 100644 index 00000000000..08113f24434 --- /dev/null +++ b/reactos/lib/syssetup/resource.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2004 Filip Navara + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef RESOURCE_H +#define RESOURCE_H + +#define IDD_RESTART 1001 +#define IDC_RESTART_PROGRESS 1002 + +#endif /* RESOURCE_H */ diff --git a/reactos/lib/syssetup/syssetup.rc b/reactos/lib/syssetup/syssetup.rc index 318dfa28a2e..a844e8c4afd 100644 --- a/reactos/lib/syssetup/syssetup.rc +++ b/reactos/lib/syssetup/syssetup.rc @@ -1,7 +1,8 @@ -#include +#include #include +#include "resource.h" -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL VS_VERSION_INFO VERSIONINFO FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD @@ -36,3 +37,11 @@ BEGIN END END +/* + * Everything specific to any language goes in one of the specific + * files. Note that you can and may override resources which also have + * a neutral version. This is to get localized bitmaps for example. + */ + +#include "syssetup_En.rc" +#include "syssetup_Cz.rc" diff --git a/reactos/lib/syssetup/syssetup_Cz.rc b/reactos/lib/syssetup/syssetup_Cz.rc new file mode 100644 index 00000000000..4057d9b9955 --- /dev/null +++ b/reactos/lib/syssetup/syssetup_Cz.rc @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2004 Filip Navara + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +LANGUAGE LANG_CZECH, SUBLANG_DEFAULT + +IDD_RESTART DIALOG 6, 18, 245, 116 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION +CAPTION "Instatalace ReactOSu" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Instalace ReactOSu byla úspěšně dokončena.", -1, 13, 12, 212, 16 + LTEXT "Pro pokračování potřebuje instalační program restartovat Váš počítač. Počítač bude automaticky restartován za 15 sekund nebo zmáčknete-li tlačítko Restartovat.", -1, 13, 33, 212, 32 +/* GROUPBOX "", -1, 7, 3, 231, 106 */ + CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 + PUSHBUTTON "&Restartovat", IDOK, 98, 87, 50, 14 +END diff --git a/reactos/lib/syssetup/syssetup_En.rc b/reactos/lib/syssetup/syssetup_En.rc new file mode 100644 index 00000000000..9754203df54 --- /dev/null +++ b/reactos/lib/syssetup/syssetup_En.rc @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2004 Filip Navara + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +IDD_RESTART DIALOG 6, 18, 245, 116 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION +CAPTION "ReactOS Installation" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Installation of ReactOS was successfully completed.", -1, 13, 12, 212, 16 + LTEXT "In order to continue, the installation program needs to restart your computer. The computer will be automatically restarted in 15 seconds or if you press the Restart button.", -1, 13, 33, 212, 32 +/* GROUPBOX "", -1, 7, 3, 231, 106 */ + CONTROL "", IDC_RESTART_PROGRESS, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 13, 70, 212, 8 + PUSHBUTTON "&Restart", IDOK, 98, 87, 50, 14 +END