summaryrefslogtreecommitdiff
path: root/setup_native
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-06-05 13:37:30 +0200
committerAndras Timar <atimar@suse.com>2012-06-05 13:42:14 +0200
commit6d9be05a6fb251ed0cbcbcefd55ed174b1e8e39d (patch)
treef48806ee5c7fdf3c770ec7429d2de7b7ffe9ec32 /setup_native
parent22a29c2060355626ff0cba6c6d0ae70b8e2bbad3 (diff)
fdo#47805 rework handling of 64-bit registry entries
64-bit registry entries were entered via a custom action, which did not always work. By default the custom action ran with user privileges, which were not sufficient to write the registry. It is not necessary to use custom actions for this task. Windows installer supports it well. Change-Id: Id65458c363c2b90b3e7d166b4c836bfb1ff19bf4
Diffstat (limited to 'setup_native')
-rw-r--r--setup_native/prj/build.lst1
-rwxr-xr-xsetup_native/source/win32/customactions/reg64/exports.dxp2
-rw-r--r--setup_native/source/win32/customactions/reg64/makefile.mk76
-rw-r--r--setup_native/source/win32/customactions/reg64/reg64.cxx465
-rw-r--r--setup_native/source/win32/customactions/shellextensions/exports.dxp2
-rw-r--r--setup_native/source/win32/customactions/shellextensions/makefile.mk1
-rw-r--r--setup_native/source/win32/customactions/shellextensions/shellextensions.cxx216
7 files changed, 0 insertions, 763 deletions
diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst
index 13362f59c45c..8898e8ad4e17 100644
--- a/setup_native/prj/build.lst
+++ b/setup_native/prj/build.lst
@@ -10,7 +10,6 @@ pk setup_native\source\win32\customactions\regpatchactivex nmake - w sn_regp
pk setup_native\source\win32\customactions\reg4allmsdoc nmake - w sn_reg4allmsdoc NULL
pk setup_native\source\win32\customactions\sellang nmake - w sn_sellang NULL
pk setup_native\source\win32\customactions\thesaurus nmake - w sn_thesaurus NULL
-pk setup_native\source\win32\customactions\reg64 nmake - w sn_reg64 NULL
pk setup_native\source\win32\customactions\javafilter nmake - w sn_javafilter NULL
pk setup_native\source\win32\customactions\quickstarter nmake - w sn_quickstarter NULL
pk setup_native\source\win32\customactions\shellextensions nmake - w sn_shellextensions sn_tools.w NULL
diff --git a/setup_native/source/win32/customactions/reg64/exports.dxp b/setup_native/source/win32/customactions/reg64/exports.dxp
deleted file mode 100755
index 3282da1eeac0..000000000000
--- a/setup_native/source/win32/customactions/reg64/exports.dxp
+++ /dev/null
@@ -1,2 +0,0 @@
-InstallReg64
-DeinstallReg64
diff --git a/setup_native/source/win32/customactions/reg64/makefile.mk b/setup_native/source/win32/customactions/reg64/makefile.mk
deleted file mode 100644
index a0d7fbaefc1f..000000000000
--- a/setup_native/source/win32/customactions/reg64/makefile.mk
+++ /dev/null
@@ -1,76 +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=reg64msi
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=TRUE
-NO_DEFAULT_STL=TRUE
-DYNAMIC_CRT=
-USE_DEFFILE=TRUE
-EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
-
-.INCLUDE : settings.mk
-
-#Disable precompiled header
-CDEFS+=-Dnot_used_define_to_disable_pch
-
-# --- Files --------------------------------------------------------
-
-.IF "$(GUI)"=="WNT" && "$(WINDOWS_SDK_HOME)"!=""
-
-UWINAPILIB=
-
-SLOFILES = \
- $(SLO)$/reg64.obj
-
-STDSHL += \
- $(KERNEL32LIB)\
- $(USER32LIB)\
- $(ADVAPI32LIB)\
- $(SHELL32LIB)\
- $(MSILIB)\
- $(SHLWAPILIB)\
-
-SHL1TARGET = $(TARGET)
-SHL1IMPLIB = i$(TARGET)
-
-SHL1OBJS=$(SLOFILES)
-SHL1DEF = $(MISC)$/$(SHL1TARGET).def
-SHL1DEPN = $(SLB)$/$(TARGET).lib
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-
-.ENDIF
-
-# --- Targets --------------------------------------------------------------
-
-.INCLUDE : target.mk
-INCLUDE!:=$(subst,/stl, $(INCLUDE))
diff --git a/setup_native/source/win32/customactions/reg64/reg64.cxx b/setup_native/source/win32/customactions/reg64/reg64.cxx
deleted file mode 100644
index 7490a153fac4..000000000000
--- a/setup_native/source/win32/customactions/reg64/reg64.cxx
+++ /dev/null
@@ -1,465 +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
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <msiquery.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#include <malloc.h>
-#include <strsafe.h>
-
-// MinGW doesn't know anything about RegDeleteKeyExW if WINVER < 0x0502.
-extern "C" {
-WINADVAPI LONG WINAPI RegDeleteKeyExW(HKEY,LPCWSTR,REGSAM,DWORD);
-}
-
-// to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY
-// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems.
-// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and
-// extensions\source\activex\main\so_activex.cpp
-
-#ifndef KEY_WOW64_64KEY
- #define KEY_WOW64_64KEY (0x0100)
-#endif
-
-
-#define TABLE_NAME L"Reg64"
-#define INSTALLLOCATION L"[INSTALLLOCATION]"
-
-bool isInstall4AllUsers;
-wchar_t * sBasisInstallLocation;
-
-
-enum OPERATION {
- SET,
- REMOVE
-};
-
-#ifdef DEBUG
-inline void OutputDebugStringFormat( const wchar_t* pFormat, ... )
-{
- wchar_t buffer[1024];
- va_list args;
-
- va_start( args, pFormat );
- StringCchVPrintf( buffer, sizeof(buffer), pFormat, args );
- OutputDebugString( buffer );
-}
-#else
-static inline void OutputDebugStringFormat( const wchar_t*, ... )
-{
-}
-#endif
-
-bool WriteRegistry( MSIHANDLE & hMSI, OPERATION op, const wchar_t* componentName)
-{
- INSTALLSTATE current_state;
- INSTALLSTATE comp_state;
- UINT ret = MsiGetComponentState( hMSI, componentName, &current_state, &comp_state );
- if ( ERROR_SUCCESS == ret )
- {
- if (current_state == INSTALLSTATE_ABSENT)
- OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_ABSENT");
- else if (current_state == INSTALLSTATE_DEFAULT)
- OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_DEFAULT");
- else if (current_state == INSTALLSTATE_LOCAL)
- OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_LOCAL");
- else if (current_state == INSTALLSTATE_REMOVED)
- OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_REMOVED");
- else if (current_state == INSTALLSTATE_SOURCE)
- OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_SOURCE");
- else if (current_state == INSTALLSTATE_UNKNOWN)
- OutputDebugStringFormat(L"WriteRegistry - current_state: INSTALLSTATE_UNKNOWN");
-
- if (comp_state == INSTALLSTATE_ABSENT)
- OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_ABSENT");
- else if (comp_state == INSTALLSTATE_DEFAULT)
- OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_DEFAULT");
- else if (comp_state == INSTALLSTATE_LOCAL)
- OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_LOCAL");
- else if (comp_state == INSTALLSTATE_REMOVED)
- OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_REMOVED");
- else if (comp_state == INSTALLSTATE_SOURCE)
- OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_SOURCE");
- else if (comp_state == INSTALLSTATE_UNKNOWN)
- OutputDebugStringFormat(L"WriteRegistry - comp_state: INSTALLSTATE_UNKNOWN");
-
- switch (op)
- {
- case SET :
- if ( comp_state == INSTALLSTATE_LOCAL || ( current_state == INSTALLSTATE_LOCAL && comp_state == INSTALLSTATE_UNKNOWN ) )
- {
- return true;
- }
- break;
- case REMOVE:
- OutputDebugStringFormat(L"WriteRegistry - Remove\n" );
- if ( current_state == INSTALLSTATE_LOCAL && (comp_state == INSTALLSTATE_ABSENT || comp_state == INSTALLSTATE_REMOVED) )
- {
- OutputDebugStringFormat(L"WriteRegistry - To be removed\n" );
- return true;
- }
- }
- } else
- {
- if (ERROR_INVALID_HANDLE == ret) OutputDebugStringFormat(L"WriteRegistry - Invalid handle");
- if (ERROR_UNKNOWN_FEATURE == ret) OutputDebugStringFormat(L"WriteRegistry - Unknown feature");
- }
-
- return false;
-}
-
-BOOL UnicodeEquals( wchar_t* pStr1, wchar_t* pStr2 )
-{
- if ( pStr1 == NULL && pStr2 == NULL )
- return TRUE;
- else if ( pStr1 == NULL || pStr2 == NULL )
- return FALSE;
-
- while( *pStr1 == *pStr2 && *pStr1 && *pStr2 )
- pStr1++, pStr2++;
-
- return ( *pStr1 == 0 && *pStr2 == 0 );
-}
-
-BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue )
-{
- OutputDebugStringFormat(L"GetMsiProp - START\n" );
- DWORD sz = 0;
- UINT ret = MsiGetProperty( hMSI, pPropName, L"", &sz );
- if ( ret == 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 );
-
- OutputDebugStringFormat(L"GetMsiProp - Value" );
- OutputDebugStringFormat( buff );
- *ppValue = buff;
-
- return TRUE;
- } else if (ret == ERROR_INVALID_HANDLE)
- {
- OutputDebugStringFormat(L"GetMsiProp - ERROR_INVALID_HANDLE" );
- } else if (ret == ERROR_INVALID_PARAMETER)
- {
- OutputDebugStringFormat(L"GetMsiProp - ERROR_INVALID_PARAMETER" );
- } else if (ret == ERROR_SUCCESS)
- {
- OutputDebugStringFormat(L"GetMsiProp - ERROR_SUCCESS" );
- }
-
-
- OutputDebugStringFormat(L"GetMsiProp - ENDE\n" );
- return FALSE;
-}
-
-bool IsInstallForAllUsers( MSIHANDLE hMSI )
-{
- OutputDebugStringFormat(L"IsInstallForAllUsers - START\n" );
- bool bResult = FALSE;
- wchar_t* pVal = NULL;
- if ( GetMsiProp( hMSI, L"ALLUSERS", &pVal ) && pVal )
- {
- bResult = UnicodeEquals( pVal , L"1" );
- free( pVal );
- }
-
- OutputDebugStringFormat(L"IsInstallForAllUsers - ENDE\n" );
- return bResult;
-}
-
-wchar_t* GetBasisInstallLocation( MSIHANDLE hMSI )
-{
- OutputDebugStringFormat(L"GetBasisInstallLocation - START\n" );
- wchar_t* pVal = NULL;
- GetMsiProp( hMSI, L"INSTALLLOCATION", &pVal);
-
- OutputDebugStringFormat(L"GetBasisInstallLocation - ENDE\n" );
-
- return pVal;
-}
-
-
-bool QueryReg64Table(MSIHANDLE& rhDatabase, MSIHANDLE& rhView)
-{
- OutputDebugStringFormat(L"QueryReg64Table - START\n" );
- int const arraysize = 400;
- wchar_t szSelect[arraysize];
- StringCbPrintfW(szSelect, arraysize * sizeof(wchar_t), L"SELECT * FROM %s",TABLE_NAME);
- OutputDebugStringFormat( szSelect );
-
- UINT ret = MsiDatabaseOpenView(rhDatabase,szSelect,&rhView);
- if (ret != ERROR_SUCCESS)
- {
- if ( ret == ERROR_BAD_QUERY_SYNTAX)
- OutputDebugStringFormat(L"QueryReg64Table - MsiDatabaseOpenView - FAILED - ERROR_BAD_QUERY_SYNTAX\n" );
- if ( ret == ERROR_INVALID_HANDLE)
- OutputDebugStringFormat(L"QueryReg64Table - MsiDatabaseOpenView - FAILED - ERROR_INVALID_HANDLE\n" );
- return false;
- }
- // execute query - not a parameter query so second parameter is NULL.
- if (MsiViewExecute(rhView,NULL) != ERROR_SUCCESS)
- {
- OutputDebugStringFormat(L"QueryReg64Table - MsiViewExecute - FAILED\n" );
- return false;
- }
-
- OutputDebugStringFormat(L"QueryReg64Table - ENDE\n" );
- return true;
-}
-
-//---------------------------------------
-bool DeleteRegistryKey(HKEY RootKey, const wchar_t* KeyName)
-{
- int rc = RegDeleteKeyExW(
- RootKey, KeyName, KEY_WOW64_64KEY, 0);
-
- return (ERROR_SUCCESS == rc);
-}
-
-bool SetRegistryKey(HKEY RootKey, const wchar_t* KeyName, const wchar_t* ValueName, const wchar_t* Value)
-{
- HKEY hSubKey;
-
- // open or create the desired key
- int rc = RegCreateKeyEx(
- RootKey, KeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_WOW64_64KEY, 0, &hSubKey, 0);
-
- if (ERROR_SUCCESS == rc)
- {
- OutputDebugStringFormat(L"SetRegistryKey - Created\n" );
- rc = RegSetValueEx(
- hSubKey, ValueName, 0, REG_SZ, reinterpret_cast<const BYTE*>(Value), (wcslen(Value) + 1) * sizeof(wchar_t));
-
- RegCloseKey(hSubKey);
- } else {
- OutputDebugStringFormat(L"SetRegistryKey - FAILED\n" );
- }
-
-
- return (ERROR_SUCCESS == rc);
-}
-
-bool DoRegEntries( MSIHANDLE& rhMSI, OPERATION op, MSIHANDLE& rhView)
-{
- OutputDebugStringFormat(L"DoRegEntries - START\n" );
-
- MSIHANDLE hRecord;
-
- long lRoot;
- wchar_t szKey[255];
- wchar_t szName[255];
- wchar_t szValue[1024];
- wchar_t szComponent[255];
-
- /// read records until there are no more records
- while (MsiViewFetch(rhView,&hRecord) == ERROR_SUCCESS)
- {
- DWORD dwKey = 255;
- DWORD dwName = 255;
- DWORD dwValue = 1024;
- DWORD dwComponent = 255;
-
- szKey[0] = '\0';
- szName[0] = '\0';
- szValue[0] = '\0';
- szComponent[0] = '\0';
-
- lRoot = MsiRecordGetInteger(hRecord,2);
- MsiRecordGetString(hRecord,3,szKey,&dwKey);
-
- if (!MsiRecordIsNull(hRecord, 4))
- MsiRecordGetString(hRecord,4,szName,&dwName);
-
- if (!MsiRecordIsNull(hRecord, 5))
- {
- MsiRecordGetString(hRecord,5,szValue,&dwValue);
-
-
-
- wchar_t* nPos = wcsstr(szValue , INSTALLLOCATION);
- if ( NULL != nPos)
- {
-
- DWORD nPrefixSize = nPos - szValue;
-
- DWORD nPropSize = wcslen(sBasisInstallLocation);
- DWORD nPostfixSize = dwValue - wcslen( INSTALLLOCATION );
-
- DWORD nNewValueBytes = (nPropSize + nPostfixSize + 1) * sizeof( wchar_t );
- wchar_t* newValue = reinterpret_cast<wchar_t*>( malloc( nNewValueBytes ) );
- ZeroMemory( newValue, nNewValueBytes );
-
- // prefix
- wcsncpy(newValue, szValue, nPrefixSize);
-
- // basis location
- wcsncat(newValue, sBasisInstallLocation, nPropSize * sizeof( wchar_t ));
-
- // postfix
- wcsncat(newValue, nPos + ( wcslen( INSTALLLOCATION ) ), nPropSize * sizeof( wchar_t ));
-
- wcsncpy(szValue, newValue, nNewValueBytes <=1024? nNewValueBytes: 1024);
-
- free(newValue);
- }
-
- }
-
-
- MsiRecordGetString(hRecord,6,szComponent,&dwComponent);
-
- OutputDebugStringFormat(L"****** DoRegEntries *******" );
- OutputDebugStringFormat(L"Root:" );
- HKEY key = HKEY_CURRENT_USER;
- switch (lRoot)
- {
- case(-1):
- if (isInstall4AllUsers)
- {
- key = HKEY_LOCAL_MACHINE;
- OutputDebugStringFormat(L"HKEY_LOCAL_MACHINE" );
- }
- else
- {
- key = HKEY_CURRENT_USER;
- OutputDebugStringFormat(L"HKEY_CURRENT_USER" );
- }
- break;
- case(0):
- key = HKEY_CLASSES_ROOT;
- OutputDebugStringFormat(L"HKEY_CLASSES_ROOT" );
- break;
- case(1):
- key = HKEY_CURRENT_USER;
- OutputDebugStringFormat(L"HKEY_CURRENT_USER" );
- break;
- case(2):
- key = HKEY_LOCAL_MACHINE;
- OutputDebugStringFormat(L"HKEY_LOCAL_MACHINE" );
- break;
- case(3):
- key = HKEY_USERS;
- OutputDebugStringFormat(L"HKEY_USERS" );
- break;
- default:
- OutputDebugStringFormat(L"Unknown Root!" );
- break;
- }
-
- OutputDebugStringFormat(L"Key:");
- OutputDebugStringFormat( szKey );
- OutputDebugStringFormat(L"Name:");
- OutputDebugStringFormat( szName );
- OutputDebugStringFormat(L"Value:");
- OutputDebugStringFormat( szValue);
- OutputDebugStringFormat(L"Component:");
- OutputDebugStringFormat( szComponent );
- OutputDebugStringFormat(L"*******************" );
- switch (op)
- {
- case SET:
-
- if (WriteRegistry(rhMSI, SET, szComponent))
- {
- OutputDebugStringFormat(L"DoRegEntries - Write\n" );
- SetRegistryKey(key, szKey, szName, szValue);
- }
- break;
- case REMOVE:
- OutputDebugStringFormat(L"DoRegEntries - PreRemove\n" );
- if (WriteRegistry(rhMSI, REMOVE, szComponent))
- {
- OutputDebugStringFormat(L"DoRegEntries - Remove\n" );
- DeleteRegistryKey(key, szKey);
- }
- break;
- }
- }
-
- MsiCloseHandle(rhView);
-
-
- OutputDebugStringFormat(L"DoRegEntries - ENDE\n" );
-
- return true;
-}
-
-
-bool Reg64(MSIHANDLE& rhMSI, OPERATION op)
-{
- isInstall4AllUsers = IsInstallForAllUsers(rhMSI);
- sBasisInstallLocation = GetBasisInstallLocation(rhMSI);
-
- if (NULL == sBasisInstallLocation)
- {
- OutputDebugStringFormat(L"BASISINSTALLLOCATION is NULL\n" );
- return false;
- }
-
- MSIHANDLE hView;
- MSIHANDLE hDatabase = MsiGetActiveDatabase(rhMSI);
-
- QueryReg64Table(hDatabase, hView);
- OutputDebugStringFormat(L"Do something\n" );
- DoRegEntries( rhMSI, op, hView);
- OutputDebugStringFormat(L"Something done\n" );
-
- MsiCloseHandle(hView);
- MsiCloseHandle(hDatabase);
- free(sBasisInstallLocation);
-
- return true;
-}
-
-extern "C" UINT __stdcall InstallReg64(MSIHANDLE hMSI)
-{
- OutputDebugStringFormat(L"InstallReg64\n" );
- Reg64(hMSI, SET);
- return ERROR_SUCCESS;
-}
-
-extern "C" UINT __stdcall DeinstallReg64(MSIHANDLE hMSI)
-{
- OutputDebugStringFormat(L"DeinstallReg64\n" );
- Reg64(hMSI, REMOVE);
- return ERROR_SUCCESS;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/shellextensions/exports.dxp b/setup_native/source/win32/customactions/shellextensions/exports.dxp
index 5826d339274a..4e2611946586 100644
--- a/setup_native/source/win32/customactions/shellextensions/exports.dxp
+++ b/setup_native/source/win32/customactions/shellextensions/exports.dxp
@@ -1,5 +1,3 @@
-InstallExecSequenceEntry
-DeinstallExecSequenceEntry
InstallStartmenuFolderIcon
DeinstallStartmenuFolderIcon
SetProductInstallMode
diff --git a/setup_native/source/win32/customactions/shellextensions/makefile.mk b/setup_native/source/win32/customactions/shellextensions/makefile.mk
index b6961cf7e1f3..3a15e3510cbe 100644
--- a/setup_native/source/win32/customactions/shellextensions/makefile.mk
+++ b/setup_native/source/win32/customactions/shellextensions/makefile.mk
@@ -48,7 +48,6 @@ CDEFS+=-Dnot_used_define_to_disable_pch
UWINAPILIB=
SLOFILES = \
- $(SLO)$/shellextensions.obj \
$(SLO)$/startmenuicon.obj \
$(SLO)$/upgrade.obj \
$(SLO)$/iconcache.obj \
diff --git a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
deleted file mode 100644
index 5ddea958f4ae..000000000000
--- a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
+++ /dev/null
@@ -1,216 +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.
- *
- ************************************************************************/
-
-/*
- Windows shell extensions need to be approved in order to be used by the
- Windows shell for clarification read the following section from the
- Microsoft Developers Network Library (MSDN) see
- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_extending/extensionhandlers/shell_ext.asp
-
-
- <MSDN>
- Shell extension handlers run in the Shell process. Because it is a system process,
- the administrator of a Windows NT system can limit Shell extension handlers to
- those on an approved list by setting the EnforceShellExtensionSecurity value of the
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer key to 1
- (one).
- To place a Shell extension handler on the approved list, create a REG_SZ value whose
- name is the string form of the handler's GUID under
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved.
-
- The Shell does not use the value that is assigned to the GUID, but it should be set to
- make inspecting the registry easier.
-
- Your setup application can add values to the Approved key only if the person installing
- the application has sufficient privileges. If the attempt to add an extension handler
- fails, you should inform the user that administrative privileges are required to fully
- install the application. If the handler is essential to the application, you should fail
- the setup and notify the user to contact an administrator.
-
- While there is no need to add values to the Approved key on Windows 95 or Windows 98
- systems, there is no harm in doing so. The system will simply ignore them. However, there
- is no guarantee that the key will exist on these systems. Your setup program must be able
- to handle this case.
- </MSDN>
-
- We add the following entries to the respective registry key
- "{C52AF81D-F7A0-4AAB-8E87-F80A60CCD396}"="LibreOffice Column Handler"
- "{087B3AE3-E237-4467-B8DB-5A38AB959AC9}"="LibreOffice Infotip Handler"
- "{63542C48-9552-494A-84F7-73AA6A7C99C1}"="LibreOffice Property Sheet Handler"
- "{3B092F0C-7696-40E3-A80F-68D74DA84210}"="LibreOffice Thumbnail Viewer"
-
- These shell extensions are implemented in the 'shell' project. We ignore registration
- failures because of insufficient privileges. The reason is: On systems which restrict the
- use of shell extensions by applying the aforementioned policy probably only people with
- sufficient privileges are allowed to install applications anyway. On systems where the
- use of shell extensions is not restricted registration failures because of insufficient
- prviliges have no negative effect because the shell extensions will work anyhow.
-*/
-
-#ifdef _MSC_VER
-#pragma warning(push, 1) /* disable warnings within system headers */
-#endif
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <msiquery.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#include <malloc.h>
-
-#ifdef UNICODE
-#define _UNICODE
-#endif
-#include <tchar.h>
-
-struct RegistryEntry
-{
- TCHAR* Key;
- TCHAR* Value;
-};
-
-RegistryEntry ColumnHandler = { TEXT("{C52AF81D-F7A0-4AAB-8E87-F80A60CCD396}"), TEXT("LibreOffice Column Handler") };
-RegistryEntry InfotipHandler = { TEXT("{087B3AE3-E237-4467-B8DB-5A38AB959AC9}"), TEXT("LibreOffice Infotip Handler") };
-RegistryEntry PropHandler = { TEXT("{63542C48-9552-494A-84F7-73AA6A7C99C1}"), TEXT("LibreOffice Property Sheet Handler") };
-RegistryEntry ThumbViewer = { TEXT("{3B092F0C-7696-40E3-A80F-68D74DA84210}"), TEXT("LibreOffice Thumbnail Viewer") };
-
-BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue )
-{
- DWORD sz = 0;
- if ( MsiGetProperty( hMSI, pPropName, 0, &sz ) == ERROR_MORE_DATA )
- {
- sz++;
- DWORD nbytes = sz * sizeof( char );
- char* buff = reinterpret_cast<char*>( malloc( nbytes ) );
- ZeroMemory( buff, nbytes );
- MsiGetProperty( hMSI, pPropName, buff, &sz );
- *ppValue = buff;
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-bool IsVersionNT64( MSIHANDLE hMSI )
-{
- char* pVal = NULL;
-
- if ( GetMsiProp( hMSI, "VersionNT64", &pVal ) && pVal )
- {
- free( pVal );
- return true;
- }
-
- return false;
-}
-
-
-
-
-/*
- Called during installation when the module "Windows Explorer Extensions" is
- selected.
-*/
-extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE hMSI)
-{
- //MessageBox(NULL, TEXT("InstallExecSequenceEntry"), TEXT("Pythonmsi"), MB_OK | MB_ICONINFORMATION);
- HKEY hKey;
-
-
-// to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY
-// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems.
-// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and
-// extensions\source\activex\main\so_activex.cpp
-#ifndef KEY_WOW64_64KEY
- #define KEY_WOW64_64KEY (0x0100)
-#endif
-
- if (IsVersionNT64(hMSI))
- {
- // Open Windows 64 Bit Registry
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),0, KEY_WRITE | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS)
- {
- RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
- RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
- RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
- RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
-
- RegCloseKey(hKey);
- }
-
- // Open Windows 32 Bit Registry on Win64 machine
-
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),0, KEY_WRITE, &hKey ) == ERROR_SUCCESS)
- {
- RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
- RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
- RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
- RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
-
- RegCloseKey(hKey);
- }
-
-
- } else
- {
- if (RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), &hKey) == ERROR_SUCCESS)
- {
- RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
- RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
- RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
- RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
-
- RegCloseKey(hKey);
- }
- }
- return ERROR_SUCCESS;
-}
-
-/*
- Called during deinstallation when the module "Windows Explorer Extensions" has
- been installed.
-*/
-extern "C" UINT __stdcall DeinstallExecSequenceEntry(MSIHANDLE)
-{
- //MessageBox(NULL, TEXT("DeinstallExecSequenceEntry"), TEXT("Pythonmsi"), MB_OK | MB_ICONINFORMATION);
- HKEY hKey;
- if (RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), &hKey) == ERROR_SUCCESS)
- {
- RegDeleteValue(hKey, ColumnHandler.Key);
- RegDeleteValue(hKey, InfotipHandler.Key);
- RegDeleteValue(hKey, PropHandler.Key);
- RegDeleteValue(hKey, ThumbViewer.Key);
-
- RegCloseKey(hKey);
- }
- return ERROR_SUCCESS;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */