Kaydet (Commit) 48c57397 authored tarafından Andras Timar's avatar Andras Timar

remove sources of setup.exe

üst 1a81ca45
......@@ -53,7 +53,6 @@ ifeq ($(OS),WNT)
$(eval $(call gb_Helper_register_executables,OOO,\
guiloader \
guistdio \
loader2 \
odbcconfig \
officeloader \
quickstart \
......
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2011 David Tardon, Red Hat Inc. <dtardon@redhat.com> (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
$(eval $(call gb_Executable_Executable,loader2))
$(eval $(call gb_Executable_set_targettype_gui,loader2,YES))
$(eval $(call gb_Executable_set_include,loader2,\
$$(INCLUDE) \
))
$(eval $(call gb_Executable_add_linked_libs,loader2,\
advapi32 \
gdi32 \
msi \
shell32 \
))
ifeq ($(COM),MSC)
ifeq ($(gb_PRODUCT),)
$(eval $(call gb_Executable_add_linked_libs,loader2,\
libcmtd \
))
else
$(eval $(call gb_Executable_add_linked_libs,loader2,\
libcmt \
))
endif
endif
$(foreach file, \
desktop/win32/source/setup/setup_main \
desktop/win32/source/setup/setup_w, \
$(eval $(call gb_Executable_add_exception_objects,loader2,$(file)))\
$(eval $(call gb_CxxObject_get_target,$(file)) : DEFS := $(filter-out -D_DLL,$(gb_LinkTarget_DEFAULTDEFS) $(CPPFLAGS)))\
$(eval $(call gb_CxxObject_get_target,$(file)) : T_CXXFLAGS := -MT $(filter-out -MD,$(gb_LinkTarget_EXCEPTIONFLAGS) $(gb_LinkTarget_CXXFLAGS)))\
)
# vim: set ts=4 sw=4 et:
......@@ -72,7 +72,6 @@ ifeq ($(OS),WNT)
$(eval $(call gb_Module_add_targets,desktop,\
Executable_crashrep.com \
Executable_loader2 \
Executable_quickstart \
Executable_sbase \
Executable_scalc \
......@@ -85,7 +84,6 @@ $(eval $(call gb_Module_add_targets,desktop,\
Executable_unoinfo \
Executable_unopkg \
Executable_unopkg.com \
Package_rcfile \
WinResTarget_quickstart \
WinResTarget_sbase \
WinResTarget_scalc \
......
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2011 David Tardon, Red Hat Inc. <dtardon@redhat.com> (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
$(eval $(call gb_Package_Package,desktop_rcfile,$(WORKDIR)/CustomTarget/win32/source/setup))
$(eval $(call gb_Package_add_customtarget,desktop_rcfile,desktop/win32/source/setup))
# vim: set ts=4 sw=4 et:
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2011 David Tardon, Red Hat Inc. <dtardon@redhat.com> (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
gb_PARTIALBUILD:=T
include $(GBUILDDIR)/gbuild_simple.mk
DESTDIR := $(WORKDIR)/CustomTarget/desktop/win32/source/setup
ifneq ($(WITH_LANG),)
# TODO: how the localized version is made?
ULF := setup.ulf
else
ULF := setup.ulf
endif
$(DESTDIR)/loader2.rc : $(ULF) rcfooter.txt rcheader.txt rctmpl.txt
lngconvex.exe -ulf $(ULF) -rc $@ -rct rctmpl.txt -rch rcheader.txt -rcf rcfooter.txt
.DEFAULT_TARGET := all
.PHONY : all
all : $(DESTDIR)/loader2.rc
# vim: set ts=4 sw=4 noet:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _RESOURCE_H
#define _RESOURCE_H
#define IDS_APP_TITLE 10
#define IDS_APP_PROD_TITLE 11
#define IDS_OUTOFMEM 12
#define IDS_NOMSI 13
#define IDS_USER_CANCELLED 14
#define IDS_REQUIRES_ADMIN_PRIV 15
#define IDS_FILE_NOT_FOUND 16
#define IDS_INVALID_PARAM 17
#define IDS_ALLOW_MSI_UPDATE 18
#define IDS_USAGE 19
#define IDS_ALREADY_RUNNING 20
#define IDS_UNKNOWN_ERROR 21
#define IDS_INVALID_PROFILE 22
#define IDS_UNKNOWN_LANG 23
#define IDS_SETUP_TO_OLD 24
#define IDS_SETUP_NOT_FOUND 25
#define IDS_LANGUAGE_ENGLISH 50
#define IDS_LANGUAGE_SPAIN 51
#define IDS_LANGUAGE_GERMAN 52
#define IDS_LANGUAGE_ZH_TW 53
#define IDS_LANGUAGE_CS 54
#define IDS_LANGUAGE_DA 55
#define IDS_LANGUAGE_DE_DE 56
#define IDS_LANGUAGE_EL 57
#define IDS_LANGUAGE_EN_US 58
#define IDS_LANGUAGE_ES 59
#define IDS_LANGUAGE_FI 60
#define IDS_LANGUAGE_FR_FR 61
#define IDS_LANGUAGE_HE 62
#define IDS_LANGUAGE_HU 63
#define IDS_LANGUAGE_IT_IT 64
#define IDS_LANGUAGE_JA 65
#define IDS_LANGUAGE_KO 66
#define IDS_LANGUAGE_NL_NL 67
#define IDS_LANGUAGE_NO_NO 68
#define IDS_LANGUAGE_PL 69
#define IDS_LANGUAGE_PT_BR 70
#define IDS_LANGUAGE_RU 71
#define IDS_LANGUAGE_SK 72
#define IDS_LANGUAGE_SV_SE 73
#define IDS_LANGUAGE_TH 74
#define IDS_LANGUAGE_TR 75
#define IDS_LANGUAGE_ET 76
#define IDS_LANGUAGE_ZH_CN 77
#define IDS_LANGUAGE_PT_PT 78
#define IDI_INSTALLER 99
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#if defined(_MSC_VER) && (_MSC_VER < 1500)
#include <winres.h>
#else
#define WINVER 0x0500
#include <winresrc.h>
#define LB_ADDSTRING (WM_USER+1)
#define CB_ADDSTRING (WM_USER+3)
#define IDC_STATIC (-1)
#endif
#include "Resource.h"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,1,0
PRODUCTVERSION 1,1,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x9L
#else
FILEFLAGS 0x8L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
IDI_INSTALLER ICON "setup.ico"
// String Table
STRINGTABLE DISCARDABLE
BEGIN
IDS_APP_TITLE %APP_TITLE%
IDS_APP_PROD_TITLE %APP_PROD_TITLE%
IDS_OUTOFMEM %OUTOFMEM%
IDS_NOMSI %NOMSI%
IDS_USER_CANCELLED %USER_CANCELLED%
IDS_REQUIRES_ADMIN_PRIV %REQUIRES_ADMIN_PRIV%
IDS_FILE_NOT_FOUND %FILE_NOT_FOUND%
IDS_INVALID_PARAM %INVALID_PARAM%
IDS_SETUP_TO_OLD %SETUP_TO_OLD%
IDS_SETUP_NOT_FOUND %SETUP_NOT_FOUND%
IDS_USAGE %USAGE%
IDS_ALREADY_RUNNING %ALREADY_RUNNING%
IDS_UNKNOWN_ERROR %UNKNOWN_ERROR%
IDS_INVALID_PROFILE %INVALID_PROFILE%
IDS_UNKNOWN_LANG %UNKNOWN_LANG%
IDS_LANGUAGE_ENGLISH %LANGUAGE_ENGLISH%
IDS_LANGUAGE_SPAIN %LANGUAGE_SPAIN%
IDS_LANGUAGE_GERMAN %LANGUAGE_GERMAN%
IDS_LANGUAGE_ZH_TW %LANGUAGE_ZH_TW%
IDS_LANGUAGE_CS %LANGUAGE_CS%
IDS_LANGUAGE_DA %LANGUAGE_DA%
IDS_LANGUAGE_DE_DE %LANGUAGE_DE_DE%
IDS_LANGUAGE_EL %LANGUAGE_EL%
IDS_LANGUAGE_EN_US %LANGUAGE_EN_US%
IDS_LANGUAGE_ES %LANGUAGE_ES%
IDS_LANGUAGE_FI %LANGUAGE_FI%
IDS_LANGUAGE_FR_FR %LANGUAGE_FR_FR%
IDS_LANGUAGE_HE %LANGUAGE_HE%
IDS_LANGUAGE_HU %LANGUAGE_HU%
IDS_LANGUAGE_IT_IT %LANGUAGE_IT_IT%
IDS_LANGUAGE_JA %LANGUAGE_JA%
IDS_LANGUAGE_KO %LANGUAGE_KO%
IDS_LANGUAGE_NL_NL %LANGUAGE_NL_NL%
IDS_LANGUAGE_NO_NO %LANGUAGE_NO_NO%
IDS_LANGUAGE_PL %LANGUAGE_PL%
IDS_LANGUAGE_PT_BR %LANGUAGE_PT_BR%
IDS_LANGUAGE_RU %LANGUAGE_RU%
IDS_LANGUAGE_SK %LANGUAGE_SK%
IDS_LANGUAGE_SV_SE %LANGUAGE_SV_SE%
IDS_LANGUAGE_TH %LANGUAGE_TH%
IDS_LANGUAGE_TR %LANGUAGE_TR%
IDS_LANGUAGE_ET %LANGUAGE_ET%
IDS_LANGUAGE_ZH_CN %LANGUAGE_ZH_CN%
IDS_LANGUAGE_PT_PT %LANGUAGE_PT_PT%
END
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include "setup_main.hxx"
//--------------------------------------------------------------------------
#ifdef SetupAppX
#undef SetupAppX
#endif
#ifdef Create_SetupAppX
#undef Create_SetupAppX
#endif
#ifdef LanguageDataX
#undef LanguageDataX
#endif
#ifdef UNICODE
#define SetupAppX SetupAppW
#define Create_SetupAppX Create_SetupAppW
#define LanguageDataX LanguageDataW
#else
#define SetupAppX SetupAppA
#define Create_SetupAppX Create_SetupAppA
#define LanguageDataX LanguageDataA
#endif
//--------------------------------------------------------------------------
struct LanguageDataX
{
long m_nLanguageID;
LPTSTR m_pTransform;
LanguageDataX( LPTSTR pData );
~LanguageDataX();
};
//--------------------------------------------------------------------------
class SetupAppX : public SetupApp
{
HINSTANCE m_hInst;
HANDLE m_hMapFile;
LPTSTR m_pAppTitle;
LPTSTR m_pCmdLine;
LPTSTR m_pDatabase;
LPTSTR m_pReqVersion;
LPTSTR m_pProductName;
LPTSTR m_pAdvertise;
LPTSTR m_pTmpName;
LPTSTR m_pErrorText;
LPTSTR m_pModuleFile;
LPTSTR m_pPatchFiles;
LPCTSTR m_pUpgradeKey;
LPCTSTR m_pProductVersion;
int *m_pMSIErrorCode;
boolean m_bQuiet : 1;
boolean m_bIgnoreAlreadyRunning : 1;
boolean m_bRegNoMsoTypes :1;
boolean m_bRegAllMsoTypes :1;
boolean m_bIsMinorUpgrade :1;
boolean m_bSupportsPatch :1;
FILE *m_pLogFile;
long m_nLanguageID;
long m_nLanguageCount;
LanguageDataX** m_ppLanguageList;
private:
boolean GetPathToFile( TCHAR* pFileName, TCHAR **pPath );
LPCTSTR GetPathToMSI();
int GetNameValue( TCHAR* pLine, TCHAR **pName, TCHAR **pValue );
boolean GetProfileSection( LPCTSTR pFileName, LPCTSTR pSection,
DWORD& rSize, LPTSTR *pRetBuf );
LPTSTR CopyIniFile( LPCTSTR pIniFile );
void ConvertNewline( LPTSTR pText ) const;
boolean LaunchInstaller( LPCTSTR pParam );
HMODULE LoadMsiLibrary();
DWORD WaitForProcess( HANDLE hHandle );
boolean GetCmdLineParameters( LPTSTR *pCmdLine );
DWORD GetNextArgument( LPCTSTR pStr, LPTSTR *pArg,
LPTSTR *pNext, boolean bStripQuotes = false );
boolean IsAdmin();
boolean GetCommandLine();
boolean IsTerminalServerInstalled() const;
void AddFileToPatchList( TCHAR* pPath, TCHAR* pFile );
boolean IsPatchInstalled( TCHAR* pBaseDir, TCHAR* pFileName );
boolean InstallRuntimes( TCHAR* pProductCode, TCHAR* pFileName );
public:
SetupAppX();
~SetupAppX();
virtual boolean Initialize( HINSTANCE hInst );
virtual boolean AlreadyRunning() const;
virtual boolean ReadProfile();
virtual boolean GetPatches();
virtual boolean ChooseLanguage( long& rLanguage );
virtual boolean CheckVersion();
virtual boolean CheckForUpgrade();
virtual boolean InstallRuntimes();
virtual boolean Install( long nLanguage );
virtual UINT GetError() const;
virtual void DisplayError( UINT nErr ) const;
void Log( LPCTSTR pMessage, LPCTSTR pText = NULL ) const;
long GetLanguageCount() const { return m_nLanguageCount; }
long GetLanguageID( long nIndex ) const;
void GetLanguageName( long nLanguage, LPTSTR sName ) const;
LPCTSTR GetAppTitle() const { return m_pAppTitle; }
LPTSTR SetProdToAppTitle( LPCTSTR pProdName );
HINSTANCE GetHInst() const { return m_hInst; }
};
//--------------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[%APP_TITLE%]
en-US = "Setup"
[%APP_PROD_TITLE%]
en-US = "The %PRODUCTNAME Setup"
[%OUTOFMEM%]
en-US = "Out of Memory"
[%NOMSI%]
en-US = "Setup was unable to find the msi package."
[%USER_CANCELLED%]
en-US = "Setup was cancelled"
[%REQUIRES_ADMIN_PRIV%]
en-US = "Administrator privileges are required for upgrading the Windows Installer."
[%FILE_NOT_FOUND%]
en-US = "Setup was unable to find the file '%s'."
[%INVALID_PARAM%]
en-US = "Invalid command line option '%s'. Please use '/?' for help."
[%SETUP_TO_OLD%]
en-US = "This package requires at least the version '%s' of the Windows Installer. \nYou have Windows Installer '%s' on your system!"
[%SETUP_NOT_FOUND%]
en-US = "This package requires the Windows Installer. \nYou need at least Windows Installer '%s' on your system!"
[%USAGE%]
en-US = "Usage:\n /? : Shows this dialog.\n /a : Performs an administrative installation.\n /j[u|m] : Performs an advertising installation.\n /q[n] : Do not show any user interface (silent mode).\n"
[%ALREADY_RUNNING%]
en-US = "There is already a setup process running."
[%UNKNOWN_ERROR%]
en-US = "An Unknown Error occurred!"
[%INVALID_PROFILE%]
en-US = "Invalid or incomplete profile."
[%UNKNOWN_LANG%]
en-US = "Unknown Language: %d"
[%LANGUAGE_ZH_TW%]
en-US = "Chinese (traditional)"
[%LANGUAGE_CS%]
en-US = "Czech"
[%LANGUAGE_DA%]
en-US = "Danish"
[%LANGUAGE_DE_DE%]
en-US = "German (Germany)"
[%LANGUAGE_EL%]
en-US = "Greek"
[%LANGUAGE_EN_US%]
en-US = "English (USA)"
[%LANGUAGE_ES%]
en-US = "Spanish (Spain)"
[%LANGUAGE_FI%]
en-US = "Finnish"
[%LANGUAGE_FR_FR%]
en-US = "French (France)"
[%LANGUAGE_HE%]
en-US = "Hebrew"
[%LANGUAGE_HU%]
en-US = "Hungarian"
[%LANGUAGE_IT_IT%]
en-US = "Italian (Italy)"
[%LANGUAGE_JA%]
en-US = "Japanese"
[%LANGUAGE_KO%]
en-US = "Korean"
[%LANGUAGE_NL_NL%]
en-US = "Dutch (Netherlands)"
[%LANGUAGE_NO_NO%]
en-US = "Norwegian (Bokmål)"
[%LANGUAGE_PL%]
en-US = "Polish"
[%LANGUAGE_PT_BR%]
en-US = "Portuguese (Brazil)"
[%LANGUAGE_RU%]
en-US = "Russian"
[%LANGUAGE_SK%]
en-US = "Slovakian"
[%LANGUAGE_SV_SE%]
en-US = "Swedish (Sweden)"
[%LANGUAGE_TH%]
en-US = "Thai"
[%LANGUAGE_TR%]
en-US = "Turkish"
[%LANGUAGE_ET%]
en-US = "Estonian"
[%LANGUAGE_ZH_CN%]
en-US = "Chinese (Simplified)"
[%LANGUAGE_PT_PT%]
en-US = "Portuguese (Portugal)"
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#if defined _MSC_VER
#pragma warning(push, 1)
#endif
#include <windows.h>
#if defined _MSC_VER
#pragma warning(pop)
#endif
#include <new>
#include "setup_main.hxx"
//--------------------------------------------------------------------------
void __cdecl newhandler()
{
throw std::bad_alloc();
return;
}
//--------------------------------------------------------------------------
SetupApp::SetupApp()
{
m_uiRet = ERROR_SUCCESS;
// Get OS version
OSVERSIONINFO sInfoOS;
ZeroMemory( &sInfoOS, sizeof(OSVERSIONINFO) );
sInfoOS.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
GetVersionEx( &sInfoOS );
m_nOSVersion = sInfoOS.dwMajorVersion;
m_nMinorVersion = sInfoOS.dwMinorVersion;
m_bNeedReboot = false;
m_bAdministrative = false;
}
//--------------------------------------------------------------------------
SetupApp::~SetupApp()
{
}
//--------------------------------------------------------------------------
extern "C" int __stdcall WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, int )
{
// Get OS version
OSVERSIONINFO sInfoOS;
ZeroMemory( &sInfoOS, sizeof(OSVERSIONINFO) );
sInfoOS.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
GetVersionEx( &sInfoOS );
SetupApp *pSetup;
pSetup = Create_SetupAppW();
try
{
if ( ! pSetup->Initialize( hInst ) )
throw pSetup->GetError();
if ( pSetup->AlreadyRunning() )
throw (UINT) ERROR_INSTALL_ALREADY_RUNNING;
if ( ! pSetup->ReadProfile() )
throw pSetup->GetError();
if ( ! pSetup->CheckVersion() )
throw pSetup->GetError();
if ( ! pSetup->IsAdminInstall() )
if ( ! pSetup->GetPatches() )
throw pSetup->GetError();
// CheckForUpgrade() has to be called after calling GetPatches()!
if ( ! pSetup->CheckForUpgrade() )
throw pSetup->GetError();
long nLanguage;
if ( ! pSetup->ChooseLanguage( nLanguage ) )
throw pSetup->GetError();
if ( ! pSetup->InstallRuntimes() )
throw pSetup->GetError();
if ( ! pSetup->Install( nLanguage ) )
throw pSetup->GetError();
}
catch ( std::bad_alloc )
{
pSetup->DisplayError( ERROR_OUTOFMEMORY );
}
catch ( UINT &nErr )
{
pSetup->DisplayError( nErr );
}
int nRet = pSetup->GetError();
delete pSetup;
return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef SETUP_MAIN_HXX
#define SETUP_MAIN_HXX
class SetupApp
{
DWORD m_nOSVersion;
DWORD m_nMinorVersion;
boolean m_bNeedReboot : 1;
boolean m_bAdministrative : 1;
public:
UINT m_uiRet;
SetupApp();
virtual ~SetupApp();
virtual boolean Initialize( HINSTANCE hInst ) = 0;
virtual boolean AlreadyRunning() const = 0;
virtual boolean ReadProfile() = 0;
virtual boolean GetPatches() = 0;
virtual boolean ChooseLanguage( long& rLanguage ) = 0;
virtual boolean CheckVersion() = 0;
virtual boolean CheckForUpgrade() = 0;
virtual boolean InstallRuntimes() = 0;
virtual boolean Install( long nLanguage ) = 0;
virtual UINT GetError() const = 0;
virtual void DisplayError( UINT nErr ) const = 0;
void SetError( UINT nErr ) { m_uiRet = nErr; }
DWORD GetOSVersion() const { return m_nOSVersion; }
DWORD GetMinorVersion() const { return m_nMinorVersion; }
boolean IsAdminInstall() { return m_bAdministrative; }
void SetAdminInstall( boolean bValue ) { m_bAdministrative = bValue; }
void SetRebootNeeded( boolean bNeedReboot ) { m_bNeedReboot = bNeedReboot; }
boolean NeedReboot() const { return m_bNeedReboot; }
};
SetupApp* Create_SetupAppW();
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#define UNICODE 1
#define _UNICODE 1
#include "setup.cpp"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment