summaryrefslogtreecommitdiff
path: root/setup_native/source/win32/customactions/tools
diff options
context:
space:
mode:
Diffstat (limited to 'setup_native/source/win32/customactions/tools')
-rw-r--r--setup_native/source/win32/customactions/tools/checkversion.cxx151
-rw-r--r--setup_native/source/win32/customactions/tools/exports.dxp1
-rw-r--r--setup_native/source/win32/customactions/tools/makefile.mk72
-rw-r--r--setup_native/source/win32/customactions/tools/seterror.cxx99
-rw-r--r--setup_native/source/win32/customactions/tools/seterror.hxx56
5 files changed, 0 insertions, 379 deletions
diff --git a/setup_native/source/win32/customactions/tools/checkversion.cxx b/setup_native/source/win32/customactions/tools/checkversion.cxx
deleted file mode 100644
index 044a00533..000000000
--- a/setup_native/source/win32/customactions/tools/checkversion.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- 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
-
-#ifdef _MSC_VER
-#pragma warning(push,1) // disable warnings within system headers
-#endif
-#include <windows.h>
-#include <msiquery.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#include <string.h>
-#include <malloc.h>
-#include <stdio.h>
-#include "strsafe.h"
-
-#include <seterror.hxx>
-
-//----------------------------------------------------------
-BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue )
-{
- DWORD sz = 0;
- if ( MsiGetProperty( hMSI, pPropName, L"", &sz ) == ERROR_MORE_DATA )
- {
- sz++;
- DWORD nbytes = sz * sizeof( wchar_t );
- wchar_t* buff = reinterpret_cast<wchar_t*>( malloc( nbytes ) );
- ZeroMemory( buff, nbytes );
- MsiGetProperty( hMSI, pPropName, buff, &sz );
- *ppValue = buff;
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-//----------------------------------------------------------
-#ifdef DEBUG
-inline void OutputDebugStringFormat( LPCTSTR pFormat, ... )
-{
- TCHAR buffer[1024];
- va_list args;
-
- va_start( args, pFormat );
- StringCchVPrintf( buffer, sizeof(buffer), pFormat, args );
- OutputDebugString( buffer );
-}
-#else
-static inline void OutputDebugStringFormat( LPCTSTR, ... )
-{
-}
-#endif
-
-//----------------------------------------------------------
-extern "C" UINT __stdcall CheckVersions( MSIHANDLE hMSI )
-{
- // MessageBox(NULL, L"CheckVersions", L"Information", MB_OK | MB_ICONINFORMATION);
-
- wchar_t* pVal = NULL;
-
- if ( GetMsiProp( hMSI, L"NEWPRODUCTS", &pVal ) && pVal )
- {
- OutputDebugStringFormat( TEXT("DEBUG: NEWPRODUCTS found [%s]"), pVal );
- if ( *pVal != 0 )
- SetMsiErrorCode( MSI_ERROR_NEW_VERSION_FOUND );
- free( pVal );
- }
- pVal = NULL;
- if ( GetMsiProp( hMSI, L"SAMEPRODUCTS", &pVal ) && pVal )
- {
- OutputDebugStringFormat( TEXT("DEBUG: SAMEPRODUCTS found [%s]"), pVal );
- if ( *pVal != 0 )
- SetMsiErrorCode( MSI_ERROR_SAME_VERSION_FOUND );
- free( pVal );
- }
- pVal = NULL;
- if ( GetMsiProp( hMSI, L"OLDPRODUCTS", &pVal ) && pVal )
- {
- OutputDebugStringFormat( TEXT("DEBUG: OLDPRODUCTS found [%s]"), pVal );
- if ( *pVal != 0 )
- SetMsiErrorCode( MSI_ERROR_OLD_VERSION_FOUND );
- free( pVal );
- }
- pVal = NULL;
- if ( GetMsiProp( hMSI, L"BETAPRODUCTS", &pVal ) && pVal )
- {
- OutputDebugStringFormat( TEXT("DEBUG: BETAPRODUCTS found [%s]"), pVal );
- if ( *pVal != 0 )
- SetMsiErrorCode( MSI_ERROR_OLD_VERSION_FOUND );
- free( pVal );
- }
-
- pVal = NULL;
- if ( GetMsiProp( hMSI, L"NEWPRODUCTSPATCH", &pVal ) && pVal )
- {
- OutputDebugStringFormat( TEXT("DEBUG: NEWPRODUCTSPATCH found [%s]"), pVal );
- if ( *pVal != 0 )
- SetMsiErrorCode( MSI_ERROR_NEW_PATCH_FOUND );
- free( pVal );
- }
- pVal = NULL;
- if ( GetMsiProp( hMSI, L"SAMEPRODUCTSPATCH", &pVal ) && pVal )
- {
- OutputDebugStringFormat( TEXT("DEBUG: SAMEPRODUCTSPATCH found [%s]"), pVal );
- if ( *pVal != 0 )
- SetMsiErrorCode( MSI_ERROR_SAME_PATCH_FOUND );
- free( pVal );
- }
- pVal = NULL;
- if ( GetMsiProp( hMSI, L"OLDPRODUCTSPATCH", &pVal ) && pVal )
- {
- OutputDebugStringFormat( TEXT("DEBUG: OLDPRODUCTSPATCH found [%s]"), pVal );
- if ( *pVal != 0 )
- SetMsiErrorCode( MSI_ERROR_OLD_PATCH_FOUND );
- free( pVal );
- }
-
- return ERROR_SUCCESS;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/tools/exports.dxp b/setup_native/source/win32/customactions/tools/exports.dxp
deleted file mode 100644
index 18d82240f..000000000
--- a/setup_native/source/win32/customactions/tools/exports.dxp
+++ /dev/null
@@ -1 +0,0 @@
-CheckVersions
diff --git a/setup_native/source/win32/customactions/tools/makefile.mk b/setup_native/source/win32/customactions/tools/makefile.mk
deleted file mode 100644
index 61c58036b..000000000
--- a/setup_native/source/win32/customactions/tools/makefile.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-#*************************************************************************
-#
-# 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.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..$/..
-PRJNAME=setup_native
-TARGET=sn_tools
-
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=TRUE
-NO_DEFAULT_STL=TRUE
-DYNAMIC_CRT=
-USE_DEFFILE=TRUE
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(GUI)"=="WNT" && "$(WINDOWS_SDK_HOME)"!=""
-
-UWINAPILIB=
-
-SLOFILES = $(SLO)$/seterror.obj \
- $(SLO)$/checkversion.obj
-
-SHL1OBJS = $(SLOFILES)
-
-STDSHL+= \
- $(ADVAPI32LIB)\
- $(MSILIB)
-
-SHL1TARGET = $(TARGET)
-SHL1IMPLIB = i$(TARGET)
-
-SHL1DEF = $(MISC)$/$(SHL1TARGET).def
-SHL1DEPN = $(SLB)$/$(TARGET).lib
-SHL1BASE = 0x1c000000
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-
-.ENDIF
-
-# --- Targets --------------------------------------------------------------
-
-.INCLUDE : target.mk
-
-# -------------------------------------------------------------------------
diff --git a/setup_native/source/win32/customactions/tools/seterror.cxx b/setup_native/source/win32/customactions/tools/seterror.cxx
deleted file mode 100644
index 0927283be..000000000
--- a/setup_native/source/win32/customactions/tools/seterror.cxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- 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
-
-#ifdef _MSC_VER
-#pragma warning(push,1) // disable warnings within system headers
-#endif
-#include <windows.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#include <string.h>
-#include <malloc.h>
-#include <stdio.h>
-#include "strsafe.h"
-
-#include <seterror.hxx>
-
-//----------------------------------------------------------
-#ifdef DEBUG
-inline void OutputDebugStringFormat( LPCTSTR pFormat, ... )
-{
- TCHAR buffer[1024];
- va_list args;
-
- va_start( args, pFormat );
- StringCchVPrintf( buffer, sizeof(buffer), pFormat, args );
- OutputDebugString( buffer );
-}
-#else
-static inline void OutputDebugStringFormat( LPCTSTR, ... )
-{
-}
-#endif
-
-//----------------------------------------------------------
-void SetMsiErrorCode( int nErrorCode )
-{
- const TCHAR sMemMapName[] = TEXT( "Global\\MsiErrorObject" );
-
- HANDLE hMapFile;
- int *pBuf;
-
- hMapFile = OpenFileMapping(
- FILE_MAP_ALL_ACCESS, // read/write access
- FALSE, // do not inherit the name
- sMemMapName ); // name of mapping object
-
- if ( hMapFile == NULL ) // can not set error code
- {
- OutputDebugStringFormat( TEXT("Could not open map file (%d).\n"), GetLastError() );
- return;
- }
-
- pBuf = (int*) MapViewOfFile( hMapFile, // handle to map object
- FILE_MAP_ALL_ACCESS, // read/write permission
- 0,
- 0,
- sizeof( int ) );
- if ( pBuf )
- {
- *pBuf = nErrorCode;
- UnmapViewOfFile( pBuf );
- }
- else
- OutputDebugStringFormat( TEXT("Could not map view of file (%d).\n"), GetLastError() );
-
- CloseHandle( hMapFile );
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/tools/seterror.hxx b/setup_native/source/win32/customactions/tools/seterror.hxx
deleted file mode 100644
index abc76cac8..000000000
--- a/setup_native/source/win32/customactions/tools/seterror.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- 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 _SETERROR_HXX_
-#define _SETERROR_HXX_
-
-//----------------------------------------------------------
-// list of own error codes
-
-#define MSI_ERROR_INVALIDDIRECTORY 9001
-#define MSI_ERROR_ISWRONGPRODUCT 9002
-#define MSI_ERROR_PATCHISOLDER 9003
-
-#define MSI_ERROR_NEW_VERSION_FOUND 9010
-#define MSI_ERROR_SAME_VERSION_FOUND 9011
-#define MSI_ERROR_OLD_VERSION_FOUND 9012
-#define MSI_ERROR_NEW_PATCH_FOUND 9013
-#define MSI_ERROR_SAME_PATCH_FOUND 9014
-#define MSI_ERROR_OLD_PATCH_FOUND 9015
-
-#define MSI_ERROR_OFFICE_IS_RUNNING 9020
-
-#define MSI_ERROR_DIRECTORY_NOT_EMPTY 9030
-
-//----------------------------------------------------------
-
-void SetMsiErrorCode( int nErrorCode );
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */