1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: setup.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "setup_main.hxx"
33 //--------------------------------------------------------------------------
39 #ifdef Create_SetupAppX
40 #undef Create_SetupAppX
49 #define SetupAppX SetupAppW
50 #define Create_SetupAppX Create_SetupAppW
51 #define LanguageDataX LanguageDataW
53 #define SetupAppX SetupAppA
54 #define Create_SetupAppX Create_SetupAppA
55 #define LanguageDataX LanguageDataA
58 //--------------------------------------------------------------------------
65 LanguageDataX( LPTSTR pData
);
69 //--------------------------------------------------------------------------
71 class SetupAppX
: public SetupApp
79 LPTSTR m_pProductName
;
85 LPCTSTR m_pUpgradeKey
;
86 LPCTSTR m_pProductVersion
;
90 boolean m_bIgnoreAlreadyRunning
: 1;
91 boolean m_bRegNoMsoTypes
:1;
92 boolean m_bRegAllMsoTypes
:1;
93 boolean m_bIsMinorUpgrade
:1;
94 boolean m_bSupportsPatch
:1;
99 long m_nLanguageCount
;
100 LanguageDataX
** m_ppLanguageList
;
104 boolean
GetPathToFile( TCHAR
* pFileName
, TCHAR
**pPath
);
105 LPCTSTR
GetPathToMSI();
107 int GetNameValue( TCHAR
* pLine
, TCHAR
**pName
, TCHAR
**pValue
);
108 boolean
GetProfileSection( LPCTSTR pFileName
, LPCTSTR pSection
,
109 DWORD
& rSize
, LPTSTR
*pRetBuf
);
110 LPTSTR
CopyIniFile( LPCTSTR pIniFile
);
111 void ConvertNewline( LPTSTR pText
) const;
113 boolean
LaunchInstaller( LPCTSTR pParam
);
114 HMODULE
LoadMsiLibrary();
115 DWORD
WaitForProcess( HANDLE hHandle
);
117 boolean
GetCmdLineParameters( LPTSTR
*pCmdLine
);
118 DWORD
GetNextArgument( LPCTSTR pStr
, LPTSTR
*pArg
,
119 LPTSTR
*pNext
, boolean bStripQuotes
= false );
123 boolean
GetCommandLine();
125 boolean
IsTerminalServerInstalled() const;
126 void AddFileToPatchList( TCHAR
* pPath
, TCHAR
* pFile
);
127 boolean
IsPatchInstalled( TCHAR
* pBaseDir
, TCHAR
* pFileName
);
132 virtual boolean
Initialize( HINSTANCE hInst
);
133 virtual boolean
AlreadyRunning() const;
134 virtual boolean
ReadProfile();
135 virtual boolean
GetPatches();
136 virtual boolean
ChooseLanguage( long& rLanguage
);
137 virtual boolean
CheckVersion();
138 virtual boolean
CheckForUpgrade();
139 virtual boolean
Install( long nLanguage
);
141 virtual UINT
GetError() const;
142 virtual void DisplayError( UINT nErr
) const;
144 void Log( LPCTSTR pMessage
, LPCTSTR pText
= NULL
) const;
146 long GetLanguageCount() const { return m_nLanguageCount
; }
147 long GetLanguageID( long nIndex
) const;
148 void GetLanguageName( long nLanguage
, LPTSTR sName
) const;
150 LPCTSTR
GetAppTitle() const { return m_pAppTitle
; }
151 LPTSTR
SetProdToAppTitle( LPCTSTR pProdName
);
152 HINSTANCE
GetHInst() const { return m_hInst
; }
155 //--------------------------------------------------------------------------