1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 #ifndef SETUP_MAIN_HXX
26 #define SETUP_MAIN_HXX
27 
28 class SetupApp
29 {
30     DWORD           m_nOSVersion;
31     DWORD           m_nMinorVersion;
32     boolean         m_bIsWin9x      : 1;
33     boolean         m_bNeedReboot   : 1;
34     boolean         m_bAdministrative : 1;
35 
36 public:
37     UINT            m_uiRet;
38 
39                     SetupApp();
40     virtual        ~SetupApp();
41 
42     virtual boolean Initialize( HINSTANCE hInst ) = 0;
43     virtual boolean AlreadyRunning() const = 0;
44     virtual boolean ReadProfile() = 0;
45     virtual boolean GetPatches() = 0;
46     virtual boolean ChooseLanguage( long& rLanguage ) = 0;
47     virtual boolean CheckVersion() = 0;
48     virtual boolean CheckForUpgrade() = 0;
49     virtual boolean InstallRuntimes() = 0;
50     virtual boolean Install( long nLanguage ) = 0;
51 
52     virtual UINT    GetError() const = 0;
53     virtual void    DisplayError( UINT nErr ) const = 0;
54 
SetError(UINT nErr)55     void            SetError( UINT nErr ) { m_uiRet = nErr; }
IsWin9x() const56     boolean         IsWin9x() const { return m_bIsWin9x; }
GetOSVersion() const57     DWORD           GetOSVersion() const { return m_nOSVersion; }
GetMinorVersion() const58     DWORD           GetMinorVersion() const { return m_nMinorVersion; }
59 
IsAdminInstall()60     boolean         IsAdminInstall() { return m_bAdministrative; }
SetAdminInstall(boolean bValue)61     void            SetAdminInstall( boolean bValue ) { m_bAdministrative = bValue; }
62 
SetRebootNeeded(boolean bNeedReboot)63     void            SetRebootNeeded( boolean bNeedReboot ) { m_bNeedReboot = bNeedReboot; }
NeedReboot() const64     boolean         NeedReboot() const { return m_bNeedReboot; }
65 };
66 
67 SetupApp* Create_SetupAppA();
68 SetupApp* Create_SetupAppW();
69 
70 #endif
71