summaryrefslogtreecommitdiff
path: root/setup_native/source
diff options
context:
space:
mode:
Diffstat (limited to 'setup_native/source')
-rw-r--r--setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml14
-rw-r--r--setup_native/source/ulfconv/ulfconv.cxx60
-rw-r--r--setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx154
-rw-r--r--setup_native/source/win32/customactions/javafilter/jfregca.cxx116
-rw-r--r--setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx64
-rw-r--r--setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx122
-rw-r--r--setup_native/source/win32/customactions/languagepacks/respintest.cxx40
-rw-r--r--setup_native/source/win32/customactions/patch/swappatchfiles.cxx308
-rw-r--r--setup_native/source/win32/customactions/quickstarter/quickstarter.cxx52
-rw-r--r--setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx4
-rw-r--r--setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx22
-rw-r--r--setup_native/source/win32/customactions/rebase/rebase.cxx30
-rw-r--r--setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx14
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/constants.hxx14
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx10
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx78
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx78
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/register.cxx116
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/register.hxx6
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrar.cxx234
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrar.hxx44
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx22
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx68
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registry.cxx34
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registry.hxx64
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx12
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx20
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx16
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx24
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx6
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx32
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx78
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx36
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx8
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx4
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx30
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx24
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx8
-rw-r--r--setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx10
-rw-r--r--setup_native/source/win32/customactions/reg64/reg64.cxx78
-rw-r--r--setup_native/source/win32/customactions/regactivex/regactivex.cxx6
-rw-r--r--setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx4
-rw-r--r--setup_native/source/win32/customactions/relnotes/relnotes.cxx8
-rw-r--r--setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx10
-rw-r--r--setup_native/source/win32/customactions/shellextensions/checkpatches.cxx6
-rw-r--r--setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx80
-rw-r--r--setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx72
-rw-r--r--setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx2
-rw-r--r--setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx6
-rw-r--r--setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx26
-rw-r--r--setup_native/source/win32/customactions/shellextensions/iconcache.cxx26
-rw-r--r--setup_native/source/win32/customactions/shellextensions/layerlinks.cxx18
-rw-r--r--setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx42
-rw-r--r--setup_native/source/win32/customactions/shellextensions/postuninstall.cxx42
-rw-r--r--setup_native/source/win32/customactions/shellextensions/registerextensions.cxx52
-rw-r--r--setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx6
-rw-r--r--setup_native/source/win32/customactions/shellextensions/shellextensions.cxx104
-rw-r--r--setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx54
-rw-r--r--setup_native/source/win32/customactions/shellextensions/upgrade.cxx92
-rw-r--r--setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx12
-rw-r--r--setup_native/source/win32/customactions/tools/checkversion.cxx2
-rw-r--r--setup_native/source/win32/customactions/tools/seterror.cxx2
-rw-r--r--setup_native/source/win32/customactions/tools/seterror.hxx2
-rw-r--r--setup_native/source/win32/stwrapper/stwrapper.cxx66
64 files changed, 1447 insertions, 1447 deletions
diff --git a/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
index 66acd508c281..3dc4a1118ba5 100644
--- a/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
+++ b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
@@ -27,8 +27,8 @@
<method_credential user="root" group="root" />
</method_context>
</exec_method>
-
-
+
+
<exec_method
type="method" name="stop"
exec="/lib/svc/method/svc-ooo_bundled_extensions stop"
@@ -37,17 +37,17 @@
<method_credential user="root" group="root" />
</method_context>
</exec_method>
-
+
<property_group name="startd" type="framework">
<propval name="duration" type="astring"
- value="transient" />
+ value="transient" />
<propval name="ignore_error"
type="astring" value="core,signal" />
-
- </property_group>
+
+ </property_group>
<stability value="Unstable" />
-
+
<template>
<common_name>
<loctext xml:lang="C">
diff --git a/setup_native/source/ulfconv/ulfconv.cxx b/setup_native/source/ulfconv/ulfconv.cxx
index bdcc98595f5c..201685cd7f9e 100644
--- a/setup_native/source/ulfconv/ulfconv.cxx
+++ b/setup_native/source/ulfconv/ulfconv.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -54,7 +54,7 @@ struct _pair {
static int _pair_compare (const char *key, const _pair *pair);
static const _pair* _pair_search (const char *key, const _pair *base, unsigned int member );
-
+
const _pair _ms_encoding_list[] = {
{ "0", RTL_TEXTENCODING_UTF8 },
{ "1250", RTL_TEXTENCODING_MS_1250 },
@@ -87,16 +87,16 @@ char * my_fgets(char *s, int n, FILE *fp)
if( c == EOF )
break;
-
+
s[i] = (char) c;
-
+
if( s[i] == '\n' )
{
i++;
break;
}
}
-
+
if( i>0 )
{
s[i] = '\0';
@@ -109,7 +109,7 @@ char * my_fgets(char *s, int n, FILE *fp)
}
/*****************************************************************************
- * compare function for binary search
+ * compare function for binary search
*****************************************************************************/
static int
@@ -157,7 +157,7 @@ _pair_search (const char *key, const _pair *base, unsigned int member )
* read_encoding_table
************************************************************************/
-void read_encoding_table(char * file, EncodingMap& aEncodingMap)
+void read_encoding_table(char * file, EncodingMap& aEncodingMap)
{
FILE * fp = fopen(file, "r");
if ( ! fp ) {
@@ -167,31 +167,31 @@ void read_encoding_table(char * file, EncodingMap& aEncodingMap)
char buffer[512];
while ( NULL != my_fgets(buffer, sizeof(buffer), fp) ) {
-
+
// strip comment lines
if ( buffer[0] == '#' )
continue;
-
+
// find end of language string
char * cp;
for ( cp = buffer; ! isspace(*cp); cp++ )
;
*cp = '\0';
-
+
// find start of codepage string
for ( ++cp; isspace(*cp); ++cp )
;
char * codepage = cp;
-
+
// find end of codepage string
for ( ++cp; ! isspace(*cp); ++cp )
;
*cp = '\0';
-
+
// find the correct mapping for codepage
const unsigned int members = sizeof( _ms_encoding_list ) / sizeof( _pair );
const _pair *encoding = _pair_search( codepage, _ms_encoding_list, members );
-
+
if ( encoding != NULL ) {
const std::string language(buffer);
aEncodingMap.insert( EncodingMap::value_type(language, encoding->value) );
@@ -214,7 +214,7 @@ void print_legacy_mixed(
EncodingMap::iterator iter = aEncodingMap.find(language);
if ( iter != aEncodingMap.end() ) {
- fputs(OUStringToOString(aString, iter->second).getStr(), ostream);
+ fputs(OUStringToOString(aString, iter->second).getStr(), ostream);
} else {
fprintf(stderr, "ulfconv: WARNING: no legacy encoding found for %s\n", language.c_str());
}
@@ -253,30 +253,30 @@ int main( int argc, char * const argv[] )
int errflg = 0;
int argi;
- for( argi=1; argi < argc; argi++ )
+ for( argi=1; argi < argc; argi++ )
{
if( argv[argi][0] == '-' && argv[argi][2] == '\0' )
{
switch(argv[argi][1]) {
- case 'o':
+ case 'o':
if (argi+1 >= argc || argv[argi+1][0] == '-')
{
fprintf(stderr, "Option -%c requires an operand\n", argv[argi][1]);
errflg++;
break;
}
-
+
++argi;
outfile = argv[argi];
break;
- case 't':
+ case 't':
if (argi+1 >= argc || argv[argi+1][0] == '-')
{
fprintf(stderr, "Option -%c requires an operand\n", argv[argi][1]);
errflg++;
break;
}
-
+
read_encoding_table(argv[++argi], aEncodingMap);
break;
default:
@@ -289,15 +289,15 @@ int main( int argc, char * const argv[] )
break;
}
}
-
+
if (errflg) {
fprintf(stderr, "Usage: ulfconv [-o <output file>] [-t <encoding table>] [<ulf file>]\n");
exit(2);
}
/* assign input file to stdin */
- if ( argi < argc )
- {
+ if ( argi < argc )
+ {
istream = fopen(argv[argi], "r");
if ( istream == NULL ) {
fprintf(stderr, "ulfconv: %s : %s\n", argv[argi], strerror(errno));
@@ -319,35 +319,35 @@ int main( int argc, char * const argv[] )
/* read line by line from stdin */
char buffer[65536];
while ( NULL != fgets(buffer, sizeof(buffer), istream) ) {
-
+
/* only handle lines containing " = " */
char * cp = strstr(buffer, " = \"");
if ( cp ) {
rtl::OUString aString;
-
+
/* find end of lang string */
int n;
for ( n=0; ! isspace(buffer[n]); n++ )
;
-
+
std::string line = buffer;
std::string lang(line, 0, n);
cp += 4;
- rtl_string2UString( &aString.pData, cp, strrchr(cp, '\"') - cp,
+ rtl_string2UString( &aString.pData, cp, strrchr(cp, '\"') - cp,
RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS );
-
+
fprintf(ostream, "%s = \"", lang.c_str());
-
+
if ( aEncodingMap.empty() ) {
print_java_style(ostream, aString);
} else {
print_legacy_mixed(ostream, aString, lang, aEncodingMap);
}
-
+
fprintf(ostream, "\"\n");
-
+
} else {
fputs(buffer, ostream);
}
diff --git a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx
index 0b030b956570..d92c4a3ac056 100644
--- a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx
+++ b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -26,15 +26,15 @@
*
************************************************************************/
-/*
- After installation of the OOo filter for the indexing service
- it is necessary to restart the indexing service in order to
+/*
+ After installation of the OOo filter for the indexing service
+ it is necessary to restart the indexing service in order to
activate the filter. This is the most reliable way to get the
indexing service working. We only restart the service if it is
already running. If we have insufficient privileges to restart
- the service we do nothing.
+ the service we do nothing.
*/
-
+
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#endif
@@ -64,70 +64,70 @@ QueryServiceStatus_t QueryServiceStatus_ = NULL;
StartService_t StartService_ = NULL;
const LPTSTR INDEXING_SERVICE_NAME = TEXT("cisvc");
-
+
bool StopIndexingService(SC_HANDLE hService)
{
- SERVICE_STATUS status;
-
+ SERVICE_STATUS status;
+
if (ControlService_(hService, SERVICE_CONTROL_STOP, &status))
- {
- // Check the status until the service is no longer stop pending.
- if (QueryServiceStatus_(hService, &status))
- {
+ {
+ // Check the status until the service is no longer stop pending.
+ if (QueryServiceStatus_(hService, &status))
+ {
DWORD startTime = GetTickCount();
DWORD oldCheckPoint = status.dwCheckPoint;
- while (status.dwCurrentState == SERVICE_STOP_PENDING)
- {
- // Do not wait longer than the wait hint. A good interval is
- // one tenth the wait hint, but no less than 1 second and no
- // more than 10 seconds.
+ while (status.dwCurrentState == SERVICE_STOP_PENDING)
+ {
+ // Do not wait longer than the wait hint. A good interval is
+ // one tenth the wait hint, but no less than 1 second and no
+ // more than 10 seconds.
DWORD waitTime = status.dwWaitHint / 10;
-
+
if (waitTime < 1000)
waitTime = 1000;
else if (waitTime > 10000)
waitTime = 10000;
-
+
Sleep(waitTime);
- // Check the status again.
+ // Check the status again.
if (!QueryServiceStatus_(hService, &status) ||
- (status.dwCurrentState == SERVICE_STOPPED))
+ (status.dwCurrentState == SERVICE_STOPPED))
break;
-
+
if (status.dwCheckPoint > oldCheckPoint)
- {
+ {
startTime = GetTickCount();
oldCheckPoint = status.dwCheckPoint;
}
else if ((GetTickCount() - startTime) > status.dwWaitHint)
- {
+ {
break; // service doesn't react anymore
- }
+ }
}
}
- }
- return (status.dwCurrentState == SERVICE_STOPPED);
+ }
+ return (status.dwCurrentState == SERVICE_STOPPED);
}
void StartIndexingService(SC_HANDLE hService)
-{
+{
if (StartService_(hService, 0, NULL))
- {
- SERVICE_STATUS status;
+ {
+ SERVICE_STATUS status;
- // Check the status until the service is no longer stop pending.
- if (QueryServiceStatus_(hService, &status))
- {
+ // Check the status until the service is no longer stop pending.
+ if (QueryServiceStatus_(hService, &status))
+ {
DWORD startTime = GetTickCount();
DWORD oldCheckPoint = status.dwCheckPoint;
- while (status.dwCurrentState == SERVICE_START_PENDING)
- {
- // Do not wait longer than the wait hint. A good interval is
- // one tenth the wait hint, but no less than 1 second and no
- // more than 10 seconds.
+ while (status.dwCurrentState == SERVICE_START_PENDING)
+ {
+ // Do not wait longer than the wait hint. A good interval is
+ // one tenth the wait hint, but no less than 1 second and no
+ // more than 10 seconds.
DWORD waitTime = status.dwWaitHint / 10;
if (waitTime < 1000)
@@ -137,13 +137,13 @@ void StartIndexingService(SC_HANDLE hService)
Sleep(waitTime);
- // Check the status again.
+ // Check the status again.
if (!QueryServiceStatus_(hService, &status) ||
- (status.dwCurrentState == SERVICE_STOPPED))
+ (status.dwCurrentState == SERVICE_STOPPED))
break;
-
+
if (status.dwCheckPoint > oldCheckPoint)
- {
+ {
startTime = GetTickCount();
oldCheckPoint = status.dwCheckPoint;
}
@@ -151,60 +151,60 @@ void StartIndexingService(SC_HANDLE hService)
{
// service doesn't react anymore
break;
- }
+ }
}
}
- }
+ }
}
extern "C" UINT __stdcall RestartIndexingService(MSIHANDLE)
{
//MessageBox(NULL, TEXT("Restarting Indexing Service"), TEXT("Message"), MB_OK | MB_ICONINFORMATION);
-
+
HMODULE hAdvapi32 = LoadLibrary("advapi32.dll");
if (hAdvapi32)
{
CloseServiceHandle_ = reinterpret_cast<CloseServiceHandle_t>(GetProcAddress(hAdvapi32, "CloseServiceHandle"));
- ControlService_ = reinterpret_cast<ControlService_t>(GetProcAddress(hAdvapi32, "ControlService"));
+ ControlService_ = reinterpret_cast<ControlService_t>(GetProcAddress(hAdvapi32, "ControlService"));
OpenSCManager_ = reinterpret_cast<OpenSCManager_t>(GetProcAddress(hAdvapi32, "OpenSCManagerA"));
- OpenService_ = reinterpret_cast<OpenService_t>(GetProcAddress(hAdvapi32, "OpenServiceA"));
+ OpenService_ = reinterpret_cast<OpenService_t>(GetProcAddress(hAdvapi32, "OpenServiceA"));
QueryServiceStatus_ = reinterpret_cast<QueryServiceStatus_t>(GetProcAddress(hAdvapi32, "QueryServiceStatus"));
- StartService_ = reinterpret_cast<StartService_t>(GetProcAddress(hAdvapi32, "StartServiceA"));
+ StartService_ = reinterpret_cast<StartService_t>(GetProcAddress(hAdvapi32, "StartServiceA"));
}
-
- /* On systems other than Windows 2000/XP the service API
- functions might not be available */
- if (!hAdvapi32 ||
+
+ /* On systems other than Windows 2000/XP the service API
+ functions might not be available */
+ if (!hAdvapi32 ||
!(CloseServiceHandle_ && ControlService_ && OpenSCManager_ && OpenService_ && QueryServiceStatus_ && StartService_))
return ERROR_SUCCESS;
-
- SC_HANDLE hSCManager = OpenSCManager_(
- NULL, // local machine
- NULL, // ServicesActive database
- SC_MANAGER_ALL_ACCESS);
-
- if (hSCManager != NULL)
- {
- SC_HANDLE hIndexingService = OpenService_(
- hSCManager, INDEXING_SERVICE_NAME, SERVICE_QUERY_STATUS | SERVICE_START | SERVICE_STOP);
-
+
+ SC_HANDLE hSCManager = OpenSCManager_(
+ NULL, // local machine
+ NULL, // ServicesActive database
+ SC_MANAGER_ALL_ACCESS);
+
+ if (hSCManager != NULL)
+ {
+ SC_HANDLE hIndexingService = OpenService_(
+ hSCManager, INDEXING_SERVICE_NAME, SERVICE_QUERY_STATUS | SERVICE_START | SERVICE_STOP);
+
if (hIndexingService)
{
- SERVICE_STATUS status;
+ SERVICE_STATUS status;
ZeroMemory(&status, sizeof(status));
-
- if (QueryServiceStatus_(hIndexingService, &status) &&
- (status.dwCurrentState == SERVICE_RUNNING))
- {
- if (StopIndexingService(hIndexingService))
- StartIndexingService(hIndexingService);
- }
- CloseServiceHandle_(hIndexingService);
- }
- CloseServiceHandle_(hSCManager);
- }
- return ERROR_SUCCESS;
+
+ if (QueryServiceStatus_(hIndexingService, &status) &&
+ (status.dwCurrentState == SERVICE_RUNNING))
+ {
+ if (StopIndexingService(hIndexingService))
+ StartIndexingService(hIndexingService);
+ }
+ CloseServiceHandle_(hIndexingService);
+ }
+ CloseServiceHandle_(hSCManager);
+ }
+ return ERROR_SUCCESS;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/javafilter/jfregca.cxx b/setup_native/source/win32/customactions/javafilter/jfregca.cxx
index 638ff1c9f8ae..0bfb73e01a33 100644
--- a/setup_native/source/win32/customactions/javafilter/jfregca.cxx
+++ b/setup_native/source/win32/customactions/javafilter/jfregca.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -51,23 +51,23 @@ bool isMulti(MSIHANDLE);
TCHAR *pxlData[8]= {
"{C6AB3E74-9F4F-4370-8120-A8A6FABB7A7C}", //CLSID 1 - key name at InstalledFilters Key
"{43887C67-4D5D-4127-BAAC-87A288494C7C}", //CLSID 2 - key value for Default Export
- ".pxl", //Registry key for device type - already there if ActiveSync installerd
- ".sxc", //New registry key for SO docs
- "InstalledFilters", //Sub-key of device/so doc key
- "DefaultImport", //Key name added at device/so level key
- "DefaultExport", //Key name added at device/so level key
- "Binary Copy", //Key value for DefaultImport
+ ".pxl", //Registry key for device type - already there if ActiveSync installerd
+ ".sxc", //New registry key for SO docs
+ "InstalledFilters", //Sub-key of device/so doc key
+ "DefaultImport", //Key name added at device/so level key
+ "DefaultExport", //Key name added at device/so level key
+ "Binary Copy", //Key value for DefaultImport
};
TCHAR *pswData[8] = {
"{BDD611C3-7BAB-460F-8711-5B9AC9EF6020}", //CLSID 1 - key name at InstalledFilters Key
"{CB43F086-838D-4FA4-B5F6-3406B9A57439}", //CLSID 2 - key value for Default Export
- ".psw", //Registry key for device type - already there if ActiveSync installe
- ".sxw", //New registry key for SO docs
- "InstalledFilters", //Sub-key of device/so doc key
- "DefaultImport", //Key name added at device/so level key
- "DefaultExport", //Key name added at device/so level key
- "Binary Copy", //Key value for DefaultImport
+ ".psw", //Registry key for device type - already there if ActiveSync installe
+ ".sxw", //New registry key for SO docs
+ "InstalledFilters", //Sub-key of device/so doc key
+ "DefaultImport", //Key name added at device/so level key
+ "DefaultExport", //Key name added at device/so level key
+ "Binary Copy", //Key value for DefaultImport
};
@@ -77,7 +77,7 @@ TCHAR *pswData[8] = {
#define DEVICE_PATH 2
#define SO_PATH 3
#define IF_PATH 4
-#define DEFIMPORT_KEY 5
+#define DEFIMPORT_KEY 5
#define DEFEXPORT_KEY 6
#define BC_VALUE 7
@@ -86,7 +86,7 @@ const int MAX_KEY_LENGTH=255;
const int MAX_VALUE_NAME=16383;
BOOL APIENTRY DllMain( HANDLE,
- DWORD ul_reason,
+ DWORD ul_reason,
LPVOID
)
{
@@ -106,8 +106,8 @@ extern "C" UINT install_jf ( MSIHANDLE hModule ) {
#ifdef _JRGREG_DEBUG
MessageBox(NULL, bMulti ? "Multi" : "Single", "Install", MB_OK);
#endif
- update_activesync_regvalues(bMulti, true, pxlData);
- update_activesync_regvalues(bMulti, true, pswData);
+ update_activesync_regvalues(bMulti, true, pxlData);
+ update_activesync_regvalues(bMulti, true, pswData);
return ERROR_SUCCESS;
}
@@ -117,8 +117,8 @@ extern "C" UINT uninstall_jf ( MSIHANDLE hModule ) {
#ifdef _JRGREG_DEBUG
MessageBox(NULL, bMulti ? "Multi" : "Single", "Uninstall", MB_OK);
#endif
- update_activesync_regvalues(false, bMulti, pxlData);
- update_activesync_regvalues(false, bMulti, pswData);
+ update_activesync_regvalues(false, bMulti, pxlData);
+ update_activesync_regvalues(false, bMulti, pswData);
return ERROR_SUCCESS;
}
@@ -127,9 +127,9 @@ extern "C" UINT uninstall_jf ( MSIHANDLE hModule ) {
Determines if this is being installed on a per user or a machine wide basis
@param hModule
[in] a valid msi handle.
-
-
- @returns
+
+
+ @returns
<TRUE/>if this is a multi-user install.
*/
bool isMulti( MSIHANDLE hModule ) {
@@ -166,9 +166,9 @@ bool isMulti( MSIHANDLE hModule ) {
@param data
[in] an array of string containing names of registry keys and values
-
-
- @returns
+
+
+ @returns
<TRUE/>if this is a multi-user install.
*/
@@ -182,7 +182,7 @@ bool update_activesync_regvalues(bool bMultiUser, bool bInstall, char **data) {
if (ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCSTR)MUKey, 0, KEY_ALL_ACCESS, &hKey)) {
return false;
}
- if (bInstall) {
+ if (bInstall) {
createKeys(hKey, data);
} else {
deleteKeys(hKey, data);
@@ -194,35 +194,35 @@ bool update_activesync_regvalues(bool bMultiUser, bool bInstall, char **data) {
}
CHAR achKey[MAX_KEY_LENGTH]; // buffer for subkey name
- DWORD cbName; // size of name string
- CHAR achClass[MAX_PATH] = ""; // buffer for class name
- DWORD cchClassName = MAX_PATH; // size of class string
- DWORD cSubKeys=0; // number of subkeys
- DWORD cbMaxSubKey; // longest subkey size
- DWORD cchMaxClass; // longest class string
- DWORD cValues; // number of values for key
- DWORD cchMaxValue; // longest value name
- DWORD cbMaxValueData; // longest value data
- DWORD cbSecurityDescriptor; // size of security descriptor
- FILETIME ftLastWriteTime; // last write time
-
- // Get the class name and the value count.
+ DWORD cbName; // size of name string
+ CHAR achClass[MAX_PATH] = ""; // buffer for class name
+ DWORD cchClassName = MAX_PATH; // size of class string
+ DWORD cSubKeys=0; // number of subkeys
+ DWORD cbMaxSubKey; // longest subkey size
+ DWORD cchMaxClass; // longest class string
+ DWORD cValues; // number of values for key
+ DWORD cchMaxValue; // longest value name
+ DWORD cbMaxValueData; // longest value data
+ DWORD cbSecurityDescriptor; // size of security descriptor
+ FILETIME ftLastWriteTime; // last write time
+
+ // Get the class name and the value count.
if (ERROR_SUCCESS == RegQueryInfoKey(
- hKey, // key handle
- achClass, // buffer for class name
- &cchClassName, // size of class string
- NULL, // reserved
- &cSubKeys, // number of subkeys
- &cbMaxSubKey, // longest subkey size
- &cchMaxClass, // longest class string
- &cValues, // number of values for this key
- &cchMaxValue, // longest value name
- &cbMaxValueData, // longest value data
- &cbSecurityDescriptor, // security descriptor
- &ftLastWriteTime)) { // last write time
+ hKey, // key handle
+ achClass, // buffer for class name
+ &cchClassName, // size of class string
+ NULL, // reserved
+ &cSubKeys, // number of subkeys
+ &cbMaxSubKey, // longest subkey size
+ &cchMaxClass, // longest class string
+ &cValues, // number of values for this key
+ &cchMaxValue, // longest value name
+ &cbMaxValueData, // longest value data
+ &cbSecurityDescriptor, // security descriptor
+ &ftLastWriteTime)) { // last write time
if (cSubKeys) {
- for (DWORD i=0; i<cSubKeys; i++) {
+ for (DWORD i=0; i<cSubKeys; i++) {
cbName = 1024;
if (ERROR_SUCCESS == RegEnumKeyEx(hKey,i,achKey,&cbName,NULL,NULL,NULL,&ftLastWriteTime)) {
HKEY subKey;
@@ -239,7 +239,7 @@ bool update_activesync_regvalues(bool bMultiUser, bool bInstall, char **data) {
}
}
}
-
+
bReturn = true;
}
}
@@ -279,13 +279,13 @@ void createKeys(HKEY hKey, char **data) {
}
}
- if (ERROR_SUCCESS == RegCreateKeyEx(hKey, soPath, 0, NULL,
+ if (ERROR_SUCCESS == RegCreateKeyEx(hKey, soPath, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &soKey, NULL)) {
RegSetValueEx(soKey, defExport, 0, REG_SZ, (LPBYTE)binaryCopy, strlen(binaryCopy));
RegSetValueEx(soKey, defImport, 0, REG_SZ, (LPBYTE)clsid2, strlen(clsid2));
-
- if (ERROR_SUCCESS == RegCreateKeyEx(soKey, IFPath, 0, NULL,
+
+ if (ERROR_SUCCESS == RegCreateKeyEx(soKey, IFPath, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &soIFKey, NULL)) {
RegSetValueEx(soIFKey, clsid2, 0, REG_SZ, NULL, NULL);
}
@@ -293,7 +293,7 @@ void createKeys(HKEY hKey, char **data) {
}
/**
- Delete registry keys
+ Delete registry keys
@param hKey
[in] Handle to the parent registry key
@@ -318,7 +318,7 @@ void deleteKeys(HKEY hKey, TCHAR **data) {
if (ERROR_SUCCESS == RegOpenKeyEx(hKey, soPath, 0, KEY_ALL_ACCESS, &soKey)) {
RegDeleteValue(soKey, defExport);
RegDeleteValue(soKey, defImport);
-
+
if (ERROR_SUCCESS == RegOpenKeyEx(soKey, IFPath, 0, KEY_ALL_ACCESS, &soIFKey)) {
RegDeleteValue(soIFKey, clsid2);
RegCloseKey(soIFKey);
diff --git a/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx b/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx
index 1bebed752e18..21188ab49f94 100644
--- a/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx
+++ b/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -56,14 +56,14 @@
#include <systools/win32/uwinapi.h>
#include <../tools/seterror.hxx>
-#define WININIT_FILENAME "wininit.ini"
-#define RENAME_SECTION "rename"
+#define WININIT_FILENAME "wininit.ini"
+#define RENAME_SECTION "rename"
#ifdef DEBUG
inline void OutputDebugStringFormat( LPCTSTR pFormat, ... )
{
- _TCHAR buffer[1024];
- va_list args;
+ _TCHAR buffer[1024];
+ va_list args;
va_start( args, pFormat );
_vsntprintf( buffer, SAL_N_ELEMENTS(buffer), pFormat, args );
@@ -77,9 +77,9 @@ static inline void OutputDebugStringFormat( LPCTSTR, ... )
static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -87,14 +87,14 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
-
+
static inline bool IsSetMsiProperty(MSIHANDLE handle, const std::_tstring& sProperty)
-{
+{
std::_tstring value = GetMsiProperty(handle, sProperty);
return (value.length() > 0);
}
@@ -111,30 +111,30 @@ static inline void SetMsiProperty(MSIHANDLE handle, const std::_tstring& sProper
static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWORD dwFlags )
{
- BOOL fSuccess = FALSE; // assume failure
+ BOOL fSuccess = FALSE; // assume failure
// Windows 9x has a special mechanism to move files after reboot
if ( dwFlags & MOVEFILE_DELAY_UNTIL_REBOOT )
{
- CHAR szExistingFileNameA[MAX_PATH];
- CHAR szNewFileNameA[MAX_PATH] = "NUL";
+ CHAR szExistingFileNameA[MAX_PATH];
+ CHAR szNewFileNameA[MAX_PATH] = "NUL";
// Path names in WININIT.INI must be in short path name form
- if (
+ if (
GetShortPathNameA( lpExistingFileNameA, szExistingFileNameA, MAX_PATH ) &&
(!lpNewFileNameA || GetShortPathNameA( lpNewFileNameA, szNewFileNameA, MAX_PATH ))
)
{
- CHAR szBuffer[32767]; // The buffer size must not exceed 32K
- DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME );
+ CHAR szBuffer[32767]; // The buffer size must not exceed 32K
+ DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME );
- CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters
+ CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters
strcpy( szRename, szNewFileNameA );
strcat( szRename, "=" );
strcat( szRename, szExistingFileNameA );
- size_t lnRename = strlen(szRename);
+ size_t lnRename = strlen(szRename);
if ( dwBufLen + lnRename + 2 <= SAL_N_ELEMENTS(szBuffer) )
{
@@ -156,7 +156,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO
if ( !fSuccess && GetLastError() != ERROR_ACCESS_DENIED &&
0 != (dwFlags & (MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING)) )
{
- BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
+ BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
fSuccess = CopyFileA( lpExistingFileNameA, lpNewFileNameA, bFailIfExist );
@@ -179,22 +179,22 @@ static BOOL MoveFileExImpl( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, D
extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
{
- std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
- std::_tstring sResourceDir = sInstDir + TEXT("Basis\\program\\resource\\");
- std::_tstring sPattern = sResourceDir + TEXT("vcl*.res");
+ std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
+ std::_tstring sResourceDir = sInstDir + TEXT("Basis\\program\\resource\\");
+ std::_tstring sPattern = sResourceDir + TEXT("vcl*.res");
- WIN32_FIND_DATA aFindFileData;
- HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
if ( IsValidHandle(hFind) )
{
- BOOL fSuccess = false;
- bool fRenameSucceeded;
+ BOOL fSuccess = false;
+ bool fRenameSucceeded;
do
{
- std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
- std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
+ std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
+ std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
fRenameSucceeded = MoveFileExImpl( sResourceFile.c_str(), sIntermediate.c_str(), MOVEFILE_REPLACE_EXISTING );
if ( fRenameSucceeded )
diff --git a/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx b/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx
index f6f6a4c0c3b9..fa5c3893eb8c 100644
--- a/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx
+++ b/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#endif
@@ -44,92 +44,92 @@
class RegistryKeyGuard
{
-public:
+public:
RegistryKeyGuard(HKEY hkey = 0) :
hkey_(hkey)
{
}
-
+
~RegistryKeyGuard()
{
if (hkey_)
RegCloseKey(hkey_);
- }
+ }
private:
HKEY hkey_;
private:
RegistryKeyGuard(const RegistryKeyGuard&);
- RegistryKeyGuard& operator=(const RegistryKeyGuard&);
+ RegistryKeyGuard& operator=(const RegistryKeyGuard&);
};
typedef std::vector<TCHAR> CharacterBuffer_t;
/* throws std::runtime_error when the value "Path" could
- not be found or contains an empty string or is not of
- type REG_SZ. All such conditions are invalid for a
+ not be found or contains an empty string or is not of
+ type REG_SZ. All such conditions are invalid for a
properly installed product. */
-std::string FindProductInstallationPath(HKEY hkey)
-{
+std::string FindProductInstallationPath(HKEY hkey)
+{
DWORD nSubKeys;
DWORD lLongestSubKey;
-
- if (RegQueryInfoKey(hkey, NULL, NULL, NULL, &nSubKeys, &lLongestSubKey, NULL, NULL, NULL, NULL, NULL, NULL) !=
+
+ if (RegQueryInfoKey(hkey, NULL, NULL, NULL, &nSubKeys, &lLongestSubKey, NULL, NULL, NULL, NULL, NULL, NULL) !=
ERROR_SUCCESS)
throw std::runtime_error("Cannot query info for registery key");
-
+
CharacterBuffer_t buff(lLongestSubKey + 1);
-
+
for (DWORD i = 0; i < nSubKeys; i++)
{
buff[0] = 0;
LONG ret = RegEnumKey(hkey, i, &buff[0], buff.size());
-
+
if ((ret != ERROR_SUCCESS) && (ret != ERROR_MORE_DATA))
throw std::runtime_error("Error enumerating registry key");
-
+
HKEY hSubKey;
- if (RegOpenKey(hkey, &buff[0], &hSubKey) != ERROR_SUCCESS)
- continue;
-
+ if (RegOpenKey(hkey, &buff[0], &hSubKey) != ERROR_SUCCESS)
+ continue;
+
RegistryKeyGuard guard(hSubKey);
-
+
DWORD type;
TCHAR pbuff[MAX_PATH];
DWORD size = sizeof(pbuff);
if ((RegQueryValueEx(
hSubKey, TEXT("Path"), NULL, &type, reinterpret_cast<LPBYTE>(pbuff), &size) != ERROR_SUCCESS) ||
- (type != REG_SZ))
+ (type != REG_SZ))
continue;
-
- std::string path(pbuff);
+
+ std::string path(pbuff);
std::string::size_type idx = path.rfind("program\\soffice.exe");
- if (idx != std::string::npos)
- return path.substr(0, idx);
- } // for
-
- throw std::runtime_error("No valid product path found");
+ if (idx != std::string::npos)
+ return path.substr(0, idx);
+ } // for
+
+ throw std::runtime_error("No valid product path found");
}
UINT GetInstallProperty(MSIHANDLE handle, LPCTSTR name, CharacterBuffer_t* buffer)
-{
+{
DWORD size = buffer->size();
UINT ret = MsiGetProperty(handle, name, &(*buffer)[0], &size);
-
+
if (ret == ERROR_MORE_DATA)
{
buffer->resize(size + 1);
size = buffer->size();
ret = MsiGetProperty(handle, name, &(*buffer)[0], &size);
- }
+ }
return ret;
}
-/*
+/*
Try to find the installation path to an already installed product.
The installation path will be written in the Windows registry
- during the installation. There may exist different products in
- parallel e.g. StarOffice, StarSuite, OpenOffice.org. It will be
+ during the installation. There may exist different products in
+ parallel e.g. StarOffice, StarSuite, OpenOffice.org. It will be
searched in this order for an installed product. If a product
will be found the path to the product will be set in the property
"INSTALLLOCATION" else nothing will be done.
@@ -137,37 +137,37 @@ UINT GetInstallProperty(MSIHANDLE handle, LPCTSTR name, CharacterBuffer_t* buffe
extern "C" UINT __stdcall SetProductInstallationPath(MSIHANDLE handle)
{
//MessageBox(NULL, TEXT("SetProductInstallationPath"), TEXT("Language Pack Installation Helper"), MB_OK | MB_ICONINFORMATION);
-
+
try
- {
- CharacterBuffer_t regKeyProdPath(MAX_PATH);
-
+ {
+ CharacterBuffer_t regKeyProdPath(MAX_PATH);
+
GetInstallProperty(handle, TEXT("REGKEYPRODPATH"), &regKeyProdPath);
-
+
HKEY hKey;
if ((RegOpenKey(HKEY_CURRENT_USER, &regKeyProdPath[0], &hKey) == ERROR_SUCCESS) ||
(RegOpenKey(HKEY_LOCAL_MACHINE, &regKeyProdPath[0], &hKey) == ERROR_SUCCESS))
- {
+ {
RegistryKeyGuard guard(hKey);
- std::string path = FindProductInstallationPath(hKey);
- MsiSetProperty(handle, TEXT("INSTALLLOCATION"), path.c_str());
- }
+ std::string path = FindProductInstallationPath(hKey);
+ MsiSetProperty(handle, TEXT("INSTALLLOCATION"), path.c_str());
+ }
}
catch(std::runtime_error& ex)
{
ex = ex; // no warnings
- }
- return ERROR_SUCCESS;
+ }
+ return ERROR_SUCCESS;
}
void MakeCfgimportCommandLine(CharacterBuffer_t* productPath)
-{
+{
char* p = &(*productPath)[0] + lstrlen(&(*productPath)[0]) - 1;
- if (*p != '\\')
- lstrcat(&(*productPath)[0], "\\program\\configimport.exe --spool");
+ if (*p != '\\')
+ lstrcat(&(*productPath)[0], "\\program\\configimport.exe --spool");
else
- lstrcat(&(*productPath)[0], "program\\configimport.exe --spool");
+ lstrcat(&(*productPath)[0], "program\\configimport.exe --spool");
}
/*
@@ -176,18 +176,18 @@ void MakeCfgimportCommandLine(CharacterBuffer_t* productPath)
extern "C" UINT __stdcall RegisterLanguagePack(MSIHANDLE handle)
{
//MessageBox(NULL, TEXT("RegisterLanguagePack"), TEXT("Language Pack Installation Helper"), MB_OK | MB_ICONINFORMATION);
-
- CharacterBuffer_t productPath(MAX_PATH);
- GetInstallProperty(handle, TEXT("INSTALLLOCATION"), &productPath);
- MakeCfgimportCommandLine(&productPath);
-
- STARTUPINFO si;
+
+ CharacterBuffer_t productPath(MAX_PATH);
+ GetInstallProperty(handle, TEXT("INSTALLLOCATION"), &productPath);
+ MakeCfgimportCommandLine(&productPath);
+
+ STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
-
+
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(pi));
-
+
if (CreateProcess(
NULL, &productPath[0], NULL, NULL,
FALSE, CREATE_NO_WINDOW | NORMAL_PRIORITY_CLASS, NULL,
@@ -196,11 +196,11 @@ extern "C" UINT __stdcall RegisterLanguagePack(MSIHANDLE handle)
// Wait until child process exits.
WaitForSingleObject(pi.hProcess, INFINITE);
- // Close process and thread handles.
+ // Close process and thread handles.
CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- }
- return ERROR_SUCCESS;
+ CloseHandle(pi.hThread);
+ }
+ return ERROR_SUCCESS;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/languagepacks/respintest.cxx b/setup_native/source/win32/customactions/languagepacks/respintest.cxx
index 5f979a81fa68..7c2c62ae1e20 100644
--- a/setup_native/source/win32/customactions/languagepacks/respintest.cxx
+++ b/setup_native/source/win32/customactions/languagepacks/respintest.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,7 +53,7 @@
using namespace std;
-namespace
+namespace
{
string GetMsiProperty(MSIHANDLE handle, const string& sProperty)
{
@@ -86,7 +86,7 @@ namespace
{
MsiSetProperty(handle, sProperty.c_str(), TEXT("1"));
}
-} // namespace
+} // namespace
extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
{
@@ -104,16 +104,16 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
// 1. Searching for "ProductCode" in setup.ini
string sSetupiniPath = sOfficeInstallPath + TEXT("program\\setup.ini");
-
+
TCHAR szValue[32767];
- GetPrivateProfileString(
- TEXT("Bootstrap"),
+ GetPrivateProfileString(
+ TEXT("Bootstrap"),
TEXT("ProductCode"),
TEXT("INVALIDDIRECTORY"),
szValue,
SAL_N_ELEMENTS(szValue),
- sSetupiniPath.c_str()
+ sSetupiniPath.c_str()
);
if ( !_tcsicmp( szValue, TEXT("INVALIDDIRECTORY") ) )
@@ -129,13 +129,13 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
szValue[0] = '\0';
- GetPrivateProfileString(
- TEXT("Bootstrap"),
+ GetPrivateProfileString(
+ TEXT("Bootstrap"),
TEXT("buildid"),
TEXT("ISWRONGPRODUCT"),
szValue,
SAL_N_ELEMENTS(szValue),
- sSetupiniPath.c_str()
+ sSetupiniPath.c_str()
);
if ( !_tcsicmp( szValue, TEXT("ISWRONGPRODUCT") ) )
@@ -156,7 +156,7 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
SetMsiProperty( handle, TEXT("ISWRONGPRODUCT"), TEXT("YES") );
// MessageBox(NULL, "ISWRONGPRODUCT 2 set after searching PRODUCTMAJOR", "DEBUG", MB_OK);
SetMsiErrorCode( MSI_ERROR_ISWRONGPRODUCT );
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
// 3. Only for patch: Comparing "PRODUCTMINOR from property table and "ProductMinor" from InfoFile
@@ -170,15 +170,15 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
szValue[0] = '\0';
- GetPrivateProfileString(
- TEXT("Bootstrap"),
+ GetPrivateProfileString(
+ TEXT("Bootstrap"),
TEXT("ProductBuildid"),
TEXT("8918"),
szValue,
SAL_N_ELEMENTS(szValue),
- sSetupiniPath.c_str()
+ sSetupiniPath.c_str()
);
-
+
int InstalledProductMinor = atoi(szValue);
if ( InstalledProductMinor >= PatchProductMinor )
@@ -186,7 +186,7 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
SetMsiProperty( handle, TEXT("PATCHISOLDER"), TEXT("YES") );
// MessageBox(NULL, "PATCHISOLDER set", "DEBUG", MB_OK);
SetMsiErrorCode( MSI_ERROR_PATCHISOLDER );
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
}
@@ -194,13 +194,13 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
szValue[0] = '\0';
- GetPrivateProfileString(
- TEXT("Bootstrap"),
+ GetPrivateProfileString(
+ TEXT("Bootstrap"),
TEXT("ALLUSERS"),
TEXT(""),
szValue,
SAL_N_ELEMENTS(szValue),
- sSetupiniPath.c_str()
+ sSetupiniPath.c_str()
);
if ( szValue[0] )
@@ -208,7 +208,7 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
SetMsiProperty( handle, TEXT("ALLUSERS"), szValue );
// MessageBox(NULL, "ALLUSERS set", "DEBUG", MB_OK);
}
-
+
return ERROR_SUCCESS;
}
diff --git a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx
index 2ef10553e239..d416f9dd0cfd 100644
--- a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx
+++ b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -56,14 +56,14 @@
#include <systools/win32/uwinapi.h>
#include <../tools/seterror.hxx>
-#define WININIT_FILENAME "wininit.ini"
-#define RENAME_SECTION "rename"
+#define WININIT_FILENAME "wininit.ini"
+#define RENAME_SECTION "rename"
#ifdef DEBUG
inline void OutputDebugStringFormat( LPCTSTR pFormat, ... )
{
- _TCHAR buffer[1024];
- va_list args;
+ _TCHAR buffer[1024];
+ va_list args;
va_start( args, pFormat );
_vsntprintf( buffer, SAL_N_ELEMENTS(buffer), pFormat, args );
@@ -77,9 +77,9 @@ static inline void OutputDebugStringFormat( LPCTSTR, ... )
static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -87,27 +87,27 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
// The provided GUID must be without surounding '{}'
static std::_tstring GetGuidPart(const std::_tstring& guid, int index)
{
- assert((guid.length() == 36) && "No GUID or wrong format!");
+ assert((guid.length() == 36) && "No GUID or wrong format!");
assert(((index > -1) && (index < 5)) && "Out of range!");
-
+
if (index == 0) return std::_tstring(guid.c_str(), 8);
if (index == 1) return std::_tstring(guid.c_str() + 9, 4);
if (index == 2) return std::_tstring(guid.c_str() + 14, 4);
if (index == 3) return std::_tstring(guid.c_str() + 19, 4);
if (index == 4) return std::_tstring(guid.c_str() + 24, 12);
-
+
return std::_tstring();
}
-
+
static void Swap(char* p1, char* p2)
{
char tmp = *p1;
@@ -119,51 +119,51 @@ static std::_tstring Invert(const std::_tstring& str)
{
char* buff = reinterpret_cast<char*>(_alloca(str.length()));
strncpy(buff, str.c_str(), str.length());
-
+
char* front = buff;
char* back = buff + str.length() - 1;
-
+
while (front < back)
Swap(front++, back--);
-
+
return std::_tstring(buff, str.length());
}
// Convert the upgrade code (which is a GUID) according
// to the way the windows installer does when writing it
// to the registry
-// The first 8 bytes will be inverted, from the the last
+// The first 8 bytes will be inverted, from the the last
// 8 bytes always the nibbles will be inverted for further
-// details look in the MSDN under compressed registry keys
+// details look in the MSDN under compressed registry keys
static std::_tstring ConvertGuid(const std::_tstring& guid)
{
std::_tstring convertedGuid;
-
+
std::_tstring part = GetGuidPart(guid, 0);
convertedGuid = Invert(part);
-
+
part = GetGuidPart(guid, 1);
convertedGuid += Invert(part);
-
+
part = GetGuidPart(guid, 2);
convertedGuid += Invert(part);
-
+
part = GetGuidPart(guid, 3);
convertedGuid += Invert(std::_tstring(part.c_str(), 2));
convertedGuid += Invert(std::_tstring(part.c_str() + 2, 2));
-
+
part = GetGuidPart(guid, 4);
int pos = 0;
for (int i = 0; i < 6; i++)
{
convertedGuid += Invert(std::_tstring(part.c_str() + pos, 2));
- pos += 2;
+ pos += 2;
}
return convertedGuid;
}
static inline bool IsSetMsiProperty(MSIHANDLE handle, const std::_tstring& sProperty)
-{
+{
std::_tstring value = GetMsiProperty(handle, sProperty);
return (value.length() > 0);
}
@@ -180,30 +180,30 @@ static inline void SetMsiProperty(MSIHANDLE handle, const std::_tstring& sProper
static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWORD dwFlags )
{
- BOOL fSuccess = FALSE; // assume failure
+ BOOL fSuccess = FALSE; // assume failure
// Windows 9x has a special mechanism to move files after reboot
if ( dwFlags & MOVEFILE_DELAY_UNTIL_REBOOT )
{
- CHAR szExistingFileNameA[MAX_PATH];
- CHAR szNewFileNameA[MAX_PATH] = "NUL";
+ CHAR szExistingFileNameA[MAX_PATH];
+ CHAR szNewFileNameA[MAX_PATH] = "NUL";
// Path names in WININIT.INI must be in short path name form
- if (
+ if (
GetShortPathNameA( lpExistingFileNameA, szExistingFileNameA, MAX_PATH ) &&
(!lpNewFileNameA || GetShortPathNameA( lpNewFileNameA, szNewFileNameA, MAX_PATH ))
)
{
- CHAR szBuffer[32767]; // The buffer size must not exceed 32K
- DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME );
+ CHAR szBuffer[32767]; // The buffer size must not exceed 32K
+ DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME );
- CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters
+ CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters
strcpy( szRename, szNewFileNameA );
strcat( szRename, "=" );
strcat( szRename, szExistingFileNameA );
- size_t lnRename = strlen(szRename);
+ size_t lnRename = strlen(szRename);
if ( dwBufLen + lnRename + 2 <= SAL_N_ELEMENTS(szBuffer) )
{
@@ -225,7 +225,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO
if ( !fSuccess && GetLastError() != ERROR_ACCESS_DENIED &&
0 != (dwFlags & (MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING)) )
{
- BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
+ BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
fSuccess = CopyFileA( lpExistingFileNameA, lpNewFileNameA, bFailIfExist );
@@ -248,15 +248,15 @@ static BOOL MoveFileExImpl( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, D
static bool SwapFiles( const std::_tstring& sFileName1, const std::_tstring& sFileName2 )
{
- std::_tstring sTempFileName = sFileName1 + TEXT(".tmp");
-
+ std::_tstring sTempFileName = sFileName1 + TEXT(".tmp");
+
bool fSuccess = true;
//Try to move the original file to a temp file
fSuccess = MoveFileExImpl( sFileName1.c_str(), sTempFileName.c_str(), MOVEFILE_REPLACE_EXISTING);
- std::_tstring mystr;
-
+ std::_tstring mystr;
+
if ( fSuccess )
{
fSuccess = MoveFileExImpl( sFileName2.c_str(), sFileName1.c_str(), MOVEFILE_REPLACE_EXISTING );
@@ -288,14 +288,14 @@ static bool SwapFiles( const std::_tstring& sFileName1, const std::_tstring& sFi
// if ( fSuccess )
// {
- // mystr = "Success";
- // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK );
+ // mystr = "Success";
+ // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK );
// }
// else
// {
- // char buff[256];
- // wsprintf(buff, "Failure %d", GetLastError());
- // MessageBox( NULL, buff, "Titel", MB_OK );
+ // char buff[256];
+ // wsprintf(buff, "Failure %d", GetLastError());
+ // MessageBox( NULL, buff, "Titel", MB_OK );
// }
}
else
@@ -305,14 +305,14 @@ static bool SwapFiles( const std::_tstring& sFileName1, const std::_tstring& sFi
}
OutputDebugStringFormat( TEXT("%s <-> %s: %s"), sFileName1.c_str(), sFileName2.c_str(), fSuccess ? TEXT("OK") : TEXT("FAILED") );
-
+
if (!fSuccess )
{
- DWORD dwError = GetLastError();
+ DWORD dwError = GetLastError();
LPVOID lpMsgBuf;
- if ( FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
+ if ( FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
@@ -334,10 +334,10 @@ static bool SwapFiles( const std::_tstring& sFileName1, const std::_tstring& sFi
static std::_tstring strip( const std::_tstring& s, _TCHAR c )
{
- std::_tstring result = s;
+ std::_tstring result = s;
std::_tstring::size_type f;
-
+
do
{
f = result.find( c );
@@ -351,89 +351,89 @@ static std::_tstring strip( const std::_tstring& s, _TCHAR c )
static std::_tstring trim( const std::_tstring& rString )
{
std::_tstring temp = rString;
-
+
while ( temp.length() && temp[0] == ' ' || temp[0] == '\t' )
temp.erase( 0, 1 );
-
- std::_tstring::size_type len = temp.length();
-
+
+ std::_tstring::size_type len = temp.length();
+
while ( len && temp[len-1] == ' ' || temp[len-1] == '\t' )
{
temp.erase( len - 1, 1 );
len = temp.length();
}
-
+
return temp;
}
static bool readLine( FILE *fp, std::_tstring& rLine )
{
_TCHAR szBuffer[1024];
- bool bSuccess = false;
- bool bEOL = false;
- std::_tstring line;
-
+ bool bSuccess = false;
+ bool bEOL = false;
+ std::_tstring line;
+
while ( !bEOL && _fgetts( szBuffer, sizeof(szBuffer), fp ) )
{
- int len = _tcslen(szBuffer);
-
+ int len = _tcslen(szBuffer);
+
bSuccess = true;
-
+
while ( len && szBuffer[len - 1] == '\n' )
{
szBuffer[--len] = 0;
bEOL = true;
}
-
+
line.append( szBuffer );
}
-
+
rLine = line;
return bSuccess;
}
-static std::_tstring getProfileString(
- const std::_tstring& aFileName,
- const std::_tstring& aSectionName,
- const std::_tstring& aKeyName,
+static std::_tstring getProfileString(
+ const std::_tstring& aFileName,
+ const std::_tstring& aSectionName,
+ const std::_tstring& aKeyName,
const std::_tstring& aDefault = _T("") )
{
- FILE *fp = _tfopen( aFileName.c_str(), _T("r") );
- std::_tstring retValue = aDefault.length() ? aDefault : _T("");
-
+ FILE *fp = _tfopen( aFileName.c_str(), _T("r") );
+ std::_tstring retValue = aDefault.length() ? aDefault : _T("");
+
if ( fp )
{
std::_tstring line;
std::_tstring section;
-
+
while ( readLine( fp, line ) )
{
line = trim( line );
-
+
if ( line.length() && line[0] == '[' )
{
line.erase( 0, 1 );
std::_tstring::size_type end = line.find( ']', 0 );
-
+
if ( std::_tstring::npos != end )
section = trim( line.substr( 0, end ) );
}
else
{
- std::_tstring::size_type iEqualSign = line.find( '=', 0 );
+ std::_tstring::size_type iEqualSign = line.find( '=', 0 );
if ( iEqualSign != std::_tstring::npos )
{
- std::_tstring keyname = line.substr( 0, iEqualSign );
+ std::_tstring keyname = line.substr( 0, iEqualSign );
keyname = trim( keyname );
-
- std::_tstring value = line.substr( iEqualSign + 1 /*, std::_tstring::npos */ );
+
+ std::_tstring value = line.substr( iEqualSign + 1 /*, std::_tstring::npos */ );
value = trim( value );
-
- if (
+
+ if (
0 == _tcsicmp( section.c_str(), aSectionName.c_str() ) &&
0 == _tcsicmp( keyname.c_str(), aKeyName.c_str() )
)
@@ -444,17 +444,17 @@ static std::_tstring getProfileString(
}
}
}
-
+
fclose( fp );
}
-
+
return retValue;
}
static std::queue< std::_tstring > getProfileSections( const std::_tstring& aFileName )
{
- FILE *fp = _tfopen( aFileName.c_str(), _T("r") );
- std::queue< std::_tstring > aResult;
+ FILE *fp = _tfopen( aFileName.c_str(), _T("r") );
+ std::queue< std::_tstring > aResult;
OutputDebugStringFormat( TEXT("*** Retrieving Section Names ****") );
@@ -462,16 +462,16 @@ static std::queue< std::_tstring > getProfileSections( const std::_tstring& aFil
{
std::_tstring line;
std::_tstring section;
-
+
while ( readLine( fp, line ) )
{
line = trim( line );
-
+
if ( line.length() && line[0] == '[' )
{
line.erase( 0, 1 );
std::_tstring::size_type end = line.find( ']', 0 );
-
+
if ( std::_tstring::npos != end )
section = trim( line.substr( 0, end ) );
@@ -481,10 +481,10 @@ static std::queue< std::_tstring > getProfileSections( const std::_tstring& aFil
}
}
-
+
fclose( fp );
}
-
+
OutputDebugStringFormat( TEXT("*** Done Section Names ***") );
return aResult;
@@ -492,8 +492,8 @@ static std::queue< std::_tstring > getProfileSections( const std::_tstring& aFil
static std::queue< std::_tstring > getProfileKeys( const std::_tstring& aFileName, const std::_tstring& aSectionName )
{
- FILE *fp = _tfopen( aFileName.c_str(), _T("r") );
- std::queue< std::_tstring > aResult;
+ FILE *fp = _tfopen( aFileName.c_str(), _T("r") );
+ std::queue< std::_tstring > aResult;
OutputDebugStringFormat( TEXT("*** Retrieving Key Names for [%s] ***"), aSectionName.c_str() );
@@ -501,27 +501,27 @@ static std::queue< std::_tstring > getProfileKeys( const std::_tstring& aFileNam
{
std::_tstring line;
std::_tstring section;
-
+
while ( readLine( fp, line ) )
{
line = trim( line );
-
+
if ( line.length() && line[0] == '[' )
{
line.erase( 0, 1 );
std::_tstring::size_type end = line.find( ']', 0 );
-
+
if ( std::_tstring::npos != end )
section = trim( line.substr( 0, end ) );
}
else
{
- std::_tstring::size_type iEqualSign = line.find( '=', 0 );
+ std::_tstring::size_type iEqualSign = line.find( '=', 0 );
if ( iEqualSign != std::_tstring::npos )
{
- std::_tstring keyname = line.substr( 0, iEqualSign );
+ std::_tstring keyname = line.substr( 0, iEqualSign );
keyname = trim( keyname );
if ( 0 == _tcsicmp( section.c_str(), aSectionName.c_str() ) )
@@ -534,7 +534,7 @@ static std::queue< std::_tstring > getProfileKeys( const std::_tstring& aFileNam
}
}
}
-
+
fclose( fp );
}
@@ -545,23 +545,23 @@ static std::queue< std::_tstring > getProfileKeys( const std::_tstring& aFileNam
extern "C" UINT __stdcall InstallPatchedFiles( MSIHANDLE handle )
{
- std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
- std::_tstring sProgramDir = sInstDir + TEXT("Basis\\program\\");
- std::_tstring sPatchFile = sProgramDir + TEXT("patchlist.txt");
+ std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
+ std::_tstring sProgramDir = sInstDir + TEXT("Basis\\program\\");
+ std::_tstring sPatchFile = sProgramDir + TEXT("patchlist.txt");
std::queue< std::_tstring > aSectionNames;
std::queue< std::_tstring > aKeyNames;
OutputDebugStringA( "Starting Custom Action" );
- // std::_tstring mystr;
+ // std::_tstring mystr;
// mystr = "Patchfile: " + sPatchFile;
// MessageBox( NULL, mystr.c_str(), "Patchfile", MB_OK );
aSectionNames = getProfileSections( sPatchFile );
while ( !aSectionNames.empty() )
{
- std::_tstring sSectionName = aSectionNames.front();
+ std::_tstring sSectionName = aSectionNames.front();
if ( std::_tstring(TEXT("_root")) == sSectionName ) { sSectionName = TEXT(""); }
// mystr = "Section: " + sSectionName;
// MessageBox( NULL, mystr.c_str(), "Titel", MB_OK );
@@ -569,14 +569,14 @@ extern "C" UINT __stdcall InstallPatchedFiles( MSIHANDLE handle )
aKeyNames = getProfileKeys( sPatchFile, sSectionName );
while ( !aKeyNames.empty() )
{
- std::_tstring sKeyName = aKeyNames.front();
- std::_tstring sValue = getProfileString( sPatchFile, sSectionName, sKeyName );
+ std::_tstring sKeyName = aKeyNames.front();
+ std::_tstring sValue = getProfileString( sPatchFile, sSectionName, sKeyName );
if ( sValue.length() )
{
- std::_tstring sFileName1 = sKeyName;
- std::_tstring sExtension = sValue;
- std::_tstring sFileName2;
+ std::_tstring sFileName1 = sKeyName;
+ std::_tstring sExtension = sValue;
+ std::_tstring sFileName2;
sFileName1 = strip( sFileName1, '\"' );
sExtension = strip( sExtension, '\"' );
@@ -592,7 +592,7 @@ extern "C" UINT __stdcall InstallPatchedFiles( MSIHANDLE handle )
aKeyNames.pop();
}
-
+
aSectionNames.pop();
}
@@ -601,13 +601,13 @@ extern "C" UINT __stdcall InstallPatchedFiles( MSIHANDLE handle )
extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
{
- TCHAR szValue[8192];
- DWORD nValueSize = sizeof(szValue);
- HKEY hKey;
-
- std::_tstring sInstDir;
-
- std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
+ TCHAR szValue[8192];
+ DWORD nValueSize = sizeof(szValue);
+ HKEY hKey;
+
+ std::_tstring sInstDir;
+
+ std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
{
@@ -628,20 +628,20 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
else
return ERROR_SUCCESS;
- std::_tstring sProgramDir = sInstDir + TEXT("Basis\\program\\");
- std::_tstring sPatchFile = sProgramDir + TEXT("patchlist.txt");
+ std::_tstring sProgramDir = sInstDir + TEXT("Basis\\program\\");
+ std::_tstring sPatchFile = sProgramDir + TEXT("patchlist.txt");
- std::queue< std::_tstring > aSectionNames;
- std::queue< std::_tstring > aKeyNames;
+ std::queue< std::_tstring > aSectionNames;
+ std::queue< std::_tstring > aKeyNames;
- // std::_tstring mystr;
+ // std::_tstring mystr;
// mystr = "Patchfile: " + sPatchFile;
// MessageBox( NULL, mystr.c_str(), "Titel", MB_OK );
aSectionNames = getProfileSections( sPatchFile );
while ( !aSectionNames.empty() )
- {
- std::_tstring sSectionName = aSectionNames.front();
+ {
+ std::_tstring sSectionName = aSectionNames.front();
if ( std::_tstring(TEXT("_root")) == sSectionName ) { sSectionName = TEXT(""); }
// mystr = "Section: " + sSectionName;
// MessageBox( NULL, mystr.c_str(), "Titel", MB_OK );
@@ -649,14 +649,14 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
aKeyNames = getProfileKeys( sPatchFile, sSectionName );
while( !aKeyNames.empty() )
{
- std::_tstring sKeyName = aKeyNames.front();
- std::_tstring sValue = getProfileString( sPatchFile, sSectionName, sKeyName );
+ std::_tstring sKeyName = aKeyNames.front();
+ std::_tstring sValue = getProfileString( sPatchFile, sSectionName, sKeyName );
if ( sValue.length() )
{
- std::_tstring sFileName1 = sKeyName;
- std::_tstring sExtension = sValue;
- std::_tstring sFileName2;
+ std::_tstring sFileName1 = sKeyName;
+ std::_tstring sExtension = sValue;
+ std::_tstring sFileName2;
sFileName1 = strip( sFileName1, '\"' );
sExtension = strip( sExtension, '\"' );
@@ -672,7 +672,7 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
aKeyNames.pop();
}
-
+
aSectionNames.pop();
}
@@ -681,22 +681,22 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
{
- std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
- std::_tstring sResourceDir = sInstDir + TEXT("Basis\\program\\resource\\");
- std::_tstring sPattern = sResourceDir + TEXT("vcl*.res");
+ std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
+ std::_tstring sResourceDir = sInstDir + TEXT("Basis\\program\\resource\\");
+ std::_tstring sPattern = sResourceDir + TEXT("vcl*.res");
- WIN32_FIND_DATA aFindFileData;
- HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
if ( IsValidHandle(hFind) )
{
- BOOL fSuccess = false;
- bool fRenameSucceeded;
+ BOOL fSuccess = false;
+ bool fRenameSucceeded;
do
{
- std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
- std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
+ std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
+ std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
fRenameSucceeded = MoveFileExImpl( sResourceFile.c_str(), sIntermediate.c_str(), MOVEFILE_REPLACE_EXISTING );
if ( fRenameSucceeded )
@@ -721,7 +721,7 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle )
{
- std::_tstring mystr;
+ std::_tstring mystr;
// 1. Reading Product Code from setup.ini of installed Office
@@ -731,13 +731,13 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle )
TCHAR szProductCode[32767];
- GetPrivateProfileString(
- TEXT("Bootstrap"),
+ GetPrivateProfileString(
+ TEXT("Bootstrap"),
TEXT("ProductCode"),
TEXT("NOTFOUND"),
szProductCode,
SAL_N_ELEMENTS(szProductCode),
- sSetupiniPath.c_str()
+ sSetupiniPath.c_str()
);
if ( !_tcsicmp( szProductCode, TEXT("NOTFOUND") ) )
@@ -748,7 +748,7 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle )
}
// 2. Converting Product code
-
+
std::_tstring productCode = TEXT(szProductCode);
productCode = ConvertGuid(std::_tstring(productCode.c_str() + 1, productCode.length() - 2));
mystr = TEXT("Changed product code: ") + productCode;
@@ -782,7 +782,7 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle )
int counter = 0;
// DWORD counter = 0;
LONG lEnumResult;
-
+
do
{
TCHAR szValueName[8192];
@@ -792,7 +792,7 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle )
DWORD nValueDataSize = sizeof(szValueData);
lEnumResult = RegEnumValue( hKey, counter, szValueName, pValueNameSize, NULL, NULL, (LPBYTE)szValueData, &nValueDataSize);
-
+
if ( ERROR_SUCCESS == lEnumResult )
{
std::_tstring sValueName = szValueName;
@@ -811,21 +811,21 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle )
{
MsiSetFeatureState(handle,sValueName.c_str(),INSTALLSTATE_ABSENT); // do not install this feature
// mystr = TEXT("Do NOT install: ") + sValueName;
- // MessageBox( NULL, mystr.c_str(), "ValueName", MB_OK );
+ // MessageBox( NULL, mystr.c_str(), "ValueName", MB_OK );
}
else
{
MsiSetFeatureState(handle,sValueName.c_str(),INSTALLSTATE_LOCAL); // do install this feature
// mystr = TEXT("Do install: ") + sValueName;
- // MessageBox( NULL, mystr.c_str(), "ValueName", MB_OK );
- }
+ // MessageBox( NULL, mystr.c_str(), "ValueName", MB_OK );
+ }
}
}
counter = counter + 1;
-
+
} while ( ERROR_SUCCESS == lEnumResult );
-
+
RegCloseKey( hKey );
}
@@ -851,7 +851,7 @@ extern "C" UINT __stdcall SetNewFeatureState( MSIHANDLE handle )
// mystr = TEXT("OnlineUpdate wird NICHT installiert!");
// MessageBox(NULL, mystr.c_str(), "INSTALLSTATE_ABSENT", MB_OK);
}
-
+
return ERROR_SUCCESS;
}
@@ -878,7 +878,7 @@ extern "C" UINT __stdcall ShowOnlineUpdateDialog( MSIHANDLE handle )
UnsetMsiProperty(handle, TEXT("SHOW_ONLINEUPDATE_DIALOG"));
// Setting SELECT_OU_FEATURE to 1, which is probably superfluous
- // because this is already the default value. But only this
+ // because this is already the default value. But only this
// guarantees, that CustomAction SetNewFeatureState always sets
// the correct FeatureState for "gm_o_Onlineupdate", if it is
// already installed.
diff --git a/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx b/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx
index fbb4982a96f4..396b293d95f1 100644
--- a/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx
+++ b/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx
@@ -15,7 +15,7 @@ std::string GetOfficeInstallationPath(MSIHANDLE handle)
std::string progpath;
DWORD sz = 0;
LPTSTR dummy = TEXT("");
-
+
if (MsiGetProperty(handle, TEXT("INSTALLLOCATION"), dummy, &sz) == ERROR_MORE_DATA)
{
sz++; // space for the final '\0'
@@ -23,7 +23,7 @@ std::string GetOfficeInstallationPath(MSIHANDLE handle)
LPTSTR buff = reinterpret_cast<LPTSTR>(_alloca(nbytes));
ZeroMemory(buff, nbytes);
MsiGetProperty(handle, TEXT("INSTALLLOCATION"), buff, &sz);
- progpath = buff;
+ progpath = buff;
}
return progpath;
}
@@ -33,7 +33,7 @@ std::string GetOfficeProductName(MSIHANDLE handle)
std::string productname;
DWORD sz = 0;
LPTSTR dummy = TEXT("");
-
+
if (MsiGetProperty(handle, TEXT("ProductName"), dummy, &sz) == ERROR_MORE_DATA)
{
sz++; // space for the final '\0'
@@ -41,7 +41,7 @@ std::string GetOfficeProductName(MSIHANDLE handle)
LPTSTR buff = reinterpret_cast<LPTSTR>(_alloca(nbytes));
ZeroMemory(buff, nbytes);
MsiGetProperty(handle, TEXT("ProductName"), buff, &sz);
- productname = buff;
+ productname = buff;
}
return productname;
}
@@ -51,7 +51,7 @@ std::string GetQuickstarterLinkName(MSIHANDLE handle)
std::string quickstarterlinkname;
DWORD sz = 0;
LPTSTR dummy = TEXT("");
-
+
if (MsiGetProperty(handle, TEXT("Quickstarterlinkname"), dummy, &sz) == ERROR_MORE_DATA)
{
sz++; // space for the final '\0'
@@ -59,7 +59,7 @@ std::string GetQuickstarterLinkName(MSIHANDLE handle)
LPTSTR buff = reinterpret_cast<LPTSTR>(_alloca(nbytes));
ZeroMemory(buff, nbytes);
MsiGetProperty(handle, TEXT("Quickstarterlinkname"), buff, &sz);
- quickstarterlinkname = buff;
+ quickstarterlinkname = buff;
}
else if (MsiGetProperty(handle, TEXT("ProductName"), dummy, &sz) == ERROR_MORE_DATA)
{
@@ -68,7 +68,7 @@ std::string GetQuickstarterLinkName(MSIHANDLE handle)
LPTSTR buff = reinterpret_cast<LPTSTR>(_alloca(nbytes));
ZeroMemory(buff, nbytes);
MsiGetProperty(handle, TEXT("ProductName"), buff, &sz);
- quickstarterlinkname = buff;
+ quickstarterlinkname = buff;
}
return quickstarterlinkname;
}
@@ -82,13 +82,13 @@ inline bool IsValidHandle( HANDLE handle )
static HANDLE WINAPI _CreateToolhelp32Snapshot( DWORD dwFlags, DWORD th32ProcessID )
{
typedef HANDLE (WINAPI *FN_PROC)( DWORD dwFlags, DWORD th32ProcessID );
- static FN_PROC lpProc = NULL;
+ static FN_PROC lpProc = NULL;
- HANDLE hSnapshot = NULL;
+ HANDLE hSnapshot = NULL;
if ( !lpProc )
{
- HMODULE hLibrary = GetModuleHandle("KERNEL32.DLL");
+ HMODULE hLibrary = GetModuleHandle("KERNEL32.DLL");
if ( hLibrary )
lpProc = reinterpret_cast< FN_PROC >(GetProcAddress( hLibrary, "CreateToolhelp32Snapshot" ));
@@ -103,13 +103,13 @@ static HANDLE WINAPI _CreateToolhelp32Snapshot( DWORD dwFlags, DWORD th32Process
static BOOL WINAPI _Process32First( HANDLE hSnapshot, PROCESSENTRY32 *lppe32 )
{
typedef BOOL (WINAPI *FN_PROC)( HANDLE hSnapshot, PROCESSENTRY32 *lppe32 );
- static FN_PROC lpProc = NULL;
+ static FN_PROC lpProc = NULL;
- BOOL fSuccess = FALSE;
+ BOOL fSuccess = FALSE;
if ( !lpProc )
{
- HMODULE hLibrary = GetModuleHandle("KERNEL32.DLL");
+ HMODULE hLibrary = GetModuleHandle("KERNEL32.DLL");
if ( hLibrary )
lpProc = reinterpret_cast< FN_PROC >(GetProcAddress( hLibrary, "Process32First" ));
@@ -124,13 +124,13 @@ static BOOL WINAPI _Process32First( HANDLE hSnapshot, PROCESSENTRY32 *lppe32 )
static BOOL WINAPI _Process32Next( HANDLE hSnapshot, PROCESSENTRY32 *lppe32 )
{
typedef BOOL (WINAPI *FN_PROC)( HANDLE hSnapshot, PROCESSENTRY32 *lppe32 );
- static FN_PROC lpProc = NULL;
+ static FN_PROC lpProc = NULL;
- BOOL fSuccess = FALSE;
+ BOOL fSuccess = FALSE;
if ( !lpProc )
{
- HMODULE hLibrary = GetModuleHandle("KERNEL32.DLL");
+ HMODULE hLibrary = GetModuleHandle("KERNEL32.DLL");
if ( hLibrary )
lpProc = reinterpret_cast< FN_PROC >(GetProcAddress( hLibrary, "Process32Next" ));
@@ -144,18 +144,18 @@ static BOOL WINAPI _Process32Next( HANDLE hSnapshot, PROCESSENTRY32 *lppe32 )
static std::string GetProcessImagePath_9x( DWORD dwProcessId )
{
- std::string sImagePath;
+ std::string sImagePath;
- HANDLE hSnapshot = _CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
+ HANDLE hSnapshot = _CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if ( IsValidHandle( hSnapshot ) )
{
- PROCESSENTRY32 pe32 = { 0 };
+ PROCESSENTRY32 pe32 = { 0 };
pe32.dwSize = sizeof(PROCESSENTRY32);
- BOOL fSuccess = _Process32First( hSnapshot, &pe32 );
- bool found = false;
+ BOOL fSuccess = _Process32First( hSnapshot, &pe32 );
+ bool found = false;
while ( !found && fSuccess )
{
@@ -179,11 +179,11 @@ static DWORD WINAPI _GetModuleFileNameExA( HANDLE hProcess, HMODULE hModule, LPS
{
typedef DWORD (WINAPI *FN_PROC)( HANDLE hProcess, HMODULE hModule, LPSTR lpFileName, DWORD nSize );
- static FN_PROC lpProc = NULL;
+ static FN_PROC lpProc = NULL;
if ( !lpProc )
{
- HMODULE hLibrary = LoadLibrary("PSAPI.DLL");
+ HMODULE hLibrary = LoadLibrary("PSAPI.DLL");
if ( hLibrary )
lpProc = reinterpret_cast< FN_PROC >(GetProcAddress( hLibrary, "GetModuleFileNameExA" ));
@@ -198,13 +198,13 @@ static DWORD WINAPI _GetModuleFileNameExA( HANDLE hProcess, HMODULE hModule, LPS
static std::string GetProcessImagePath_NT( DWORD dwProcessId )
{
- std::string sImagePath;
+ std::string sImagePath;
- HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId );
+ HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId );
if ( IsValidHandle( hProcess ) )
{
- CHAR szPathBuffer[MAX_PATH] = "";
+ CHAR szPathBuffer[MAX_PATH] = "";
if ( _GetModuleFileNameExA( hProcess, NULL, szPathBuffer, sizeof(szPathBuffer) ) )
sImagePath = szPathBuffer;
diff --git a/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx b/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx
index 1d1b3c61d67a..d61309c98762 100644
--- a/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx
+++ b/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -44,7 +44,7 @@
extern "C" UINT __stdcall RemoveQuickstarterLink( MSIHANDLE hMSI )
{
- CHAR szStartupPath[MAX_PATH];
+ CHAR szStartupPath[MAX_PATH];
if ( SHGetSpecialFolderPathA( NULL, szStartupPath, CSIDL_STARTUP, FALSE ) )
{
diff --git a/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx b/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx
index 86e9585044ae..d1d7794ad35f 100644
--- a/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx
+++ b/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -31,29 +31,29 @@
static BOOL CALLBACK EnumWindowsProc( HWND hWnd, LPARAM lParam )
{
- MSIHANDLE hMSI = static_cast< MSIHANDLE >( lParam );
- CHAR szClassName[sizeof(QUICKSTART_CLASSNAMEA) + 1];
+ MSIHANDLE hMSI = static_cast< MSIHANDLE >( lParam );
+ CHAR szClassName[sizeof(QUICKSTART_CLASSNAMEA) + 1];
- int nCharsCopied = GetClassName( hWnd, szClassName, sizeof( szClassName ) );
+ int nCharsCopied = GetClassName( hWnd, szClassName, sizeof( szClassName ) );
if ( nCharsCopied && !stricmp( QUICKSTART_CLASSNAMEA, szClassName ) )
{
- DWORD dwProcessId;
+ DWORD dwProcessId;
if ( GetWindowThreadProcessId( hWnd, &dwProcessId ) )
{
- std::string sImagePath = GetProcessImagePath( dwProcessId );
- std::string sOfficeImageDir = GetOfficeInstallationPath( hMSI ) + "program\\";
+ std::string sImagePath = GetProcessImagePath( dwProcessId );
+ std::string sOfficeImageDir = GetOfficeInstallationPath( hMSI ) + "program\\";
if ( !strnicmp( sImagePath.c_str(), sOfficeImageDir.c_str(), sOfficeImageDir.length() ) )
{
- UINT uMsgShutdownQuickstart = RegisterWindowMessageA( SHUTDOWN_QUICKSTART_MESSAGEA );
+ UINT uMsgShutdownQuickstart = RegisterWindowMessageA( SHUTDOWN_QUICKSTART_MESSAGEA );
if ( uMsgShutdownQuickstart )
SendMessageA( hWnd, uMsgShutdownQuickstart, 0, 0 );
+
-
- HANDLE hProcess = OpenProcess( SYNCHRONIZE, FALSE, dwProcessId );
+ HANDLE hProcess = OpenProcess( SYNCHRONIZE, FALSE, dwProcessId );
if ( hProcess )
{
@@ -66,7 +66,7 @@ static BOOL CALLBACK EnumWindowsProc( HWND hWnd, LPARAM lParam )
}
}
-
+
return TRUE;
}
diff --git a/setup_native/source/win32/customactions/rebase/rebase.cxx b/setup_native/source/win32/customactions/rebase/rebase.cxx
index 1eb3fedbf2f0..deece215afa2 100644
--- a/setup_native/source/win32/customactions/rebase/rebase.cxx
+++ b/setup_native/source/win32/customactions/rebase/rebase.cxx
@@ -47,8 +47,8 @@ static bool IsValidHandle( HANDLE handle )
static std::string GetMsiProperty(MSIHANDLE handle, const std::string& sProperty)
{
std::string result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if (MsiGetProperty(handle, sProperty.c_str(), szDummy, &nChars) == ERROR_MORE_DATA)
{
@@ -67,7 +67,7 @@ static BOOL rebaseImage( const std::string& filePath, LPVOID address )
ULONG_PTR lpOldImageBase;
ULONG ulNewImageSize;
ULONG_PTR lpNewImageBase = reinterpret_cast<ULONG_PTR>(address);
-
+
BOOL bResult = ReBaseImage(
(PSTR)filePath.c_str(),
(PSTR)"",
@@ -80,17 +80,17 @@ static BOOL rebaseImage( const std::string& filePath, LPVOID address )
&ulNewImageSize,
&lpNewImageBase,
(ULONG)time(NULL) );
-
+
return bResult;
}
static BOOL rebaseImage( MSIHANDLE /*handle*/, const std::string& sFilePath, LPVOID address )
{
- std::string mystr;
+ std::string mystr;
mystr = "Full file: " + sFilePath;
BOOL bResult = rebaseImage( sFilePath, address );
-
+
if ( !bResult )
{
OutputDebugStringFormat( "Rebasing library %s failed", mystr.c_str() );
@@ -102,10 +102,10 @@ static BOOL rebaseImage( MSIHANDLE /*handle*/, const std::string& sFilePath, LPV
static BOOL rebaseImagesInFolder( MSIHANDLE handle, const std::string& sPath, LPVOID address )
{
std::string sDir = sPath;
- std::string sPattern = sPath + TEXT("*.dll");
+ std::string sPattern = sPath + TEXT("*.dll");
- WIN32_FIND_DATA aFindFileData;
- HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
if ( IsValidHandle(hFind) )
{
@@ -113,7 +113,7 @@ static BOOL rebaseImagesInFolder( MSIHANDLE handle, const std::string& sPath, LP
do
{
- std::string sLibFile = sDir + aFindFileData.cFileName;
+ std::string sLibFile = sDir + aFindFileData.cFileName;
rebaseImage( handle, sLibFile, address );
fSuccess = FindNextFile( hFind, &aFindFileData );
}
@@ -128,15 +128,15 @@ static BOOL rebaseImagesInFolder( MSIHANDLE handle, const std::string& sPath, LP
static BOOL rebaseImages( MSIHANDLE handle, LPVOID pAddress )
{
std::string sInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
-
+
std::string sBasisDir = sInstallPath + TEXT("Basis\\program\\");
std::string sOfficeDir = sInstallPath + TEXT("program\\");
std::string sUreDir = sInstallPath + TEXT("URE\\bin\\");
-
+
BOOL bResult = rebaseImagesInFolder( handle, sBasisDir, pAddress );
bResult &= rebaseImagesInFolder( handle, sOfficeDir, pAddress );
bResult &= rebaseImagesInFolder( handle, sUreDir, pAddress );
-
+
return bResult;
}
@@ -155,11 +155,11 @@ static BOOL IsServerSystem( MSIHANDLE /*handle*/ )
extern "C" BOOL __stdcall RebaseLibrariesOnProperties( MSIHANDLE handle )
{
static LPVOID pDefault = reinterpret_cast<LPVOID>(0x10000000);
-
+
std::string sDontOptimizeLibs = GetMsiProperty(handle, TEXT("DONTOPTIMIZELIBS"));
if ( sDontOptimizeLibs.length() > 0 && sDontOptimizeLibs == "1" )
return TRUE;
-
+
if ( !IsServerSystem( handle ))
return rebaseImages( handle, pDefault );
diff --git a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx
index 54a471acf095..4ce7faaec029 100644
--- a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx
+++ b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#endif
-#define WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <msiquery.h>
#ifdef _MSC_VER
@@ -144,7 +144,7 @@ static LONG DeleteSubKeyTree( HKEY RootKey, LPCSTR lpKey )
LONG rc = RegOpenKeyExA( RootKey, lpKey, 0, KEY_READ | DELETE, &hKey );
if (ERROR_SUCCESS == rc)
- {
+ {
LPCSTR lpSubKey;
DWORD nMaxSubKeyLen;
@@ -248,7 +248,7 @@ bool GetMsiProp( MSIHANDLE handle, LPCSTR name, /*out*/std::string& value )
MsiGetPropertyA(handle, name, buff, &sz);
value = buff;
return true;
- }
+ }
return false;
}
@@ -458,7 +458,7 @@ extern "C" UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle )
}
OutputDebugStringFormat( "FindRegisteredExtensions:" );
-
+
bool bRegisterAll = IsSetMsiProp( handle, "REGISTER_ALL_MSO_TYPES" );
if ( IsSetMsiProp( handle, "REGISTER_NO_MSO_TYPES" ) )
@@ -471,7 +471,7 @@ extern "C" UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle )
else
OutputDebugStringFormat( "FindRegisteredExtensions: " );
- // setting the msi properties SELECT_* will force registering for all corresponding
+ // setting the msi properties SELECT_* will force registering for all corresponding
// file types
if ( IsSetMsiProp( handle, "SELECT_WORD" ) )
registerSomeExtensions( handle, WORD_START, EXCEL_START, true );
@@ -487,7 +487,7 @@ extern "C" UINT __stdcall FindRegisteredExtensions( MSIHANDLE handle )
//----------------------------------------------------------
extern "C" UINT __stdcall DeleteRegisteredExtensions( MSIHANDLE /*handle*/ )
-{
+{
OutputDebugStringFormat( "DeleteRegisteredExtensions\n" );
// remove all file extensions
diff --git a/setup_native/source/win32/customactions/reg4msdoc/constants.hxx b/setup_native/source/win32/customactions/reg4msdoc/constants.hxx
index 21b576b97dda..4caab9211f78 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/constants.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/constants.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,18 +25,18 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _CONSTANTS_HXX_
#define _CONSTANTS_HXX_
-
+
extern const int MSWORD;
extern const int MSEXCEL;
-extern const int MSPOWERPOINT;
-extern const int DEFAULT_HTML_EDITOR_FOR_IE;
-extern const int HTML_EDITOR;
+extern const int MSPOWERPOINT;
+extern const int DEFAULT_HTML_EDITOR_FOR_IE;
+extern const int HTML_EDITOR;
extern const int DEFAULT_SHELL_HTML_EDITOR;
#endif
-
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx b/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
index 648d4f33fdd3..f1f2f59822df 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx
@@ -17,7 +17,7 @@ bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value)
MsiGetProperty(handle, name, buff, &sz);
value = buff;
return true;
- }
+ }
return false;
}
@@ -47,7 +47,7 @@ bool IsMsiPropNotEmpty(MSIHANDLE handle, LPCTSTR name)
bool IsAllUserInstallation(MSIHANDLE handle)
{
- return IsSetMsiProp(handle, TEXT("ALLUSERS"));
+ return IsSetMsiProp(handle, TEXT("ALLUSERS"));
}
std::wstring GetOfficeInstallationPath(MSIHANDLE handle)
@@ -58,7 +58,7 @@ std::wstring GetOfficeInstallationPath(MSIHANDLE handle)
}
std::wstring GetOfficeExecutablePath(MSIHANDLE handle)
-{
+{
std::wstring exepath = GetOfficeInstallationPath(handle);
exepath += TEXT("program\\soffice.exe");
return exepath;
@@ -68,7 +68,7 @@ std::wstring GetProductName(MSIHANDLE handle)
{
std::wstring prodname;
GetMsiProp(handle, TEXT("ProductName"), prodname);
- return prodname;
+ return prodname;
}
bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name)
@@ -92,7 +92,7 @@ bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name)
INSTALLSTATE current_state;
INSTALLSTATE future_state;
MsiGetFeatureState(handle, name, &current_state, &future_state);
- return ((current_state == INSTALLSTATE_LOCAL) && (future_state == INSTALLSTATE_ABSENT));
+ return ((current_state == INSTALLSTATE_LOCAL) && (future_state == INSTALLSTATE_ABSENT));
}
bool IsCompleteDeinstallation(MSIHANDLE handle)
diff --git a/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx b/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
index 483a66986859..2ff1a880f12e 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/msihelper.hxx
@@ -15,43 +15,43 @@
#include <string>
/**
- Get the value of the named property
-
+ Get the value of the named property
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the property.
-
+
@param value
[out] receives thes value of the property.
-
- @returns
+
+ @returns
<TRUE/>if the property was found.
*/
bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value);
/**
- Set the value of a binary property which can only
+ Set the value of a binary property which can only
have the values "0" or "1" to "1".
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
- [in] the name of the property.
+ [in] the name of the property.
*/
void SetMsiProp(MSIHANDLE handle, LPCTSTR name);
/**
- Set the value of a binary property which can only
+ Set the value of a binary property which can only
have the values "0" or "1" to "0".
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
- [in] the name of the property.
+ [in] the name of the property.
*/
void UnsetMsiProp(MSIHANDLE handle, LPCTSTR name);
@@ -59,7 +59,7 @@ void UnsetMsiProp(MSIHANDLE handle, LPCTSTR name);
Returns whether a certain property is set meaning
its value is "1". This method should be used for
binary properties whose value can be "0" or "1".
-
+
@returns
<TRUE/>if the value of the specified property is
"1" else if the property is not defined or its
@@ -71,7 +71,7 @@ bool IsSetMsiProp(MSIHANDLE handle, LPCTSTR name);
Returns whether a certain property is set meaning
its value is not empty. This method should be used for
properties, that can have different values.
-
+
@returns
<TRUE/>if the value of the specified property is
not empty. If it is empty <FALSE/> will be returned.
@@ -80,10 +80,10 @@ bool IsMsiPropNotEmpty(MSIHANDLE handle, LPCTSTR name);
/**
Query if this is an installation for all user or not.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
<TRUE/>if this is an all user installation
*/
@@ -92,10 +92,10 @@ bool IsAllUserInstallation(MSIHANDLE handle);
/**
Returns the destination folder of the office installation
as system path. The returned path contains a final '\'.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
the destination path of the office installation finalized
with a '\'.
@@ -105,10 +105,10 @@ std::wstring GetOfficeInstallationPath(MSIHANDLE handle);
/**
Returns the absolute path of the office executable that
will be installed as system path.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
the absolute system path of the office executable (e.g.
(C:\Program Files\StarOffice 8\program\soffice.exe").
@@ -118,25 +118,25 @@ std::wstring GetOfficeExecutablePath(MSIHANDLE handle);
/**
Get the name of the office that will be installed
(e.g. StarOffice 8, StarSuite 8, ...).
-
+
@param handle
[in] a valid msi handle.
-
- @returns
+
+ @returns
the name of the office product that will be installed.
*/
std::wstring GetProductName(MSIHANDLE handle);
/**
Determine if the specified module is installed locally.
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the module.
-
- @returns
+
+ @returns
<TRUE/>if the specified module is installed locally.
*/
bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name);
@@ -144,39 +144,39 @@ bool IsModuleInstalled(MSIHANDLE handle, LPCTSTR name);
/**
Determine if the specified module is selected to be installed
locally.
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the module.
-
+
@returns
- <TRUE/>if the specified module is about to be installed locally.
+ <TRUE/>if the specified module is about to be installed locally.
*/
bool IsModuleSelectedForInstallation(MSIHANDLE handle, LPCTSTR name);
/**
Determine if the specified module which is locally installed is
selected for deinstallation.
-
+
@param handle
[in] a valid msi handle.
-
+
@param name
[in] the name of the module.
-
- @returns
+
+ @returns
<TRUE/>if the specified module is about to be deinstalled.
*/
bool IsModuleSelectedForDeinstallation(MSIHANDLE handle, LPCTSTR name);
/**
Determine whether this is a complete uninstallation or not.
-
+
@param handle
[in] a valid msi handle.
-
+
@returns
<TRUE/>if this is a complete deinstallation.
*/
diff --git a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx
index e3f930ccfcbd..538f45339851 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -29,7 +29,7 @@
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#endif
-#define WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <msiquery.h>
#ifdef _MSC_VER
@@ -62,29 +62,29 @@ void DeterminePowerPointPreselectionState(MSIHANDLE handle)
}
extern "C" UINT __stdcall InstallUiSequenceEntry(MSIHANDLE handle)
-{
+{
//MessageBox(NULL, TEXT("InstallUiSequenceEntry"), TEXT("Information"), MB_OK | MB_ICONINFORMATION);
-
+
if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Wrt_Bin")))
{
DetermineWordPreselectionState(handle);
}
- else if (IsModuleInstalled(handle, TEXT("gm_p_Wrt_Bin")) &&
- !IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Wrt_Bin")) &&
+ else if (IsModuleInstalled(handle, TEXT("gm_p_Wrt_Bin")) &&
+ !IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Wrt_Bin")) &&
IsRegisteredFor(handle, MSWORD))
- {
+ {
SetMsiProp(handle, TEXT("SELECT_WORD"));
- }
+ }
else
{
UnsetMsiProp(handle, TEXT("SELECT_WORD"));
}
-
- if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Calc_Bin")))
+
+ if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Calc_Bin")))
{
- DetermineExcelPreselectionState(handle);
- }
- else if (IsModuleInstalled(handle, TEXT("gm_p_Calc_Bin")) &&
+ DetermineExcelPreselectionState(handle);
+ }
+ else if (IsModuleInstalled(handle, TEXT("gm_p_Calc_Bin")) &&
!IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Calc_Bin")) &&
IsRegisteredFor(handle, MSEXCEL))
{
@@ -94,21 +94,21 @@ extern "C" UINT __stdcall InstallUiSequenceEntry(MSIHANDLE handle)
{
UnsetMsiProp(handle, TEXT("SELECT_EXCEL"));
}
-
- if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Impress_Bin")))
+
+ if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Impress_Bin")))
{
DeterminePowerPointPreselectionState(handle);
- }
- else if (IsModuleInstalled(handle, TEXT("gm_p_Impress_Bin")) &&
+ }
+ else if (IsModuleInstalled(handle, TEXT("gm_p_Impress_Bin")) &&
!IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Impress_Bin")) &&
IsRegisteredFor(handle, MSPOWERPOINT))
{
- SetMsiProp(handle, TEXT("SELECT_POWERPOINT"));
- }
+ SetMsiProp(handle, TEXT("SELECT_POWERPOINT"));
+ }
else
{
UnsetMsiProp(handle, TEXT("SELECT_POWERPOINT"));
- }
+ }
SetMsiProp(handle, TEXT("UI_SEQUENCE_EXECUTED"));
@@ -118,17 +118,17 @@ extern "C" UINT __stdcall InstallUiSequenceEntry(MSIHANDLE handle)
extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE handle)
{
//MessageBox(NULL, TEXT("InstallExecSequenceEntry"), TEXT("Information"), MB_OK | MB_ICONINFORMATION);
-
+
// Do nothing in repair mode.
// Then UI_SEQUENCE_EXECUTED is not set and Installed is set!
// In silent installation UI_SEQUENCE_EXECUTED is also not set, but Installed is not set.
if ((!IsSetMsiProp(handle, TEXT("UI_SEQUENCE_EXECUTED"))) && (IsMsiPropNotEmpty(handle, TEXT("Installed")))) { return ERROR_SUCCESS; }
-
+
int reg4 = 0;
int unreg4 = 0;
-
- // we always register as html editor for Internet Explorer
- // if writer is installed because there's no harm if we do so
+
+ // we always register as html editor for Internet Explorer
+ // if writer is installed because there's no harm if we do so
if (IsModuleSelectedForInstallation(handle, TEXT("gm_p_Wrt_Bin")))
reg4 |= HTML_EDITOR;
@@ -136,54 +136,54 @@ extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE handle)
reg4 |= MSWORD;
else if (!IsSetMsiProp(handle, TEXT("SELECT_WORD")) && IsRegisteredFor(handle, MSWORD))
unreg4 |= MSWORD;
-
+
if (IsSetMsiProp(handle, TEXT("SELECT_EXCEL")) && !IsRegisteredFor(handle, MSEXCEL))
reg4 |= MSEXCEL;
else if (!IsSetMsiProp(handle, TEXT("SELECT_EXCEL")) && IsRegisteredFor(handle, MSEXCEL))
unreg4 |= MSEXCEL;
-
+
if (IsSetMsiProp(handle, TEXT("SELECT_POWERPOINT")) && !IsRegisteredFor(handle, MSPOWERPOINT))
reg4 |= MSPOWERPOINT;
else if (!IsSetMsiProp(handle, TEXT("SELECT_POWERPOINT")) && IsRegisteredFor(handle, MSPOWERPOINT))
unreg4 |= MSPOWERPOINT;
-
+
if (reg4)
- {
+ {
Register4MsDoc(handle, reg4);
}
-
+
if (unreg4)
- {
+ {
Unregister4MsDoc(handle, unreg4);
- }
+ }
return ERROR_SUCCESS;
}
extern "C" UINT __stdcall DeinstallExecSequenceEntry(MSIHANDLE handle)
-{
+{
//MessageBox(NULL, TEXT("DeinstallExecSequenceEntry"), TEXT("Information"), MB_OK | MB_ICONINFORMATION);
-
+
if (IsCompleteDeinstallation(handle))
{
- Unregister4MsDocAll(handle);
+ Unregister4MsDocAll(handle);
return ERROR_SUCCESS;
}
-
+
if (IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Wrt_Bin")))
{
Unregister4MsDoc(handle, MSWORD | HTML_EDITOR);
}
-
+
if (IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Calc_Bin")))
{
Unregister4MsDoc(handle, MSEXCEL);
}
-
+
if (IsModuleSelectedForDeinstallation(handle, TEXT("gm_p_Impress_Bin")))
{
Unregister4MsDoc(handle, MSPOWERPOINT);
}
-
+
return ERROR_SUCCESS;
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/register.cxx b/setup_native/source/win32/customactions/reg4msdoc/register.cxx
index a23d0ea67934..21d6d7e8f822 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/register.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/register.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -56,25 +56,25 @@ namespace /* private */
RegistrarPtr CreateRegistrar(bool InstallForAllUser, const RegistrationContextInformation& RegCtx)
{
RegistrarPtr RegPtr;
-
+
if (InstallForAllUser)
RegPtr = RegistrarPtr(new Registrar(RegCtx));
else
RegPtr = RegistrarPtr(new UserRegistrar(RegCtx));
-
+
return RegPtr;
}
} // namespace private
bool query_preselect_registration_for_ms_application(MSIHANDLE handle, int Register)
-{
+{
bool preselect = false;
-
+
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
if (Register & MSWORD)
preselect = CurrentRegistrar->QueryPreselectMsWordRegistration();
else if (Register & MSEXCEL)
@@ -85,9 +85,9 @@ bool query_preselect_registration_for_ms_application(MSIHANDLE handle, int Regis
catch(RegistryException&)
{
assert(false);
- }
+ }
return preselect;
-}
+}
//-----------------------------------------
// registers StarOffice for MS document
@@ -96,24 +96,24 @@ bool query_preselect_registration_for_ms_application(MSIHANDLE handle, int Regis
//-----------------------------------------
void Register4MsDoc(MSIHANDLE handle, int Register)
-{
+{
try
- {
+ {
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
if ((Register & MSWORD))
- CurrentRegistrar->RegisterForMsWord();
-
+ CurrentRegistrar->RegisterForMsWord();
+
if ((Register & MSEXCEL))
CurrentRegistrar->RegisterForMsExcel();
-
+
if ((Register & MSPOWERPOINT))
CurrentRegistrar->RegisterForMsPowerPoint();
-
+
if ((Register & HTML_EDITOR))
CurrentRegistrar->RegisterAsHtmlEditorForInternetExplorer();
-
+
if ((Register & DEFAULT_SHELL_HTML_EDITOR))
{
CurrentRegistrar->RegisterAsDefaultHtmlEditorForInternetExplorer();
@@ -124,33 +124,33 @@ void Register4MsDoc(MSIHANDLE handle, int Register)
{
assert(false);
}
-
+
if (Register)
- SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
}
void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
-{
+{
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
if ((Unregister & MSWORD) && CurrentRegistrar->IsRegisteredFor(MSWORD))
CurrentRegistrar->UnregisterForMsWord();
-
+
if ((Unregister & HTML_EDITOR) && CurrentRegistrar->IsRegisteredFor(HTML_EDITOR))
CurrentRegistrar->UnregisterAsHtmlEditorForInternetExplorer();
-
+
if ((Unregister & MSEXCEL) && CurrentRegistrar->IsRegisteredFor(MSEXCEL))
CurrentRegistrar->UnregisterForMsExcel();
-
+
if ((Unregister & MSPOWERPOINT) && CurrentRegistrar->IsRegisteredFor(MSPOWERPOINT))
CurrentRegistrar->UnregisterForMsPowerPoint();
-
+
if ((Unregister & DEFAULT_HTML_EDITOR_FOR_IE) && CurrentRegistrar->IsRegisteredFor(DEFAULT_HTML_EDITOR_FOR_IE))
CurrentRegistrar->UnregisterAsDefaultHtmlEditorForInternetExplorer();
-
+
if ((Unregister & DEFAULT_SHELL_HTML_EDITOR) && CurrentRegistrar->IsRegisteredFor(DEFAULT_SHELL_HTML_EDITOR))
CurrentRegistrar->UnregisterAsDefaultShellHtmlEditor();
}
@@ -158,9 +158,9 @@ void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
{
assert(false);
}
-
+
if (Unregister)
- SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
}
//-----------------------------------------
@@ -168,14 +168,14 @@ void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
// registry entries
// Algorithm:
//
-// 1.
+// 1.
// Target key exist (e.g. '.doc')
// Default value == soffice.?
// Backup key != empty
// Action: Replace Default value with backup
// key
//
-// 2.
+// 2.
// Target key exist
// Default value == soffice.?
// Backup key == empty
@@ -188,16 +188,16 @@ void Unregister4MsDoc(MSIHANDLE handle, int Unregister)
//
// 4.
// Target key does not exist
-// Action: nop
+// Action: nop
//-----------------------------------------
void Unregister4MsDocAll(MSIHANDLE handle)
-{
+{
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
CurrentRegistrar->UnregisterAllAndCleanUpRegistry();
}
catch(RegistryException&)
@@ -212,12 +212,12 @@ void Unregister4MsDocAll(MSIHANDLE handle)
//-----------------------------------------
void RepairRegister4MsDocSettings(MSIHANDLE handle)
-{
+{
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
CurrentRegistrar->RepairRegistrationState();
}
catch(RegistryException&)
@@ -227,14 +227,14 @@ void RepairRegister4MsDocSettings(MSIHANDLE handle)
}
bool IsRegisteredFor(MSIHANDLE handle, int State)
-{
+{
bool Registered = false;
-
+
try
{
RegistrationContextInformation RegContext(handle, GetOfficeExecutablePath(handle));
RegistrarPtr CurrentRegistrar = CreateRegistrar(IsAllUserInstallation(handle), RegContext);
-
+
Registered = CurrentRegistrar->IsRegisteredFor(State);
}
catch(RegistryException&)
@@ -255,24 +255,24 @@ int FixReturnRegistrationState(MSIHANDLE handle)
try
{
- WindowsRegistry registry;
+ WindowsRegistry registry;
RegistryValue rv_regmsdocstate = RegistryValue(
new RegistryValueImpl(REGMSDOCSTATE, 0));
-
+
RegistryKey so_bak_key;
if (IsAllUserInstallation(handle))
{
RegistryKey hkcr_key = registry.GetClassesRootKey();
-
+
if (hkcr_key->HasSubKey(SO_BACKUP_KEY))
so_bak_key = hkcr_key->OpenSubKey(SO_BACKUP_KEY);
else
- so_bak_key = hkcr_key->CreateSubKey(SO_BACKUP_KEY);
+ so_bak_key = hkcr_key->CreateSubKey(SO_BACKUP_KEY);
if (!so_bak_key->HasValue(REGMSDOCSTATE))
- {
+ {
// set a defined value
so_bak_key->SetValue(rv_regmsdocstate);
@@ -280,37 +280,37 @@ int FixReturnRegistrationState(MSIHANDLE handle)
if (hklm_key->HasSubKey(SO60_UNINSTALL_KEY))
{
- RegistryKey so_uninst_key =
+ RegistryKey so_uninst_key =
hklm_key->OpenSubKey(SO60_UNINSTALL_KEY);
if (so_uninst_key->HasValue(REGMSDOCSTATE))
- so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
- }
- }
+ so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
+ }
+ }
}
- else
+ else
{
- RegistryKey hkcu_classes_key =
+ RegistryKey hkcu_classes_key =
registry.GetCurrentUserKey()->OpenSubKey(SOFTWARE_CLASSES);
-
+
so_bak_key = hkcu_classes_key->CreateSubKey(SO_BACKUP_KEY);
-
+
if (!so_bak_key->HasValue(REGMSDOCSTATE))
{
// set a defined value
so_bak_key->SetValue(rv_regmsdocstate);
- RegistryKey hklm_sftw_classes =
+ RegistryKey hklm_sftw_classes =
registry.GetLocalMachineKey()->OpenSubKey(SOFTWARE_CLASSES, false);
-
+
RegistryKey so_bak_key_old;
if (hklm_sftw_classes->HasSubKey(SO_BACKUP_KEY))
{
so_bak_key_old = hklm_sftw_classes->OpenSubKey(SO_BACKUP_KEY, false);
-
+
if (so_bak_key_old->HasValue(REGMSDOCSTATE))
- so_bak_key->CopyValue(so_bak_key_old, REGMSDOCSTATE);
+ so_bak_key->CopyValue(so_bak_key_old, REGMSDOCSTATE);
}
else // try the uninstall key
{
@@ -318,16 +318,16 @@ int FixReturnRegistrationState(MSIHANDLE handle)
if (hklm_key->HasSubKey(SO60_UNINSTALL_KEY))
{
- RegistryKey so_uninst_key =
+ RegistryKey so_uninst_key =
hklm_key->OpenSubKey(SO60_UNINSTALL_KEY);
if (so_uninst_key->HasValue(REGMSDOCSTATE))
- so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
+ so_bak_key->CopyValue(so_uninst_key, REGMSDOCSTATE);
}
}
}
- }
-
+ }
+
rv_regmsdocstate = so_bak_key->GetValue(REGMSDOCSTATE);
registration_state = rv_regmsdocstate->GetDataAsInt();
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/register.hxx b/setup_native/source/win32/customactions/reg4msdoc/register.hxx
index 964c4be894df..10d600776e97 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/register.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/register.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _REGISTER_HXX_
#define _REGISTER_HXX_
@@ -71,7 +71,7 @@ bool IsRegisteredFor(MSIHANDLE handle, int State);
application type or not */
bool query_preselect_registration_for_ms_application(
MSIHANDLE handle, int Register);
-
+
// StarOffice 6.0 saved the registration
// state in HKEY_LOCAL_MACHINE\Software\
// Microsoft\Windows\CurrentVersion\Uninstall\
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx
index 45fbed4819d2..12316bc9adf6 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx
@@ -35,9 +35,9 @@ static inline void OutputDebugStringFormat( LPCTSTR, ... )
const int MSWORD = 0x1;
const int MSEXCEL = 0x2;
-const int MSPOWERPOINT = 0x4;
-const int DEFAULT_HTML_EDITOR_FOR_IE = 0x8;
-const int HTML_EDITOR = 0x10;
+const int MSPOWERPOINT = 0x4;
+const int DEFAULT_HTML_EDITOR_FOR_IE = 0x8;
+const int HTML_EDITOR = 0x10;
const int DEFAULT_SHELL_HTML_EDITOR = 0x20;
namespace /* private */
@@ -53,7 +53,7 @@ namespace /* private */
const std::wstring MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD = L"Software\\Microsoft\\Internet Explorer\\Default HTML Editor\\shell\\edit\\command";
}
-Registrar::Registrar(const RegistrationContextInformation& RegContext) :
+Registrar::Registrar(const RegistrationContextInformation& RegContext) :
m_ContextInformation(RegContext),
FORWARD_KEY_PREFIX(L"OpenOffice.org"),//FORWARD_KEY_PREFIX(L"soffice6"),
DEFAULT_VALUE_NAME(L""),
@@ -69,9 +69,9 @@ Registrar::~Registrar()
}
void Registrar::RegisterForMsWord() const
-{
+{
assert(m_RootKey.get());
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetWordDocumentFileExtension(),
m_ContextInformation.GetWordDocumentDisplayName(),
@@ -79,15 +79,15 @@ void Registrar::RegisterForMsWord() const
m_ContextInformation.GetWordDocumentDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Writer);
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetWordTemplateFileExtension(),
m_ContextInformation.GetWordTemplateDisplayName(),
m_ContextInformation.GetWordTemplateDefaultIconEntry(),
m_ContextInformation.GetWordTemplateDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
- RegistrationContextInformation::Writer);
-
+ RegistrationContextInformation::Writer);
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetRtfDocumentFileExtension(),
m_ContextInformation.GetRtfDocumentDisplayName(),
@@ -95,7 +95,7 @@ void Registrar::RegisterForMsWord() const
m_ContextInformation.GetRtfDocumentDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Writer);
-
+
SaveRegisteredFor(MSWORD);
}
@@ -114,7 +114,7 @@ void Registrar::UnregisterForMsWord() const
try
{
UnregisterForMsOfficeApplication(
- m_ContextInformation.GetWordTemplateFileExtension());
+ m_ContextInformation.GetWordTemplateFileExtension());
}
catch(RegistryKeyNotFoundException&)
{}
@@ -138,7 +138,7 @@ bool Registrar::QueryPreselectForMsApplication(const std::wstring& file_extensio
// MS Office applications already exist if we are about to
// register in HKCU\Software\Classes
RegistryKey root_key = WindowsRegistry().GetClassesRootKey();
-
+
if (!root_key->HasSubKey(file_extension))
{
preselect = true;
@@ -147,7 +147,7 @@ bool Registrar::QueryPreselectForMsApplication(const std::wstring& file_extensio
else
{
RegistryKey RegKey = root_key->OpenSubKey(file_extension, false);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
@@ -169,12 +169,12 @@ bool Registrar::QueryPreselectForMsApplication(const std::wstring& file_extensio
preselect = true;
OutputDebugStringFormat( TEXT("QueryPreselect: No default found for SubKey (%s), preselected!\n"), file_extension.c_str() );
}
- }
+ }
return preselect;
}
bool Registrar::QueryPreselectMsWordRegistration() const
-{
+{
return QueryPreselectForMsApplication(
m_ContextInformation.GetWordDocumentFileExtension());
}
@@ -182,7 +182,7 @@ bool Registrar::QueryPreselectMsWordRegistration() const
void Registrar::RegisterForMsExcel() const
{
assert(m_RootKey.get());
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetExcelSheetFileExtension(),
m_ContextInformation.GetExcelSheetDisplayName(),
@@ -198,14 +198,14 @@ void Registrar::RegisterForMsExcel() const
m_ContextInformation.GetExcelTemplateDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Calc);
-
+
SaveRegisteredFor(MSEXCEL);
}
void Registrar::UnregisterForMsExcel() const
{
assert(m_RootKey.get());
-
+
try
{
UnregisterForMsOfficeApplication(
@@ -234,7 +234,7 @@ bool Registrar::QueryPreselectMsExcelRegistration() const
void Registrar::RegisterForMsPowerPoint() const
{
assert(m_RootKey.get());
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetPowerPointDocumentFileExtension(),
m_ContextInformation.GetPowerPointDocumentDisplayName(),
@@ -242,7 +242,7 @@ void Registrar::RegisterForMsPowerPoint() const
m_ContextInformation.GetPowerPointDocumentDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Impress);
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetPowerPointShowFileExtension(),
m_ContextInformation.GetPowerPointShowDisplayName(),
@@ -250,22 +250,22 @@ void Registrar::RegisterForMsPowerPoint() const
m_ContextInformation.GetPowerPointShowDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
RegistrationContextInformation::Impress);
-
+
RegisterForMsOfficeApplication(
m_ContextInformation.GetPowerPointTemplateFileExtension(),
m_ContextInformation.GetPowerPointTemplateDisplayName(),
m_ContextInformation.GetPowerPointTemplateDefaultIconEntry(),
m_ContextInformation.GetPowerPointTemplateDefaultShellCommand(),
m_ContextInformation.ShellNewCommandDisplayName(),
- RegistrationContextInformation::Impress);
-
+ RegistrationContextInformation::Impress);
+
SaveRegisteredFor(MSPOWERPOINT);
}
void Registrar::UnregisterForMsPowerPoint() const
{
assert(m_RootKey.get());
-
+
try
{
UnregisterForMsOfficeApplication(
@@ -307,46 +307,46 @@ bool Registrar::QueryPreselectMsPowerPointRegistration() const
make the following entries to register
a html editor for the Internet Explorer
HKCR\.htm\OpenWithList\App Friendly Name\shell\edit\command
- But the reality shows that this works only
- with Internet Explorer 5.x
- Internet Explorer 6.0 wants the follwoing
+ But the reality shows that this works only
+ with Internet Explorer 5.x
+ Internet Explorer 6.0 wants the follwoing
entries:
HKCR\.htm\OpenWithList\App.exe
- HKCR\Applications\App.ex\shell\edit\command
+ HKCR\Applications\App.ex\shell\edit\command
*/
void Registrar::RegisterAsHtmlEditorForInternetExplorer() const
{
assert(m_RootKey.get());
-
+
std::wstring OOFriendlyAppName = m_ContextInformation.GetOpenOfficeFriendlyAppName();
-
+
std::wstring RegKeyName = HTM_OPENWITHLIST + std::wstring(L"\\") + OOFriendlyAppName;
RegistryKey RegKey = m_RootKey->CreateSubKey(RegKeyName);
-
+
RegKey = RegKey->CreateSubKey(SHELL_EDIT_COMMAND);
-
+
RegistryValue RegVal(
new RegistryValueImpl(
- DEFAULT_VALUE_NAME,
+ DEFAULT_VALUE_NAME,
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
RegistrationContextInformation::Writer)));
-
+
RegKey->SetValue(RegVal);
-
+
RegKeyName = APPLICATIONS + std::wstring(L"\\") + OOFriendlyAppName;
RegKey = m_RootKey->CreateSubKey(RegKeyName);
-
+
RegVal->SetName(L"FriendlyAppName");
RegVal->SetValue(OOFriendlyAppName);
RegKey->SetValue(RegVal);
-
+
RegKey = RegKey->CreateSubKey(SHELL_EDIT_COMMAND);
RegVal->SetName(DEFAULT_VALUE_NAME);
RegVal->SetValue(
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
- RegistrationContextInformation::Writer));
+ RegistrationContextInformation::Writer));
RegKey->SetValue(RegVal);
-
+
SaveRegisteredFor(HTML_EDITOR);
}
@@ -375,75 +375,75 @@ void Registrar::UnregisterAsHtmlEditorForInternetExplorer() const
void Registrar::RegisterAsDefaultHtmlEditorForInternetExplorer() const
{
assert(m_RootKey.get());
-
+
RegistryKey RegistrationRootKey = GetRootKeyForDefHtmlEditorForIERegistration();
-
+
RegistryKey RegKey = RegistrationRootKey->CreateSubKey(MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD);
-
+
RegistryValue RegVal = RegistryValue(new RegistryValueImpl(DEFAULT_VALUE_NAME, L""));
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
if (std::wstring::npos == CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME + L"\\" + DEFAULT_HTML_EDITOR);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
- BackupRegKey->CopyValue(RegKey, DEFAULT_VALUE_NAME);
-
+ BackupRegKey->CopyValue(RegKey, DEFAULT_VALUE_NAME);
+
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
if (RegKey->HasValue(L"Description"))
BackupRegKey->CopyValue(RegKey, L"Description");
}
}
-
+
RegVal->SetValue(
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
RegistrationContextInformation::Writer));
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD);
RegKey->SetValue(RegVal);
-
+
RegVal->SetName(L"Description");
RegVal->SetValue(m_ContextInformation.GetOpenOfficeFriendlyAppName());
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
RegKey->SetValue(RegVal);
-
+
SaveRegisteredFor(DEFAULT_HTML_EDITOR_FOR_IE);
}
void Registrar::UnregisterAsDefaultHtmlEditorForInternetExplorer() const
{
assert(m_RootKey.get());
-
+
RegistryKey RegistrationRootKey = GetRootKeyForDefHtmlEditorForIERegistration();
-
+
RegistryKey RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR_SHL_EDIT_CMD);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
if (std::wstring::npos != CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->OpenSubKey(PRIVATE_BACKUP_KEY_NAME);
-
+
if (BackupRegKey->HasSubKey(DEFAULT_HTML_EDITOR))
{
BackupRegKey = BackupRegKey->OpenSubKey(DEFAULT_HTML_EDITOR);
-
+
if (BackupRegKey->HasValue(DEFAULT_VALUE_NAME))
RegKey->CopyValue(BackupRegKey, DEFAULT_VALUE_NAME);
else
RegKey->DeleteValue(DEFAULT_VALUE_NAME);
- RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
-
+ RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
+
if (BackupRegKey->HasValue(L"Description"))
RegKey->CopyValue(BackupRegKey, L"Description");
else
@@ -451,91 +451,91 @@ void Registrar::UnregisterAsDefaultHtmlEditorForInternetExplorer() const
}
else
{
- RegKey->DeleteValue(DEFAULT_VALUE_NAME);
+ RegKey->DeleteValue(DEFAULT_VALUE_NAME);
RegKey = RegistrationRootKey->OpenSubKey(MS_IE_DEF_HTML_EDITOR);
RegKey->DeleteValue(L"Description");
- }
+ }
}
}
-
+
SaveNotRegisteredFor(DEFAULT_HTML_EDITOR_FOR_IE);
}
void Registrar::RegisterAsDefaultShellHtmlEditor() const
{
assert(m_RootKey.get());
-
+
RegistryKey RegKey = m_RootKey->CreateSubKey(L".htm");
-
+
RegistryValue RegVal = RegistryValue(
new RegistryValueImpl(DEFAULT_VALUE_NAME, L""));
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
- std::wstring HtmFwdKey = RegVal->GetDataAsUniString();
+
+ std::wstring HtmFwdKey = RegVal->GetDataAsUniString();
if (0 == HtmFwdKey.length() || !m_RootKey->HasSubKey(HtmFwdKey))
HtmFwdKey = L".htm";
-
+
RegKey = m_RootKey->CreateSubKey(HtmFwdKey + L"\\" + SHELL_EDIT_COMMAND);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
// backup old values if we are not in place
if (std::wstring::npos == CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME + L"\\" + HTML_EDIT);
BackupRegKey->CopyValue(RegKey, DEFAULT_VALUE_NAME, SHELL_EDIT_COMMAND_BACKUP);
- }
+ }
}
-
+
RegVal->SetValue(
m_ContextInformation.GetOpenOfficeCommandline(RegistrationContextInformation::Open,
RegistrationContextInformation::Writer));
-
+
RegKey->SetValue(RegVal);
-
+
SaveRegisteredFor(DEFAULT_SHELL_HTML_EDITOR);
}
void Registrar::UnregisterAsDefaultShellHtmlEditor() const
{
assert(m_RootKey.get());
-
+
try
{
RegistryKey RegKey = m_RootKey->OpenSubKey(L".htm");
-
+
RegistryValue RegVal = RegistryValue(
new RegistryValueImpl(DEFAULT_VALUE_NAME, L""));
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring HtmFwdKey = RegVal->GetDataAsUniString();
-
+
if (0 == HtmFwdKey.length() || !m_RootKey->HasSubKey(HtmFwdKey))
HtmFwdKey = L".htm";
-
+
RegKey = m_RootKey->OpenSubKey(HtmFwdKey + L"\\" + SHELL_EDIT_COMMAND);
-
+
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring CmdLine = RegVal->GetDataAsUniString();
-
+
if (std::wstring::npos != CmdLine.find(m_ContextInformation.GetOpenOfficeExecutableName()))
- {
+ {
RegistryKey BackupRegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME + L"\\" + HTML_EDIT);
-
+
if (BackupRegKey->HasValue(SHELL_EDIT_COMMAND_BACKUP))
RegKey->CopyValue(BackupRegKey, SHELL_EDIT_COMMAND_BACKUP, DEFAULT_VALUE_NAME);
else
RegKey->DeleteValue(DEFAULT_VALUE_NAME);
- }
+ }
}
catch(RegistryKeyNotFoundException&)
{
@@ -547,7 +547,7 @@ void Registrar::UnregisterAsDefaultShellHtmlEditor() const
void Registrar::SaveRegisteredFor(int State) const
{
assert(m_RootKey.get());
-
+
int NewState = GetRegisterState();
NewState |= State;
SetRegisterState(NewState);
@@ -556,7 +556,7 @@ void Registrar::SaveRegisteredFor(int State) const
void Registrar::SaveNotRegisteredFor(int State) const
{
assert(m_RootKey.get());
-
+
int NewState = GetRegisterState();
NewState &= ~State;
SetRegisterState(NewState);
@@ -565,16 +565,16 @@ void Registrar::SaveNotRegisteredFor(int State) const
int Registrar::GetRegisterState() const
{
int State = 0;
-
+
RegistryKey RegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME);
-
+
if (RegKey->HasValue(REGISTRATION_STATE))
{
RegistryValue RegVal = RegKey->GetValue(REGISTRATION_STATE);
if (REG_DWORD == RegVal->GetType())
State = RegVal->GetDataAsInt();
}
-
+
return State;
}
@@ -584,22 +584,22 @@ void Registrar::SetRegisterState(int NewState) const
RegistryValue RegVal = RegistryValue(new RegistryValueImpl(REGISTRATION_STATE, NewState));
RegKey->SetValue(RegVal);
}
-
+
bool Registrar::IsRegisteredFor(int State) const
{
assert(m_RootKey.get());
-
+
RegistryKey RegKey = m_RootKey->CreateSubKey(PRIVATE_BACKUP_KEY_NAME);
-
+
int SavedState = 0;
-
+
if (RegKey->HasValue(REGISTRATION_STATE))
{
RegistryValue RegVal = RegKey->GetValue(REGISTRATION_STATE);
if (REG_DWORD == RegVal->GetType())
- SavedState = RegVal->GetDataAsInt();
+ SavedState = RegVal->GetDataAsInt();
}
-
+
return ((SavedState & State) == State);
}
@@ -631,7 +631,7 @@ void Registrar::RepairRegistrationState() const
/** Unregisters all and delete all Registry keys we have written */
void Registrar::UnregisterAllAndCleanUpRegistry() const
-{
+{
assert(m_RootKey.get());
if (IsRegisteredFor(MSWORD))
@@ -651,7 +651,7 @@ void Registrar::UnregisterAllAndCleanUpRegistry() const
if (IsRegisteredFor(DEFAULT_SHELL_HTML_EDITOR))
UnregisterAsDefaultShellHtmlEditor();
-
+
if (m_RootKey->HasSubKey(PRIVATE_BACKUP_KEY_NAME))
m_RootKey->DeleteSubKeyTree(PRIVATE_BACKUP_KEY_NAME);
}
@@ -665,7 +665,7 @@ void Registrar::RegisterForMsOfficeApplication(
const RegistrationContextInformation::OFFICE_APPLICATION eOfficeApp) const
{
assert(m_RootKey.get());
-
+
std::wstring ForwardKeyName = FORWARD_KEY_PREFIX + FileExtension;
RegistryKey ForwardKey = m_RootKey->CreateSubKey(ForwardKeyName);
@@ -702,39 +702,39 @@ void Registrar::RegisterForMsOfficeApplication(
// set the new forward key under the appropriate extension
RegKey = m_RootKey->CreateSubKey(FileExtension);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
-
+
if (REG_SZ == RegVal->GetType())
{
std::wstring str = RegVal->GetDataAsUniString();
- if (!IsOpenOfficeRegisteredForMsApplication(str))
+ if (!IsOpenOfficeRegisteredForMsApplication(str))
ForwardKey->CopyValue(RegKey, DEFAULT_VALUE_NAME, BACKUP_VALUE_NAME);
}
}
-
+
RegVal->SetValue(ForwardKeyName);
- RegKey->SetValue(RegVal);
+ RegKey->SetValue(RegVal);
}
void Registrar::UnregisterForMsOfficeApplication(const std::wstring& FileExtension) const
{
std::wstring FwdRegKeyName = FORWARD_KEY_PREFIX + FileExtension;
-
+
if (m_RootKey->HasSubKey(FileExtension))
{
RegistryKey RegKey = m_RootKey->OpenSubKey(FileExtension);
-
+
if (RegKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RegKey->GetValue(DEFAULT_VALUE_NAME);
- if (REG_SZ == RegVal->GetType() &&
+ if (REG_SZ == RegVal->GetType() &&
IsOpenOfficeRegisteredForMsApplication(RegVal->GetDataAsUniString()))
- {
+ {
RegistryKey FwdRegKey = m_RootKey->CreateSubKey(FwdRegKeyName);
-
+
if (FwdRegKey->HasValue(BACKUP_VALUE_NAME))
RegKey->CopyValue(FwdRegKey, BACKUP_VALUE_NAME, DEFAULT_VALUE_NAME);
else
@@ -742,11 +742,11 @@ void Registrar::UnregisterForMsOfficeApplication(const std::wstring& FileExtensi
}
}
}
-
+
if (m_RootKey->HasSubKey(FwdRegKeyName))
m_RootKey->DeleteSubKeyTree(FwdRegKeyName);
}
-
+
RegistryKey Registrar::GetRootKeyForDefHtmlEditorForIERegistration() const
{
return WindowsRegistry().GetLocalMachineKey();
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx b/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx
index 851b12f8daf7..e0bf8f1ee799 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx
@@ -11,28 +11,28 @@
#include "constants.hxx"
-class Registrar
+class Registrar
{
public:
-
+
Registrar(const RegistrationContextInformation& RegContext);
virtual ~Registrar();
bool IsRegisteredFor(int State) const;
-
+
virtual void RegisterForMsWord() const;
virtual void UnregisterForMsWord() const;
virtual bool QueryPreselectMsWordRegistration() const;
-
+
virtual void RegisterForMsExcel() const;
virtual void UnregisterForMsExcel() const;
virtual bool QueryPreselectMsExcelRegistration() const;
-
+
virtual void RegisterForMsPowerPoint() const;
virtual void UnregisterForMsPowerPoint() const;
virtual bool QueryPreselectMsPowerPointRegistration() const;
-
+
virtual void RegisterAsHtmlEditorForInternetExplorer() const;
virtual void UnregisterAsHtmlEditorForInternetExplorer() const;
@@ -50,9 +50,9 @@ public:
/** Unregisters all and delete all Registry keys we have written
*/
virtual void UnregisterAllAndCleanUpRegistry() const;
-
+
protected:
-
+
virtual void RegisterForMsOfficeApplication(
const std::wstring& FileExtension,
const std::wstring& DocumentDisplayName,
@@ -60,45 +60,45 @@ protected:
const std::wstring& DefaultShellCommand,
const std::wstring& ShellNewCommandDisplayName,
const RegistrationContextInformation::OFFICE_APPLICATION eOfficeApp) const;
-
+
virtual void UnregisterForMsOfficeApplication(
const std::wstring& FileExtension) const;
-
+
virtual RegistryKey GetRootKeyForDefHtmlEditorForIERegistration() const;
-
+
void SaveRegisteredFor(int State) const;
void SaveNotRegisteredFor(int State) const;
-
+
int GetRegisterState() const;
void SetRegisterState(int NewState) const;
-
+
virtual bool QueryPreselectForMsApplication(const std::wstring& file_extension) const;
-
+
/** A helper function (for readability) returns true if OpenOffice is already
registered for a MS application
-
+
@param DocumentExtensionDefValue
The default value of the appropriate document extension Registry key
*/
bool IsOpenOfficeRegisteredForMsApplication(const std::wstring& DocumentExtensionDefValue) const;
-
-protected:
- const RegistrationContextInformation& m_ContextInformation;
+
+protected:
+ const RegistrationContextInformation& m_ContextInformation;
const std::wstring FORWARD_KEY_PREFIX;
const std::wstring DEFAULT_VALUE_NAME;
const std::wstring BACKUP_VALUE_NAME;
const std::wstring PRIVATE_BACKUP_KEY_NAME;
const std::wstring REGISTRATION_STATE;
-
- RegistryKey m_RootKey;
-
+
+ RegistryKey m_RootKey;
+
// prevent copy/assignment
private:
Registrar(const Registrar&);
Registrar& operator=(const Registrar&);
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx
index 189b7e3074ae..307e3ff469e9 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx
@@ -31,7 +31,7 @@ RegistrationContextInformation::RegistrationContextInformation(MSIHANDLE hMsi, c
}
std::wstring RegistrationContextInformation::GetWordDocumentDisplayName() const
-{
+{
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_MS_WORD_DOCUMENT"), str);
if (m_IsWin9x && !IsConvertableToAnsi(str))
@@ -79,7 +79,7 @@ std::wstring RegistrationContextInformation::GetWordTemplateDefaultShellCommand(
}
std::wstring RegistrationContextInformation::GetRtfDocumentDisplayName() const
-{
+{
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_RTF_DOCUMENT"), str);
if (m_IsWin9x && !IsConvertableToAnsi(str))
@@ -221,7 +221,7 @@ std::wstring RegistrationContextInformation::GetPowerPointShowDefaultShellComman
{
return std::wstring(TEXT("open"));
}
-
+
//----------------------------------------------
/** The string for the "New" command that should appear
in the Explorer context menu when someone right
@@ -232,13 +232,13 @@ std::wstring RegistrationContextInformation::ShellNewCommandDisplayName() const
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_NEW_DISPLAY_NAME"), str);
std::wstring::size_type idx = str.find(TEXT("~"));
-
+
if(std::wstring::npos != idx)
str.replace(idx, 1, TEXT("&"));
-
+
if (m_IsWin9x && !IsConvertableToAnsi(str))
str = TEXT("&New");
-
+
return str;
}
@@ -251,7 +251,7 @@ std::wstring RegistrationContextInformation::ShellEditCommandDisplayName() const
std::wstring str;
GetMsiProp(msihandle_, TEXT("STR_EDIT"), str);
std::wstring::size_type idx = str.find(TEXT("~"));
-
+
if(std::wstring::npos != idx)
str.replace(idx, 1, TEXT("&"));
@@ -264,7 +264,7 @@ std::wstring RegistrationContextInformation::ShellEditCommandDisplayName() const
std::wstring RegistrationContextInformation::GetOpenOfficeFriendlyAppName() const
{
std::wstring str;
- GetMsiProp(msihandle_, TEXT("ProductName"), str);
+ GetMsiProp(msihandle_, TEXT("ProductName"), str);
return str;
}
@@ -302,7 +302,7 @@ std::wstring RegistrationContextInformation::GetOpenOfficeCommandline(SHELL_COMM
break;
case Office: // default to std command line
break;
- // default: no default to find new added enums at compile time
+ // default: no default to find new added enums at compile time
}
switch(ShellCommand)
{
@@ -318,7 +318,7 @@ std::wstring RegistrationContextInformation::GetOpenOfficeCommandline(SHELL_COMM
case Printto:
cmd_line += std::wstring(TEXT(" -pt \"%2\" \"%1\""));
break;
- // default: no default to find new added enums at compile time
+ // default: no default to find new added enums at compile time
}
return cmd_line;
}
@@ -338,7 +338,7 @@ bool RegistrationContextInformation::IsConvertableToAnsi(const std::wstring& Str
buff,
sizeof(buff),
NULL,
- &bUsedDefChar);
+ &bUsedDefChar);
}
return !bUsedDefChar;
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx
index 91a42e6b58d7..1e52a710e81d 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.hxx
@@ -21,25 +21,25 @@
/** A simple implementation class that returns the
appropriate display names for the Microsoft
Office document types.
- Under Windows 9x this class checks if the
+ Under Windows 9x this class checks if the
document display name is convertable to an ANSI
string and if not returns an english default.
So we avoid garbage if soemone for instance
installs an japanese StarOffice/OpenOffice
under a German Windows 98 for instance.
*/
-class RegistrationContextInformation
+class RegistrationContextInformation
{
public:
-
+
enum SHELL_COMMAND {New, Open, Print, Printto};
enum OFFICE_APPLICATION {Office, Writer, Calc, Impress};
-
+
RegistrationContextInformation(MSIHANDLE hMsi, const std::wstring& OpenOfficeExecutablePath);
-
- /** Word document information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+
+ /** Word document information
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
word document files
*/
std::wstring GetWordDocumentDisplayName() const;
@@ -48,8 +48,8 @@ public:
std::wstring GetWordDocumentDefaultShellCommand() const;
/** Word template information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
word template files
*/
std::wstring GetWordTemplateDisplayName() const;
@@ -57,9 +57,9 @@ public:
std::wstring GetWordTemplateDefaultIconEntry() const;
std::wstring GetWordTemplateDefaultShellCommand() const;
- /** Rtf document information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ /** Rtf document information
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
rtf document files
*/
std::wstring GetRtfDocumentDisplayName() const;
@@ -68,18 +68,18 @@ public:
std::wstring GetRtfDocumentDefaultShellCommand() const;
/** Excel sheet information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
Excel sheets
*/
- std::wstring GetExcelSheetDisplayName() const;
+ std::wstring GetExcelSheetDisplayName() const;
std::wstring GetExcelSheetFileExtension() const;
std::wstring GetExcelSheetDefaultIconEntry() const;
std::wstring GetExcelSheetDefaultShellCommand() const;
/** Excel template information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
Excel template files
*/
std::wstring GetExcelTemplateDisplayName() const;
@@ -88,18 +88,18 @@ public:
std::wstring GetExcelTemplateDefaultShellCommand() const;
/** PowerPoint document information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
PowerPoint document files
*/
std::wstring GetPowerPointDocumentDisplayName() const;
- std::wstring GetPowerPointDocumentFileExtension() const;
+ std::wstring GetPowerPointDocumentFileExtension() const;
std::wstring GetPowerPointDocumentDefaultIconEntry() const;
std::wstring GetPowerPointDocumentDefaultShellCommand() const;
/** PowerPoint template information
- The icon index is the index of the icon
- in soffice.exe to be associated with
+ The icon index is the index of the icon
+ in soffice.exe to be associated with
PowerPoint template files
*/
std::wstring GetPowerPointTemplateDisplayName() const;
@@ -110,17 +110,17 @@ public:
/** PowerPoint Show information
*/
std::wstring GetPowerPointShowDisplayName() const;
- std::wstring GetPowerPointShowFileExtension() const;
+ std::wstring GetPowerPointShowFileExtension() const;
std::wstring GetPowerPointShowDefaultIconEntry() const;
std::wstring GetPowerPointShowDefaultShellCommand() const;
-
- /** The string for the "New" command that should appear
- in the Explorer context menu when someone right
- clicks a Microsoft document
+
+ /** The string for the "New" command that should appear
+ in the Explorer context menu when someone right
+ clicks a Microsoft document
*/
std::wstring ShellNewCommandDisplayName() const;
- /** The string for the "Edit" command that should
+ /** The string for the "Edit" command that should
appear in the Explorer context menu when someone
right clicks a document
*/
@@ -130,7 +130,7 @@ public:
*/
std::wstring GetOpenOfficeFriendlyAppName() const;
- /** The path to the StarOffice/OpenOffice executable
+ /** The path to the StarOffice/OpenOffice executable
*/
std::wstring GetOpenOfficeExecutablePath() const;
@@ -143,19 +143,19 @@ public:
*/
std::wstring GetOpenOfficeCommandline(SHELL_COMMAND ShellCommand,
OFFICE_APPLICATION OfficeApp) const;
-
+
private:
bool IsConvertableToAnsi(const std::wstring& String) const;
void ExtractOpenOfficeExecNameFromPath();
private:
- MSIHANDLE msihandle_;
- bool m_IsWin9x;
+ MSIHANDLE msihandle_;
+ bool m_IsWin9x;
std::wstring m_OOExecPath;
std::wstring m_OOExecName;
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registry.cxx b/setup_native/source/win32/customactions/reg4msdoc/registry.cxx
index bc277997b92b..d2201e076943 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registry.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registry.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -102,7 +102,7 @@ std::wstring RegistryKeyImpl::GetName() const
}
//-----------------------------------------------------
-/**
+/**
*/
bool RegistryKeyImpl::IsOpen() const
{
@@ -130,7 +130,7 @@ bool RegistryKeyImpl::IsWriteable() const
//-----------------------------------------------------
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
value
@precond IsOpen = true
@@ -152,18 +152,18 @@ struct CompareNamesCaseInsensitive
CompareNamesCaseInsensitive(const std::wstring& Name) :
name_(Name)
{}
-
+
bool operator() (const std::wstring& value)
{
return (0 == StrCmpI(value.c_str(), name_.c_str()));
}
-
+
std::wstring name_;
};
//-----------------------------------------------------
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
sub-key
@precond IsOpen = true
@@ -188,14 +188,14 @@ void RegistryKeyImpl::Close()
if (RegCloseKey(m_hSubKey) != ERROR_SUCCESS) {
assert(false);
}
-
+
m_hSubKey = 0;
m_IsWriteable = false;
}
//-----------------------------------------------------
-/** Copies the specified value from RegistryKey to
- the registry key at hand, if a value with this
+/** Copies the specified value from RegistryKey to
+ the registry key at hand, if a value with this
name already exist under the registry key at hand
it will be overwritten
@@ -208,18 +208,18 @@ void RegistryKeyImpl::Close()
RegistryValueNotFoundException
*/
void RegistryKeyImpl::CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name)
-{
- assert(RegistryKey->HasValue(Name));
+{
+ assert(RegistryKey->HasValue(Name));
#ifdef __MINGW32__
- SetValue((const RegistryValue&)(RegistryKey->GetValue(Name)));
+ SetValue((const RegistryValue&)(RegistryKey->GetValue(Name)));
#else
- SetValue(RegistryKey->GetValue(Name));
+ SetValue(RegistryKey->GetValue(Name));
#endif
assert(HasValue(Name));
}
-/** Copies the specified value from RegistryKey to
- the registry key at hand under a new name,
+/** Copies the specified value from RegistryKey to
+ the registry key at hand under a new name,
if a value with this name already exist there
it will be overwritten
@@ -234,11 +234,11 @@ void RegistryKeyImpl::CopyValue(const RegistryKey& RegistryKey, const std::wstri
void RegistryKeyImpl::CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name, const std::wstring& NewName)
{
assert(RegistryKey->HasValue(Name));
-
+
RegistryValue RegVal = RegistryKey->GetValue(Name);
RegVal->SetName(NewName);
SetValue(RegVal);
-
+
assert(HasValue(NewName));
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registry.hxx b/setup_native/source/win32/customactions/reg4msdoc/registry.hxx
index fe0014b6a191..4d251b8eea5f 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registry.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registry.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,18 +53,18 @@ class RegistryKeyImpl;
// typedefs
//---------------------------------------
-typedef std::auto_ptr<RegistryKeyImpl> RegistryKey;
-typedef std::vector<std::wstring> StringList;
-typedef std::auto_ptr<StringList> StringListPtr;
+typedef std::auto_ptr<RegistryKeyImpl> RegistryKey;
+typedef std::vector<std::wstring> StringList;
+typedef std::auto_ptr<StringList> StringListPtr;
//---------------------------------------
-//
+//
//---------------------------------------
class RegistryKeyImpl
{
-public:
-
+public:
+
//############################################
// Destruction
//############################################
@@ -83,10 +83,10 @@ public:
std::wstring GetName() const;
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
virtual size_t GetSubValueCount() const = 0;
@@ -97,7 +97,7 @@ public:
@throws
*/
virtual size_t GetSubKeyCount() const = 0;
-
+
bool IsOpen() const;
/** Do we have write access on the key at hand
@@ -136,9 +136,9 @@ public:
@precond IsOpen = true
*/
virtual RegistryValue GetValue(const std::wstring& Name, const RegistryValue& Default) const = 0;
-
+
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
value
@precond IsOpen = true
@@ -148,7 +148,7 @@ public:
bool HasValue(const std::wstring& Name) const;
/** Convenience function to determine if the
- Registry key at hand has the specified
+ Registry key at hand has the specified
sub-key
@precond IsOpen = true
@@ -163,9 +163,9 @@ public:
//############################################
- /** Open the registry key, has no effect if
+ /** Open the registry key, has no effect if
the key is already open
-
+
@precond IsOpen = false
@throws RegistryWriteAccessDenyException
@@ -177,12 +177,12 @@ public:
using it without re-opening may cause
RegistryIOExceptions to be thrown
- This is a template method that calls
- ImplClose which has to be overwritten
+ This is a template method that calls
+ ImplClose which has to be overwritten
by sub-classes
*/
void Close();
-
+
/** Open the specified sub-key of the registry key
at hand
@@ -233,7 +233,7 @@ public:
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
@@ -250,8 +250,8 @@ public:
virtual void SetValue(const RegistryValue& Value) = 0;
- /** Copies the specified value from RegistryKey to
- the registry key at hand, if a value with this
+ /** Copies the specified value from RegistryKey to
+ the registry key at hand, if a value with this
name already exist under the registry key at hand
it will be overwritten
@@ -265,8 +265,8 @@ public:
*/
virtual void CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name);
- /** Copies the specified value from RegistryKey to
- the registry key at hand under a new name,
+ /** Copies the specified value from RegistryKey to
+ the registry key at hand under a new name,
if a value with this name already exist there
it will be overwritten
@@ -281,8 +281,8 @@ public:
virtual void CopyValue(const RegistryKey& RegistryKey, const std::wstring& Name, const std::wstring& NewName);
//############################################
- // Creation
- // only possible through WindowsRegistry class
+ // Creation
+ // only possible through WindowsRegistry class
//############################################
@@ -296,7 +296,7 @@ protected:
RegistryKeyImpl(HKEY RootKey, const std::wstring& KeyName);
/** Create instance of the specified Registry key.
- RootKey should only one of the predefined
+ RootKey should only one of the predefined
keys HKEY_CLASSES_ROOT, HKEY_CURRENT_USER,
HKEY_LOCAL_MACHINE, HKEY_USERS
@@ -305,7 +305,7 @@ protected:
RegistryKeyNotFoundException
*/
RegistryKeyImpl(HKEY RootKey);
-
+
/** Create an instances of the specified Registry key,
the key is assumed to be already opened.
*/
@@ -318,11 +318,11 @@ protected:
*/
bool IsRootKey() const;
-protected:
- HKEY m_hRootKey;
- HKEY m_hSubKey;
- std::wstring m_KeyName;
- bool m_IsWriteable;
+protected:
+ HKEY m_hRootKey;
+ HKEY m_hSubKey;
+ std::wstring m_KeyName;
+ bool m_IsWriteable;
// prevent copy and assignment
private:
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx
index cebbe67c6798..5de0c04e42a7 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx
@@ -35,9 +35,9 @@ RegistryException::~RegistryException() throw()
*/
const char* RegistryException::what() const throw()
{
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
m_ErrorCode,
@@ -45,7 +45,7 @@ const char* RegistryException::what() const throw()
(LPTSTR) &m_ErrorMsg,
0,
NULL);
-
+
return reinterpret_cast<char*>(m_ErrorMsg);
}
@@ -61,13 +61,13 @@ long RegistryException::GetErrorCode() const
// that is closed
//#######################################
-RegistryIOException::RegistryIOException(long ErrorCode) :
+RegistryIOException::RegistryIOException(long ErrorCode) :
RegistryException(ErrorCode)
{
};
//#######################################
-//
+//
//#######################################
RegistryNoWriteAccessException::RegistryNoWriteAccessException(long ErrorCode) :
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx b/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx
index 4ea3a2098853..96ce6036746a 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryexception.hxx
@@ -17,23 +17,23 @@ class RegistryException : public std::exception
public:
RegistryException(long ErrorCode);
-
+
virtual ~RegistryException() throw();
-
+
/**
- @descr Returns a string that describes the error if
+ @descr Returns a string that describes the error if
available, else NULL will be returned. The
returned string is only temporary so the caller
has to copy it if he needs the string further.
*/
virtual const char* what() const throw();
-
+
/**
- @descr Returns the error code.
+ @descr Returns the error code.
*/
-
+
long GetErrorCode() const;
-
+
private:
long m_ErrorCode;
void* m_ErrorMsg;
@@ -51,7 +51,7 @@ public:
};
//#######################################
-// Thrown when trying to write to a readonly registry key
+// Thrown when trying to write to a readonly registry key
//#######################################
class RegistryNoWriteAccessException : public RegistryException
@@ -61,7 +61,7 @@ public:
};
//#######################################
-// Thrown when trying to access an registry key, with improper
+// Thrown when trying to access an registry key, with improper
// access rights
//#######################################
@@ -102,6 +102,6 @@ public:
RegistryInvalidOperationException(long ErrorCode);
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx
index d9012fcd087d..71501a8a6ce9 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx
@@ -48,7 +48,7 @@ RegistryValueImpl::RegistryValueImpl(const std::wstring& Name, const std::wstrin
*/
RegistryValueImpl::RegistryValueImpl(const std::wstring& Name, const std::string& Value) :
m_Name(Name),
- m_Type(REG_SZ),
+ m_Type(REG_SZ),
m_IntData(0)
{
m_StringData = AnsiToUnicodeString(Value);
@@ -118,7 +118,7 @@ const void* RegistryValueImpl::GetDataBuffer() const
*/
std::wstring RegistryValueImpl::GetDataAsUniString() const
{
- assert(REG_SZ == m_Type);
+ assert(REG_SZ == m_Type);
return m_StringData;
}
@@ -130,13 +130,13 @@ std::string RegistryValueImpl::GetDataAsAnsiString() const
assert(REG_SZ == m_Type);
return UnicodeToAnsiString(m_StringData);
}
-
+
//--------------------------------------------
-/** Returns the data as number
+/** Returns the data as number
*/
int RegistryValueImpl::GetDataAsInt() const
{
- assert(REG_DWORD == m_Type);
+ assert(REG_DWORD == m_Type);
return m_IntData;
}
@@ -155,7 +155,7 @@ int RegistryValueImpl::GetType() const
//--------------------------------------------
-/** Set a new name
+/** Set a new name
*/
void RegistryValueImpl::SetName(const std::wstring& NewName)
{
@@ -163,7 +163,7 @@ void RegistryValueImpl::SetName(const std::wstring& NewName)
}
//--------------------------------------------
-/**
+/**
*/
void RegistryValueImpl::SetValue(const std::wstring& NewValue)
{
@@ -172,7 +172,7 @@ void RegistryValueImpl::SetValue(const std::wstring& NewValue)
}
//--------------------------------------------
-/**
+/**
*/
void RegistryValueImpl::SetValue(const std::string& NewValue)
{
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx
index 1f4df3353359..48bfcea9b605 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.hxx
@@ -9,7 +9,7 @@
#include <memory>
#include <string>
-class RegistryValueImpl
+class RegistryValueImpl
{
public:
@@ -22,7 +22,7 @@ public:
RegistryValueImpl(const std::wstring& Name, const std::wstring& Value);
RegistryValueImpl(const std::wstring& Name, const std::string& Value);
-
+
#if (_MSC_VER >= 1300)
RegistryValueImpl::RegistryValueImpl(const RegistryValueImpl& s);
#endif
@@ -53,7 +53,7 @@ public:
@precond GetType = STRING
*/
std::wstring GetDataAsUniString() const;
-
+
/** Returns the data as ansi string
@precond GetType = STRING
@@ -61,7 +61,7 @@ public:
std::string GetDataAsAnsiString() const;
/** Returns the data as number
-
+
@precond GetType = NUMBER
*/
int GetDataAsInt() const;
@@ -73,13 +73,13 @@ public:
//#################################
// Command
//#################################
+
-
- /** Set a new name
+ /** Set a new name
*/
void SetName(const std::wstring& NewName);
- /**
+ /**
*/
void SetValue(const std::wstring& NewValue);
@@ -96,16 +96,16 @@ public:
//#################################
private:
- std::wstring m_Name;
- int m_Type;
- std::wstring m_StringData;
- int m_IntData;
+ std::wstring m_Name;
+ int m_Type;
+ std::wstring m_StringData;
+ int m_IntData;
};
typedef std::auto_ptr<RegistryValueImpl> RegistryValue;
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx
index 47cc8ce70ec5..4b14c0d1d907 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -446,7 +446,7 @@ void RegistryKeyImplWin9x::DeleteSubKey(const std::wstring& Name)
else if (ERROR_ACCESS_DENIED == rc)
throw RegistryAccessDeniedException(rc);
else if (ERROR_SUCCESS != rc)
- throw RegistryException(rc);
+ throw RegistryException(rc);
}
//-----------------------------------------------------
@@ -478,7 +478,7 @@ void RegistryKeyImplWin9x::DeleteSubKeyTree(const std::wstring& Name)
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx
index 46c25cb898cf..5f6ce614981d 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _REGISTRYW9X_HXX_
#define _REGISTRYW9X_HXX_
@@ -38,17 +38,17 @@
class RegistryKeyImplWin9x : public RegistryKeyImpl
{
-public:
-
+public:
+
//############################################
// Queries
//############################################
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
virtual size_t GetSubValueCount() const;
@@ -59,7 +59,7 @@ public:
@throws
*/
virtual size_t GetSubKeyCount() const;
-
+
virtual StringListPtr GetSubKeyNames() const;
virtual StringListPtr GetSubValueNames() const;
@@ -76,14 +76,14 @@ public:
@precond IsOpen = true
*/
virtual RegistryValue GetValue(const std::wstring& Name, const RegistryValue& Default) const;
-
+
//############################################
// Commands
//############################################
- /** Open the registry key, has no effect if
+ /** Open the registry key, has no effect if
the key is already open
-
+
@precond IsOpen = false
@throws RegistryWriteAccessDenyException
@@ -141,7 +141,7 @@ public:
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
@@ -158,9 +158,9 @@ public:
virtual void SetValue(const RegistryValue& Value);
//############################################
- // Creation
+ // Creation
//
- // only possible through WindowsRegistry class
+ // only possible through WindowsRegistry class
//############################################
protected:
@@ -179,17 +179,17 @@ protected:
RegistryKeyNotFoundException
*/
RegistryKeyImplWin9x(HKEY RootKey);
-
+
/** Create an instances of the specified Registry key,
the key is assumed to be already opened.
*/
RegistryKeyImplWin9x(HKEY RootKey, HKEY SubKey, const std::wstring& KeyName, bool Writeable = true);
-
+
// prevent copy/assignment
private:
RegistryKeyImplWin9x(const RegistryKeyImplWin9x&);
RegistryKeyImplWin9x& operator=(const RegistryKeyImplWin9x&);
-
+
//######################################
// Friend declarations
//######################################
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx
index 4f60d0cae32a..cd3507b7d696 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,7 +27,7 @@
************************************************************************/
//---------------------------------------
-//
+//
//---------------------------------------
#ifdef _MSC_VER
@@ -50,22 +50,22 @@
#endif
//---------------------------------------
-//
+//
//---------------------------------------
const size_t MAX_TMP_BUFF_SIZE = 1024 * sizeof(wchar_t);
//############################################
-// Creation
-// only possible through WindowsRegistry class
+// Creation
+// only possible through WindowsRegistry class
//############################################
//-----------------------------------------------------
/** Create instance and open the specified Registry key
*/
-RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, const std::wstring& KeyName) :
+RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, const std::wstring& KeyName) :
RegistryKeyImpl(RootKey, KeyName)
{
}
@@ -73,7 +73,7 @@ RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, const std::wstring& Key
//-----------------------------------------------------
/** Create instance and open the specified Registry key
*/
-RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey) :
+RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey) :
RegistryKeyImpl(RootKey)
{
}
@@ -95,10 +95,10 @@ RegistryKeyImplWinNT::RegistryKeyImplWinNT(HKEY RootKey, HKEY SubKey, const std:
//-----------------------------------------------------
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
size_t RegistryKeyImplWinNT::GetSubValueCount() const
{
@@ -147,37 +147,37 @@ size_t RegistryKeyImplWinNT::GetSubKeyCount() const
/**
*/
StringListPtr RegistryKeyImplWinNT::GetSubKeyNames() const
-{
+{
assert(IsOpen());
wchar_t buff[1024];
- DWORD buff_size = sizeof(buff);
+ DWORD buff_size = sizeof(buff);
FILETIME ftime;
-
+
StringList* key_names = new StringList();
-
+
LONG rc = ERROR_SUCCESS;
for (DWORD i = 0; /* left empty */; i++)
- {
+ {
rc = RegEnumKeyExW(
m_hSubKey, i, buff, &buff_size,
0, 0, 0, &ftime);
-
- if (ERROR_SUCCESS != rc &&
+
+ if (ERROR_SUCCESS != rc &&
ERROR_MORE_DATA != rc)
break;
-
+
buff_size = sizeof(buff);
- key_names->push_back(buff);
+ key_names->push_back(buff);
}
-
+
if (ERROR_INVALID_HANDLE == rc)
throw RegistryIOException(rc);
else if (ERROR_NO_MORE_ITEMS != rc && ERROR_SUCCESS != rc)
throw RegistryException(rc);
-
+
#if (_MSC_VER < 1300) && !defined(__MINGW32__)
return key_names;
#else
@@ -193,7 +193,7 @@ StringListPtr RegistryKeyImplWinNT::GetSubValueNames() const
assert(IsOpen());
wchar_t buff[1024];
- DWORD buff_size = sizeof(buff);
+ DWORD buff_size = sizeof(buff);
StringList* value_names = new StringList();
@@ -204,16 +204,16 @@ StringListPtr RegistryKeyImplWinNT::GetSubValueNames() const
rc = RegEnumValueW(
m_hSubKey, i, buff, &buff_size,
0, 0, 0, 0);
-
- if (ERROR_SUCCESS != rc &&
+
+ if (ERROR_SUCCESS != rc &&
ERROR_MORE_DATA != rc)
break;
buff_size = sizeof(buff);
- value_names->push_back(buff);
+ value_names->push_back(buff);
}
-
+
if (ERROR_INVALID_HANDLE == rc)
throw RegistryIOException(rc);
else if (ERROR_NO_MORE_ITEMS != rc && ERROR_SUCCESS != rc)
@@ -271,7 +271,7 @@ RegistryValue RegistryKeyImplWinNT::GetValue(const std::wstring& Name) const
{
assert(false);
}
-
+
return regval;
}
@@ -324,7 +324,7 @@ RegistryValue RegistryKeyImplWinNT::GetValue(const std::wstring& Name, const Reg
return regval;
}
-
+
//############################################
// Commands
@@ -332,7 +332,7 @@ RegistryValue RegistryKeyImplWinNT::GetValue(const std::wstring& Name, const Reg
//-----------------------------------------------------
-/** Open the registry key, has no effect if
+/** Open the registry key, has no effect if
the key is already open
@precond IsOpen = false
@@ -365,7 +365,7 @@ void RegistryKeyImplWinNT::Open(bool Writeable)
throw RegistryException(rc);
m_IsWriteable = Writeable;
-
+
assert(IsOpen());
}
@@ -405,7 +405,7 @@ RegistryKey RegistryKeyImplWinNT::CreateSubKey(const std::wstring& Name)
HKEY hRoot = IsRootKey() ? m_hRootKey : m_hSubKey;
HKEY hKey;
-
+
LONG rc = RegCreateKeyExW(
hRoot,
Name.c_str(),
@@ -442,16 +442,16 @@ void RegistryKeyImplWinNT::DeleteSubKey(const std::wstring& Name)
assert(IsOpen());
assert(IsWriteable());
assert(HasSubKey(Name));
-
+
RegistryKey SubKey = OpenSubKey(Name);
size_t nSubKeyCount = SubKey->GetSubKeyCount();
-
+
assert(0 == nSubKeyCount);
-
+
if (nSubKeyCount)
throw RegistryInvalidOperationException(ERROR_NOT_SUPPORTED);
-
+
LONG rc = RegDeleteKeyW(m_hSubKey, Name.c_str());
if (ERROR_INVALID_HANDLE == rc)
@@ -499,9 +499,9 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
0,
KEY_READ | DELETE,
&hKey);
-
+
if (ERROR_SUCCESS == rc)
- {
+ {
wchar_t* lpSubKey;
DWORD nMaxSubKeyLen;
@@ -509,7 +509,7 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
hKey, 0, 0, 0, 0,
&nMaxSubKeyLen,
0, 0, 0, 0, 0, 0);
-
+
nMaxSubKeyLen++; // space for trailing '\0'
lpSubKey = reinterpret_cast<wchar_t*>(
@@ -538,7 +538,7 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
} // while
- RegCloseKey(hKey);
+ RegCloseKey(hKey);
} // if
@@ -561,7 +561,7 @@ LONG RegistryKeyImplWinNT::ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx
index 517327f34582..ac93df4f02da 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _REGISTRYWNT_HXX_
#define _REGISTRYWNT_HXX_
@@ -37,17 +37,17 @@
class RegistryKeyImplWinNT : public RegistryKeyImpl
{
-public:
-
+public:
+
//############################################
// Queries
//############################################
/** The number of sub values of the key at hand
-
+
@precond IsOpen = true
- @throws
+ @throws
*/
virtual size_t GetSubValueCount() const;
@@ -58,7 +58,7 @@ public:
@throws
*/
virtual size_t GetSubKeyCount() const;
-
+
virtual StringListPtr GetSubKeyNames() const;
virtual StringListPtr GetSubValueNames() const;
@@ -75,14 +75,14 @@ public:
@precond IsOpen = true
*/
virtual RegistryValue GetValue(const std::wstring& Name, const RegistryValue& Default) const;
-
+
//############################################
// Commands
//############################################
- /** Open the registry key, has no effect if
+ /** Open the registry key, has no effect if
the key is already open
-
+
@precond IsOpen = false
@throws RegistryWriteAccessDenyException
@@ -140,7 +140,7 @@ public:
IsWriteable = true
HasValue(Name) = true
- @throws RegistryIOException
+ @throws RegistryIOException
RegistryWriteAccessDeniedException
RegistryValueNotFoundException
*/
@@ -157,9 +157,9 @@ public:
virtual void SetValue(const RegistryValue& Value);
//############################################
- // Creation
+ // Creation
//
- // only possible through WindowsRegistry class
+ // only possible through WindowsRegistry class
//############################################
protected:
@@ -178,21 +178,21 @@ protected:
RegistryKeyNotFoundException
*/
RegistryKeyImplWinNT(HKEY RootKey);
-
+
/** Create an instances of the specified Registry key,
the key is assumed to be already opened.
*/
RegistryKeyImplWinNT(HKEY RootKey, HKEY SubKey, const std::wstring& KeyName, bool Writeable = true);
-
+
private:
-
+
LONG ImplDeleteSubKeyTree(HKEY RootKey, const std::wstring& Name);
-
+
//prevent copy and assignment
private:
RegistryKeyImplWinNT(const RegistryKeyImplWinNT&);
RegistryKeyImplWinNT& operator=(const RegistryKeyImplWinNT&);
-
+
//######################################
// Friend declarations
//######################################
diff --git a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx
index db38d568e877..84d45532d218 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#include "stringconverter.hxx"
#ifdef _MSC_VER
@@ -44,7 +44,7 @@ std::string UnicodeToAnsiString(const std::wstring& UniString)
{
int len = WideCharToMultiByte(
CP_ACP, 0, UniString.c_str(), -1, 0, 0, 0, 0);
-
+
char* buff = reinterpret_cast<char*>(_alloca(len));
WideCharToMultiByte(
@@ -59,7 +59,7 @@ std::wstring AnsiToUnicodeString(const std::string& AnsiString)
{
int len = MultiByteToWideChar(
CP_ACP, 0, AnsiString.c_str(), -1, 0, 0);
-
+
wchar_t* buff = reinterpret_cast<wchar_t*>(_alloca(len * sizeof(wchar_t)));
MultiByteToWideChar(
diff --git a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx
index c8fcbd56f627..6a23c0e9b7cc 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -25,7 +25,7 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
+
#ifndef _STRINGCONVERTER_HXX_
#define _STRINGCONVERTER_HXX_
diff --git a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx
index 986bf0d28cb6..03a19523d171 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx
@@ -23,7 +23,7 @@ UserRegistrar::UserRegistrar(const RegistrationContextInformation& RegContext) :
}
//###################################
-// Command
+// Command
//###################################
//--------------------------------------
@@ -32,9 +32,9 @@ UserRegistrar::UserRegistrar(const RegistrationContextInformation& RegContext) :
void UserRegistrar::UnregisterAsHtmlEditorForInternetExplorer() const
{
Registrar::UnregisterAsHtmlEditorForInternetExplorer();
-
+
DeleteHtmFileAssociationKeys();
-
+
try
{
RegistryKey RegKey = m_RootKey->OpenSubKey(L"Applications");
@@ -55,30 +55,30 @@ void UserRegistrar::UnregisterAsHtmlEditorForInternetExplorer() const
void UserRegistrar::RegisterAsDefaultShellHtmlEditor() const
{
RegistryKey LocalHtmKey = m_RootKey->CreateSubKey(L".htm");
-
+
if (!LocalHtmKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryKey HKCRKey = WindowsRegistry().GetClassesRootKey();
-
+
if (HKCRKey->HasSubKey(L".htm"))
{
RegistryKey RootHtmKey = HKCRKey->OpenSubKey(L".htm", false);
-
+
if (RootHtmKey->HasValue(DEFAULT_VALUE_NAME))
{
RegistryValue RegVal = RootHtmKey->GetValue(DEFAULT_VALUE_NAME);
-
+
std::wstring RootHtmFwdKey = RegVal->GetDataAsUniString();
-
+
if (HKCRKey->HasSubKey(RootHtmFwdKey))
- {
+ {
m_RootKey->CreateSubKey(RootHtmFwdKey);
LocalHtmKey->CopyValue(RootHtmKey, DEFAULT_VALUE_NAME);
}
}
}
}
-
+
// calling base class method
Registrar::RegisterAsDefaultShellHtmlEditor();
}
@@ -92,7 +92,7 @@ void UserRegistrar::UnregisterAsDefaultShellHtmlEditor() const
Registrar::UnregisterAsDefaultShellHtmlEditor();
DeleteHtmFileAssociationKeys();
}
-
+
//--------------------------------------
/**
*/
@@ -101,11 +101,11 @@ void UserRegistrar::UnregisterForMsOfficeApplication(
{
/// calling base class method
Registrar::UnregisterForMsOfficeApplication(FileExtension);
-
+
if (m_RootKey->HasSubKey(FileExtension))
{
RegistryKey RegKey = m_RootKey->OpenSubKey(FileExtension);
-
+
if ((0 == RegKey->GetSubKeyCount()) && (0 == RegKey->GetSubValueCount()))
{
RegKey->Close();
@@ -123,14 +123,14 @@ RegistryKey UserRegistrar::GetRootKeyForDefHtmlEditorForIERegistration() const
}
//--------------------------------------
-/**
+/**
*/
void UserRegistrar::DeleteHtmFileAssociationKeys() const
{
// Later delete the created keys if they are empty and have not changed meanwhile.
// Remeber: if we create a new registry key in the user part of the
// registry, changes to that key via the merged key HKEY_CLASSES_ROOT
- // go into the user branch HKEY_CURRENT_USER and are not visible for other users.
+ // go into the user branch HKEY_CURRENT_USER and are not visible for other users.
// so we must carefully detect if the keys have not changed in order to prevent accidentally
// deleting a key and so destroying existing associations
// See MSDN: "Merged View of HKEY_CLASSES_ROOT"
diff --git a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx
index f4b674a717e7..653a4790edda 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.hxx
@@ -8,10 +8,10 @@
#include "registrar.hxx"
-class UserRegistrar : public Registrar
+class UserRegistrar : public Registrar
{
public:
-
+
//###################################
// Creation
//###################################
@@ -19,28 +19,28 @@ public:
UserRegistrar(const RegistrationContextInformation& RegContext);
//###################################
- // Command
+ // Command
//###################################
-
+
virtual void UnregisterAsHtmlEditorForInternetExplorer() const;
-
+
virtual void RegisterAsDefaultShellHtmlEditor() const;
virtual void UnregisterAsDefaultShellHtmlEditor() const;
-
+
protected:
virtual void UnregisterForMsOfficeApplication(
const std::wstring& FileExtension) const;
-
+
virtual RegistryKey GetRootKeyForDefHtmlEditorForIERegistration() const;
-
+
private:
-
- /** Delete the privately created file associations
- for htm files if the keys are empty
+
+ /** Delete the privately created file associations
+ for htm files if the keys are empty
*/
void DeleteHtmFileAssociationKeys() const;
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx
index 1e97f779bc39..49a3fdd34892 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx
@@ -15,7 +15,7 @@
//
//------------------------------
-WindowsRegistry::WindowsRegistry()
+WindowsRegistry::WindowsRegistry()
{
OSVERSIONINFOA osverinfo;
ZeroMemory(&osverinfo, sizeof(osverinfo));
@@ -37,7 +37,7 @@ RegistryKey WindowsRegistry::GetClassesRootKey(bool Writeable) const
//------------------------------
//
//------------------------------
-
+
RegistryKey WindowsRegistry::GetCurrentUserKey(bool Writeable) const
{
return GetRegistryKey(HKEY_CURRENT_USER, Writeable);
@@ -68,14 +68,14 @@ RegistryKey WindowsRegistry::GetUserKey(bool Writeable) const
RegistryKey WindowsRegistry::GetRegistryKey(HKEY RootKey, bool Writeable) const
{
RegistryKey regkey;
-
+
if (m_IsWinNT)
regkey = RegistryKey(new RegistryKeyImplWinNT(RootKey));
else
regkey = RegistryKey(new RegistryKeyImplWin9x(RootKey));
regkey->Open(Writeable);
-
+
return regkey;
}
diff --git a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx
index 1b1cb5e2829e..5b2f94047f5e 100644
--- a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx
+++ b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.hxx
@@ -16,15 +16,15 @@
#include "Registry.hxx"
-/** Basically a factory class
+/** Basically a factory class
*/
-class WindowsRegistry
+class WindowsRegistry
{
public:
WindowsRegistry();
-
+
RegistryKey GetClassesRootKey(bool Writeable = true) const;
-
+
RegistryKey GetCurrentUserKey(bool Writeable = true) const;
RegistryKey GetLocalMachineKey(bool Writeable = true) const;
@@ -38,6 +38,6 @@ private:
bool m_IsWinNT;
};
-#endif
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/reg64/reg64.cxx b/setup_native/source/win32/customactions/reg64/reg64.cxx
index fe22ed86b829..2f4b676e7dfb 100644
--- a/setup_native/source/win32/customactions/reg64/reg64.cxx
+++ b/setup_native/source/win32/customactions/reg64/reg64.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,16 +43,16 @@
// 10.11.2009 tkr: MinGW doesn't know anything about RegDeleteKeyExW if WINVER < 0x0502.
extern "C" {
-WINADVAPI LONG WINAPI RegDeleteKeyExW(HKEY,LPCWSTR,REGSAM,DWORD);
+WINADVAPI LONG WINAPI RegDeleteKeyExW(HKEY,LPCWSTR,REGSAM,DWORD);
}
// 06.11.2009 tkr: 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.
+// 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)
+ #define KEY_WOW64_64KEY (0x0100)
#endif
@@ -87,7 +87,7 @@ static inline void OutputDebugStringFormat( const wchar_t*, ... )
bool WriteRegistry( MSIHANDLE & hMSI, OPERATION op, const wchar_t* componentName)
{
INSTALLSTATE current_state;
- INSTALLSTATE comp_state;
+ INSTALLSTATE comp_state;
UINT ret = MsiGetComponentState( hMSI, componentName, &current_state, &comp_state );
if ( ERROR_SUCCESS == ret )
{
@@ -153,7 +153,7 @@ BOOL UnicodeEquals( wchar_t* pStr1, wchar_t* pStr2 )
pStr1++, pStr2++;
return ( *pStr1 == 0 && *pStr2 == 0 );
-}
+}
BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue )
{
@@ -174,11 +174,11 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue )
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" );
+ OutputDebugStringFormat(L"GetMsiProp - ERROR_INVALID_PARAMETER" );
} else if (ret == ERROR_SUCCESS)
{
OutputDebugStringFormat(L"GetMsiProp - ERROR_SUCCESS" );
@@ -187,7 +187,7 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue )
OutputDebugStringFormat(L"GetMsiProp - ENDE\n" );
return FALSE;
-}
+}
bool IsInstallForAllUsers( MSIHANDLE hMSI )
{
@@ -215,9 +215,9 @@ wchar_t* GetBasisInstallLocation( MSIHANDLE hMSI )
return pVal;
}
+
-
-bool QueryReg64Table(MSIHANDLE& rhDatabase, MSIHANDLE& rhView)
+bool QueryReg64Table(MSIHANDLE& rhDatabase, MSIHANDLE& rhView)
{
OutputDebugStringFormat(L"QueryReg64Table - START\n" );
int const arraysize = 400;
@@ -287,9 +287,9 @@ bool SetRegistryKey(HKEY RootKey, const wchar_t* KeyName, const wchar_t* ValueNa
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];
@@ -299,28 +299,28 @@ bool DoRegEntries( MSIHANDLE& rhMSI, OPERATION op, MSIHANDLE& rhView)
/// 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;
-
+ 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))
+
+ if (!MsiRecordIsNull(hRecord, 4))
MsiRecordGetString(hRecord,4,szName,&dwName);
-
+
if (!MsiRecordIsNull(hRecord, 5))
{
- MsiRecordGetString(hRecord,5,szValue,&dwValue);
-
-
-
+ MsiRecordGetString(hRecord,5,szValue,&dwValue);
+
+
+
wchar_t* nPos = wcsstr(szValue , INSTALLLOCATION);
if ( NULL != nPos)
{
@@ -336,21 +336,21 @@ bool DoRegEntries( MSIHANDLE& rhMSI, OPERATION op, MSIHANDLE& rhView)
// 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 *******" );
@@ -390,7 +390,7 @@ bool DoRegEntries( MSIHANDLE& rhMSI, OPERATION op, MSIHANDLE& rhView)
OutputDebugStringFormat(L"Unknown Root!" );
break;
}
-
+
OutputDebugStringFormat(L"Key:");
OutputDebugStringFormat( szKey );
OutputDebugStringFormat(L"Name:");
@@ -403,14 +403,14 @@ bool DoRegEntries( MSIHANDLE& rhMSI, OPERATION op, MSIHANDLE& rhView)
switch (op)
{
case SET:
-
+
if (WriteRegistry(rhMSI, SET, szComponent))
{
OutputDebugStringFormat(L"DoRegEntries - Write\n" );
SetRegistryKey(key, szKey, szName, szValue);
}
break;
- case REMOVE:
+ case REMOVE:
OutputDebugStringFormat(L"DoRegEntries - PreRemove\n" );
if (WriteRegistry(rhMSI, REMOVE, szComponent))
{
@@ -422,10 +422,10 @@ bool DoRegEntries( MSIHANDLE& rhMSI, OPERATION op, MSIHANDLE& rhView)
}
MsiCloseHandle(rhView);
-
-
+
+
OutputDebugStringFormat(L"DoRegEntries - ENDE\n" );
-
+
return true;
}
@@ -440,7 +440,7 @@ bool Reg64(MSIHANDLE& rhMSI, OPERATION op)
OutputDebugStringFormat(L"BASISINSTALLLOCATION is NULL\n" );
return false;
}
-
+
MSIHANDLE hView;
MSIHANDLE hDatabase = MsiGetActiveDatabase(rhMSI);
@@ -460,7 +460,7 @@ extern "C" UINT __stdcall InstallReg64(MSIHANDLE hMSI)
{
OutputDebugStringFormat(L"InstallReg64\n" );
Reg64(hMSI, SET);
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
extern "C" UINT __stdcall DeinstallReg64(MSIHANDLE hMSI)
diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx
index 0cf89eca1ebc..fa4188b88d61 100644
--- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx
+++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -96,7 +96,7 @@ void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallFor
#endif
// For Win98/WinME the values should be written to the local machine
- OSVERSIONINFO aVerInfo;
+ OSVERSIONINFO aVerInfo;
aVerInfo.dwOSVersionInfoSize = sizeof( aVerInfo );
if ( GetVersionEx( &aVerInfo ) && aVerInfo.dwPlatformId != VER_PLATFORM_WIN32_NT )
InstallForAllUser = TRUE;
@@ -132,7 +132,7 @@ void RegisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallFor
void UnregisterActiveXNative( const char* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit )
{
// For Win98/WinME the values should be written to the local machine
- OSVERSIONINFO aVerInfo;
+ OSVERSIONINFO aVerInfo;
aVerInfo.dwOSVersionInfoSize = sizeof( aVerInfo );
if ( GetVersionEx( &aVerInfo ) && aVerInfo.dwPlatformId != VER_PLATFORM_WIN32_NT )
InstallForAllUser = TRUE;
diff --git a/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx b/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx
index 800fde54eab5..258e26b2b5f6 100644
--- a/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx
+++ b/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -53,7 +53,7 @@ BOOL UnicodeEquals( wchar_t* pStr1, wchar_t* pStr2 )
pStr1++, pStr2++;
return ( *pStr1 == 0 && *pStr2 == 0 );
-}
+}
//----------------------------------------------------------
BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue )
diff --git a/setup_native/source/win32/customactions/relnotes/relnotes.cxx b/setup_native/source/win32/customactions/relnotes/relnotes.cxx
index 48aaf9b417bd..e814c1257053 100644
--- a/setup_native/source/win32/customactions/relnotes/relnotes.cxx
+++ b/setup_native/source/win32/customactions/relnotes/relnotes.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -80,7 +80,7 @@ static bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& valu
MsiGetProperty(handle, name, buff, &sz);
value = buff;
return true;
- }
+ }
return false;
}
@@ -90,7 +90,7 @@ static bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& valu
UINT ShowReleaseNotes( TCHAR* pFileName, TCHAR* pFilePath )
{
TCHAR sFullPath[ MAX_PATH ];
-
+
if ( FAILED( StringCchCopy( sFullPath, MAX_PATH, pFilePath ) ) )
{
OutputDebugStringFormat( TEXT("DEBUG: ShowReleaseNotes: Could not copy path [%s]"), pFilePath );
@@ -104,7 +104,7 @@ UINT ShowReleaseNotes( TCHAR* pFileName, TCHAR* pFilePath )
}
HANDLE hFile = CreateFile( sFullPath, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
+
if ( IsValidHandle(hFile) )
{
CloseHandle( hFile );
diff --git a/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx b/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx
index 58159cabd56f..8e4abcca52f1 100644
--- a/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -95,7 +95,7 @@ extern "C" UINT __stdcall CheckInstallDirectory(MSIHANDLE handle)
UnsetMsiProperty( handle, TEXT("DIRECTORY_NOT_EMPTY") );
// 1. Searching for file setup.ini
-
+
std::_tstring sSetupIniPath = sInstallPath + sOfficeHostnamePath + TEXT("\\program\\setup.ini");
WIN32_FIND_DATA data;
@@ -113,7 +113,7 @@ extern "C" UINT __stdcall CheckInstallDirectory(MSIHANDLE handle)
// std::_tstring notEmptyTitle = "Directory not empty";
// MessageBox(NULL, notEmptyStr.c_str(), notEmptyTitle.c_str(), MB_OK);
}
-
+
return ERROR_SUCCESS;
}
diff --git a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
index 01ba1ab13b16..2cfdcfa54f1a 100644
--- a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
diff --git a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
index f50c795c5c8a..0cf8458221aa 100644
--- a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -56,14 +56,14 @@
#include <systools/win32/uwinapi.h>
#include <../tools/seterror.hxx>
-#define WININIT_FILENAME "wininit.ini"
-#define RENAME_SECTION "rename"
+#define WININIT_FILENAME "wininit.ini"
+#define RENAME_SECTION "rename"
#ifdef DEBUG
inline void OutputDebugStringFormat( LPCTSTR pFormat, ... )
{
- _TCHAR buffer[1024];
- va_list args;
+ _TCHAR buffer[1024];
+ va_list args;
va_start( args, pFormat );
_vsntprintf( buffer, SAL_N_ELEMENTS(buffer), pFormat, args );
@@ -77,9 +77,9 @@ static inline void OutputDebugStringFormat( LPCTSTR, ... )
static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -87,14 +87,14 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
-
+
static inline bool IsSetMsiProperty(MSIHANDLE handle, const std::_tstring& sProperty)
-{
+{
std::_tstring value = GetMsiProperty(handle, sProperty);
return (value.length() > 0);
}
@@ -111,30 +111,30 @@ static inline void SetMsiProperty(MSIHANDLE handle, const std::_tstring& sProper
static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWORD dwFlags )
{
- BOOL fSuccess = FALSE; // assume failure
+ BOOL fSuccess = FALSE; // assume failure
// Windows 9x has a special mechanism to move files after reboot
if ( dwFlags & MOVEFILE_DELAY_UNTIL_REBOOT )
{
- CHAR szExistingFileNameA[MAX_PATH];
- CHAR szNewFileNameA[MAX_PATH] = "NUL";
+ CHAR szExistingFileNameA[MAX_PATH];
+ CHAR szNewFileNameA[MAX_PATH] = "NUL";
// Path names in WININIT.INI must be in short path name form
- if (
+ if (
GetShortPathNameA( lpExistingFileNameA, szExistingFileNameA, MAX_PATH ) &&
(!lpNewFileNameA || GetShortPathNameA( lpNewFileNameA, szNewFileNameA, MAX_PATH ))
)
{
- CHAR szBuffer[32767]; // The buffer size must not exceed 32K
- DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME );
+ CHAR szBuffer[32767]; // The buffer size must not exceed 32K
+ DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME );
- CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters
+ CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters
strcpy( szRename, szNewFileNameA );
strcat( szRename, "=" );
strcat( szRename, szExistingFileNameA );
- size_t lnRename = strlen(szRename);
+ size_t lnRename = strlen(szRename);
if ( dwBufLen + lnRename + 2 <= SAL_N_ELEMENTS(szBuffer) )
{
@@ -156,7 +156,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO
if ( !fSuccess && GetLastError() != ERROR_ACCESS_DENIED &&
0 != (dwFlags & (MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING)) )
{
- BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
+ BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
fSuccess = CopyFileA( lpExistingFileNameA, lpNewFileNameA, bFailIfExist );
@@ -179,10 +179,10 @@ static BOOL MoveFileExImpl( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, D
extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
{
- OSVERSIONINFO osverinfo;
+ OSVERSIONINFO osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx( &osverinfo );
-
+
// renaming the vcl resource doesn't work reliable with OS >= Windows Vista
if (osverinfo.dwMajorVersion < 6 )
{
@@ -198,18 +198,18 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
// mystr = "IsOfficeRunning start. Checking file in dir: " + sResourceDir;
// MessageBox( NULL, mystr.c_str(), "IsOfficeRunning", MB_OK );
- WIN32_FIND_DATA aFindFileData;
- HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
if ( IsValidHandle(hFind) )
{
- BOOL fSuccess = false;
- bool fRenameSucceeded;
+ BOOL fSuccess = false;
+ bool fRenameSucceeded;
do
{
- std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
- std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
+ std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
+ std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
fRenameSucceeded = MoveFileExImpl( sResourceFile.c_str(), sIntermediate.c_str(), MOVEFILE_REPLACE_EXISTING );
if ( fRenameSucceeded )
@@ -239,12 +239,12 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
// Property empty -> no office installed
if ( sOfficeInstallPath.length() == 0 )
return ERROR_SUCCESS;
-
+
std::_tstring sRenameSrc = sOfficeInstallPath + TEXT("program");
std::_tstring sRenameDst = sOfficeInstallPath + TEXT("program_test");
-
+
bool bSuccess = MoveFile( sRenameSrc.c_str(), sRenameDst.c_str() );
-
+
if ( bSuccess )
{
MoveFile( sRenameDst.c_str(), sRenameSrc.c_str() );
@@ -258,14 +258,14 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
return ERROR_SUCCESS;
if ( dwError == ERROR_PATH_NOT_FOUND )
return ERROR_SUCCESS;
-
+
// The destination folder should never exist, don't know what to do here
if ( dwError == ERROR_ALREADY_EXISTS )
return ERROR_SUCCESS;
-
- if ( FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
+
+ if ( FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
@@ -279,7 +279,7 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
}
else
OutputDebugStringFormat( TEXT("Error Code %d: Unknown"), dwError );
-
+
MsiSetProperty( handle, TEXT("OFFICERUNS"), TEXT("1") );
SetMsiErrorCode( MSI_ERROR_OFFICE_IS_RUNNING );
}
diff --git a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx
index 7b7453a1f70e..aca931c9c22f 100644
--- a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,22 +41,22 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
using namespace std;
-namespace
+namespace
{
std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -67,7 +67,7 @@ namespace
result = buffer;
}
- return result;
+ return result;
}
} // namespace
@@ -79,49 +79,49 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
// this causes in an update installation, that INSTALLLOCATION is set to "c:\program files",
// so that in an OOo 3.3 or later, the directory "program" or "share" are directly created
// below "c:\program files".
-
- TCHAR szValue[8192];
- DWORD nValueSize = sizeof(szValue);
- HKEY hKey;
- std::_tstring sInstDir;
- std::_tstring mystr;
-
- // Reading property OFFICEDIRHOSTNAME_, that contains the part of the path behind
+
+ TCHAR szValue[8192];
+ DWORD nValueSize = sizeof(szValue);
+ HKEY hKey;
+ std::_tstring sInstDir;
+ std::_tstring mystr;
+
+ // Reading property OFFICEDIRHOSTNAME_, that contains the part of the path behind
// the program files folder.
-
- std::_tstring sInstallLocation = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
- std::_tstring sOfficeDirHostname = GetMsiProperty( handle, TEXT("OFFICEDIRHOSTNAME_") );
-
+
+ std::_tstring sInstallLocation = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
+ std::_tstring sOfficeDirHostname = GetMsiProperty( handle, TEXT("OFFICEDIRHOSTNAME_") );
+
// If sInstallLocation ends with (contains) the string sOfficeDirHostname,
// INSTALLLOCATION is good and nothing has to be done here.
-
+
bool pathCompletionRequired = true;
if ( _tcsstr( sInstallLocation.c_str(), sOfficeDirHostname.c_str() ) )
{
- pathCompletionRequired = false; // nothing to do
+ pathCompletionRequired = false; // nothing to do
// mystr = "Nothing to do, officedir is included into installlocation";
// MessageBox( NULL, mystr.c_str(), "It is part of installlocation", MB_OK );
}
-
+
// If the path INSTALLLOCATION does not end with this string, INSTALLLOCATION is maybe
// transfered from an OOo 3.0, OOo 3.1 and OOo 3.2 and need to be changed therefore.
if ( pathCompletionRequired )
{
- std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
- std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
- std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
+ std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
+ std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
+ std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
// sUpdateVersion can be "3.0", "3.1" or "3.2"
- std::_tstring sProductKey30 = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey30 = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + "3.0" + "\\" + sUpgradeCode;
- std::_tstring sProductKey31 = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey31 = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + "3.1" + "\\" + sUpgradeCode;
- std::_tstring sProductKey32 = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey32 = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + "3.2" + "\\" + sUpgradeCode;
// mystr = "ProductKey: " + sProductKey;
@@ -129,7 +129,7 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
// mystr = "Checking registry";
// MessageBox( NULL, mystr.c_str(), "registry search", MB_OK );
-
+
bool oldVersionExists = false;
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey30.c_str(), &hKey ) )
@@ -140,29 +140,29 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey31.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey32.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey30.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey31.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey32.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
-
+
if ( oldVersionExists )
{
// Adding the new path content sOfficeDirHostname
diff --git a/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx b/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
index c816a71a3de1..c78b2efffe06 100644
--- a/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
index d94b65459d8a..253fa7a2c2ed 100644
--- a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,9 +49,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
diff --git a/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx b/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx
index ffd6ef1a87dd..2cea3de247ec 100644
--- a/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -52,7 +52,7 @@
using namespace std;
-namespace
+namespace
{
string GetMsiProperty(MSIHANDLE handle, const string& sProperty)
{
@@ -121,7 +121,7 @@ Order compareVersions(string const & version1, string const & version2) {
if (e1.size() < e2.size()) {
return ORDER_LESS;
- } else if (e1.size() > e2.size()) {
+ } else if (e1.size() > e2.size()) {
return ORDER_GREATER;
} else if (e1 < e2) {
return ORDER_LESS;
@@ -132,7 +132,7 @@ Order compareVersions(string const & version1, string const & version2) {
return ORDER_EQUAL;
}
-} // namespace
+} // namespace
extern "C" UINT __stdcall DotNetCheck(MSIHANDLE handle) {
string present(GetMsiProperty(handle, TEXT("MsiNetAssemblySupport")));
@@ -151,34 +151,34 @@ extern "C" UINT __stdcall DotNetCheck(MSIHANDLE handle) {
// string result(GetMsiProperty(handle, TEXT("DOTNET_SUFFICIENT")));
// string myText3 = TEXT("DOTNET_SUFFICIENT: ") + result;
// MessageBox(NULL, myText3.c_str(), "DEBUG", MB_OK);
+
-
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
extern "C" UINT __stdcall ShowProperties(MSIHANDLE handle)
{
- string property = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
+ string property = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
string myText = TEXT("INSTALLLOCATION: ") + property;
MessageBox(NULL, myText.c_str(), "INSTALLLOCATION", MB_OK);
- property = GetMsiProperty(handle, TEXT("Installed"));
+ property = GetMsiProperty(handle, TEXT("Installed"));
myText = TEXT("Installed: ") + property;
MessageBox(NULL, myText.c_str(), "Installed", MB_OK);
- property = GetMsiProperty(handle, TEXT("PATCH"));
+ property = GetMsiProperty(handle, TEXT("PATCH"));
myText = TEXT("PATCH: ") + property;
MessageBox(NULL, myText.c_str(), "PATCH", MB_OK);
- property = GetMsiProperty(handle, TEXT("REMOVE"));
+ property = GetMsiProperty(handle, TEXT("REMOVE"));
myText = TEXT("REMOVE: ") + property;
MessageBox(NULL, myText.c_str(), "REMOVE", MB_OK);
- property = GetMsiProperty(handle, TEXT("ALLUSERS"));
+ property = GetMsiProperty(handle, TEXT("ALLUSERS"));
myText = TEXT("ALLUSERS: ") + property;
MessageBox(NULL, myText.c_str(), "ALLUSERS", MB_OK);
-
- return ERROR_SUCCESS;
+
+ return ERROR_SUCCESS;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/shellextensions/iconcache.cxx b/setup_native/source/win32/customactions/shellextensions/iconcache.cxx
index daba7fb8c7d7..9ed419b33374 100644
--- a/setup_native/source/win32/customactions/shellextensions/iconcache.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/iconcache.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,12 +42,12 @@ extern "C" UINT __stdcall RebuildShellIconCache(MSIHANDLE)
{
// Rebuild icon cache on windows OS prior XP
- OSVERSIONINFO osverinfo;
+ OSVERSIONINFO osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (
- GetVersionEx( &osverinfo ) &&
+ if (
+ GetVersionEx( &osverinfo ) &&
VER_PLATFORM_WIN32_NT == osverinfo.dwPlatformId &&
(
5 < osverinfo.dwMajorVersion ||
@@ -58,17 +58,17 @@ extern "C" UINT __stdcall RebuildShellIconCache(MSIHANDLE)
return ERROR_SUCCESS;
}
- HKEY hKey;
- DWORD dwDispostion;
- LONG lError = RegCreateKeyEx( HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop\\WindowMetrics"), 0, NULL, REG_OPTION_VOLATILE, KEY_SET_VALUE | KEY_QUERY_VALUE, NULL, &hKey, &dwDispostion );
+ HKEY hKey;
+ DWORD dwDispostion;
+ LONG lError = RegCreateKeyEx( HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop\\WindowMetrics"), 0, NULL, REG_OPTION_VOLATILE, KEY_SET_VALUE | KEY_QUERY_VALUE, NULL, &hKey, &dwDispostion );
if ( ERROR_SUCCESS == lError )
{
- TCHAR szValue[256];
- TCHAR szTempValue[256];
- DWORD cbValue = sizeof(szValue);
- DWORD dwType;
- int iSize = 0;
+ TCHAR szValue[256];
+ TCHAR szTempValue[256];
+ DWORD cbValue = sizeof(szValue);
+ DWORD dwType;
+ int iSize = 0;
lError = RegQueryValueEx( hKey, TEXT("Shell Icon Size"), 0, &dwType, (LPBYTE)szValue, &cbValue );
@@ -86,7 +86,7 @@ extern "C" UINT __stdcall RebuildShellIconCache(MSIHANDLE)
itoa( iSize + 1, szTempValue, 10 );
lError = RegSetValueEx( hKey, TEXT("Shell Icon Size"), 0, dwType, (LPBYTE)szTempValue, strlen( szTempValue ) + 1 );
- LRESULT lResult = SendMessageTimeout(
+ LRESULT lResult = SendMessageTimeout(
HWND_BROADCAST,
WM_SETTINGCHANGE,
SPI_SETNONCLIENTMETRICS,
diff --git a/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx b/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx
index 11c9757ff921..cab23c6483e7 100644
--- a/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -136,19 +136,19 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
if (IsValidHandle(h1file))
{
DWORD dummy;
-
+
// Converting string into UTF-8 encoding and writing into file "basis-link"
int nCharsRequired = MultiByteToWideChar( CP_ACP, 0, sBasisInstallPath.c_str(), -1, NULL, 0 );
if ( nCharsRequired )
{
- LPWSTR lpPathW = new WCHAR[nCharsRequired];
+ LPWSTR lpPathW = new WCHAR[nCharsRequired];
if ( MultiByteToWideChar( CP_ACP, 0, sBasisInstallPath.c_str(), -1, lpPathW, nCharsRequired ) )
{
nCharsRequired = WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, NULL, 0, NULL, NULL );
if ( nCharsRequired )
{
- LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
+ LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, lpPathUTF8, nCharsRequired, NULL, NULL );
// WriteFile( h1file, sBasisInstallPath.c_str(), sBasisInstallPath.size() ,&dummy, 0 );
@@ -157,7 +157,7 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
delete lpPathUTF8;
}
}
-
+
delete lpPathW;
}
@@ -184,13 +184,13 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
int nCharsRequired = MultiByteToWideChar( CP_ACP, 0, sUreInstallPath.c_str(), -1, NULL, 0 );
if ( nCharsRequired )
{
- LPWSTR lpPathW = new WCHAR[nCharsRequired];
+ LPWSTR lpPathW = new WCHAR[nCharsRequired];
if ( MultiByteToWideChar( CP_ACP, 0, sUreInstallPath.c_str(), -1, lpPathW, nCharsRequired ) )
{
nCharsRequired = WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, NULL, 0, NULL, NULL );
if ( nCharsRequired )
{
- LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
+ LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, lpPathUTF8, nCharsRequired, NULL, NULL );
// WriteFile( h2file, sUreInstallPath.c_str(), sUreInstallPath.size() ,&dummy, 0 );
@@ -199,7 +199,7 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
delete lpPathUTF8;
}
}
-
+
delete lpPathW;
}
@@ -216,7 +216,7 @@ extern "C" UINT __stdcall RemoveLayerLinks(MSIHANDLE handle)
string sOfficeInstallPath = sInstallPath;
string sBasisInstallPath = sInstallPath + TEXT("Basis\\");
string sUreInstallPath = sInstallPath + TEXT("URE\\");
-
+
string sBasisLinkPath = sOfficeInstallPath + TEXT("basis-link");
string sUreLinkPath = sBasisInstallPath + TEXT("ure-link");
string sUreDirName = sUreInstallPath + TEXT("bin");
diff --git a/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx b/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx
index a487309c53f2..7ebad71d9abe 100644
--- a/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,22 +41,22 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
using namespace std;
-namespace
+namespace
{
std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -67,26 +67,26 @@ namespace
result = buffer;
}
- return result;
+ return result;
}
} // namespace
extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
{
- TCHAR szValue[8192];
- DWORD nValueSize = sizeof(szValue);
- HKEY hKey;
- std::_tstring sInstDir;
+ TCHAR szValue[8192];
+ DWORD nValueSize = sizeof(szValue);
+ HKEY hKey;
+ std::_tstring sInstDir;
- std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
- std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
- std::_tstring sUpdateVersion = GetMsiProperty( handle, TEXT("DEFINEDVERSION") );
- std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
+ std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
+ std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
+ std::_tstring sUpdateVersion = GetMsiProperty( handle, TEXT("DEFINEDVERSION") );
+ std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
- std::_tstring sProductKey = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + sUpdateVersion + "\\" + sUpgradeCode;
- std::_tstring mystr;
+ std::_tstring mystr;
mystr = "ProductKey: " + sProductKey;
// MessageBox( NULL, mystr.c_str(), "ProductKey", MB_OK );
@@ -95,10 +95,10 @@ extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
{
sInstDir = szValue;
- MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
+ MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_CURRENT_USER", MB_OK );
}
-
+
RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) )
@@ -106,7 +106,7 @@ extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
{
sInstDir = szValue;
- MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
+ MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_LOCAL_MACHINE", MB_OK );
}
diff --git a/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx b/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx
index d4ac16aec8a3..4a272a564109 100644
--- a/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -41,9 +41,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -52,9 +52,9 @@
static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -62,18 +62,18 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
static BOOL ExecuteCommand( LPCTSTR lpCommand, BOOL bSync )
{
- BOOL fSuccess = FALSE;
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
+ BOOL fSuccess = FALSE;
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
@@ -105,15 +105,15 @@ static BOOL ExecuteCommand( LPCTSTR lpCommand, BOOL bSync )
extern "C" UINT __stdcall ExecutePostUninstallScript( MSIHANDLE handle )
{
- TCHAR szValue[8192];
- DWORD nValueSize = sizeof(szValue);
- HKEY hKey;
- std::_tstring sInstDir;
-
- std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
+ TCHAR szValue[8192];
+ DWORD nValueSize = sizeof(szValue);
+ HKEY hKey;
+ std::_tstring sInstDir;
+
+ std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
// MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK );
-
+
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
{
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
@@ -133,11 +133,11 @@ extern "C" UINT __stdcall ExecutePostUninstallScript( MSIHANDLE handle )
else
return ERROR_SUCCESS;
- std::_tstring sInfFile = sInstDir + TEXT("program\\postuninstall.inf");
- std::_tstring sCommand = _T("RUNDLL32.EXE ");
+ std::_tstring sInfFile = sInstDir + TEXT("program\\postuninstall.inf");
+ std::_tstring sCommand = _T("RUNDLL32.EXE ");
// MessageBox( NULL, sInfFile.c_str(), "Titel", MB_OK );
-
+
if ( (LONG)GetVersion() < 0 )
sCommand += _T("setupx.dll");
else
diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
index 9075436e0412..ca43eea65566 100644
--- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -48,9 +48,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -62,7 +62,7 @@
static std::_tstring createTempFolder()
{
BOOL bExist = FALSE;
- TCHAR szTempName[MAX_PATH];
+ TCHAR szTempName[MAX_PATH];
do
{
bExist = FALSE;
@@ -73,19 +73,19 @@ static std::_tstring createTempFolder()
{
//fprintf (stderr, "GetTempPath failed with error %d.\n", GetLastError());
return TEXT("");
- }
+ }
// Create a temporary file.
UINT uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files
- "upg", // temp file name prefix
- 0, // create unique name
- szTempName); // buffer for name
+ "upg", // temp file name prefix
+ 0, // create unique name
+ szTempName); // buffer for name
if (uRetVal == 0)
{
//fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError());
return TEXT("");
}
//Delete the file
- BOOL bDel = DeleteFile(szTempName);
+ BOOL bDel = DeleteFile(szTempName);
if (FALSE == bDel)
{
//fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError());
@@ -107,7 +107,7 @@ static std::_tstring createTempFolder()
}
}
} while(bExist);
-
+
std::_tstring cur(szTempName);
//make a file URL from the path
std::_tstring ret(TEXT("file:///"));
@@ -132,7 +132,7 @@ static void deleteTempFolder(const std::_tstring& sTempFolder)
//convert the file URL to a path
const std::_tstring path(sTempFolder.substr(8));
std::_tstring path2;
-// MessageBox(NULL, path.c_str(), "del1", MB_OK);
+// MessageBox(NULL, path.c_str(), "del1", MB_OK);
for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++)
{
if (*i == '/')
@@ -147,14 +147,14 @@ static void deleteTempFolder(const std::_tstring& sTempFolder)
size_t size = path2.size();
TCHAR * szTemp2 = new TCHAR[size + 2];
ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR));
- memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
-
+ memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
+
// MessageBox(NULL, szTemp2, "del3", MB_OK);
- SHFILEOPSTRUCT operation =
+ SHFILEOPSTRUCT operation =
{
NULL,
FO_DELETE,
- szTemp2,
+ szTemp2,
NULL,
FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR,
FALSE,
@@ -189,7 +189,7 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
/* creates a child process which is specified in lpCommand.
out_exitCode is the exit code of the child process
-
+
**/
static BOOL ExecuteCommand( LPCTSTR lpCommand, DWORD * out_exitCode)
@@ -217,10 +217,10 @@ static BOOL ExecuteCommand( LPCTSTR lpCommand, DWORD * out_exitCode)
if ( fSuccess )
{
WaitForSingleObject( pi.hProcess, INFINITE );
-
+
if (!GetExitCodeProcess( pi.hProcess, out_exitCode))
fSuccess = FALSE;
-
+
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
@@ -252,7 +252,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
mystr = "Current short file: " + sFileName;
// MessageBox(NULL, mystr.c_str(), "Current Content", MB_OK);
-
+
if (( strcmp(sFileName.c_str(),sCurrentDir.c_str()) != 0 ) &&
( strcmp(sFileName.c_str(),sParentDir.c_str()) != 0 ))
{
@@ -312,7 +312,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
bDirectoryRemoved = false;
}
}
-
+
return bDirectoryRemoved;
}
@@ -342,12 +342,12 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
+ TEXT(" -env:UserInstallation=") + sTempFolder;
mystr = "Command: " + sCommand;
//MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
-
+
DWORD exitCode = 0;
bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode);
deleteTempFolder(sTempFolder);
-
+
// if ( fSuccess )
// {
// mystr = "Executed successfully!";
@@ -358,7 +358,7 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
// mystr = "An error occured during execution!";
// MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
// }
-
+
FindClose( hFindUnopkg );
}
// else
@@ -382,10 +382,10 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
DWORD nValueSize = sizeof(szValue);
HKEY hKey;
std::_tstring sInstDir;
-
+
std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
//MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK );
-
+
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
{
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
@@ -410,7 +410,7 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
// Removing complete directory "Basis\presets\bundled"
std::_tstring sCacheDir = sInstDir + TEXT("share\\prereg\\bundled");
-
+
bool fSuccess = RemoveCompleteDirectory( sCacheDir );
// if ( fSuccess )
diff --git a/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx b/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx
index f9dfc5cb99bc..616eeff7b7dc 100644
--- a/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
diff --git a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
index c26b0ca0d0c2..502db5e97d49 100644
--- a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -27,51 +27,51 @@
************************************************************************/
/*
- Windows shell extensions need to be approved in order to be used by the
+ 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
+ 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
+ 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.
+ 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
+ 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}"="OpenOffice.org Column Handler"
"{087B3AE3-E237-4467-B8DB-5A38AB959AC9}"="OpenOffice.org Infotip Handler"
"{63542C48-9552-494A-84F7-73AA6A7C99C1}"="OpenOffice.org Property Sheet Handler"
"{3B092F0C-7696-40E3-A80F-68D74DA84210}"="OpenOffice.org Thumbnail Viewer"
-
- These shell extensions are implemented in the 'shell' project. We ignore registration
+
+ 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.
+ 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
@@ -116,7 +116,7 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue )
}
return FALSE;
-}
+}
bool IsVersionNT64( MSIHANDLE hMSI )
{
@@ -149,48 +149,48 @@ extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE hMSI)
// 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)
+ #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);
-
+ {
+ 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 maschine
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);
-
+ {
+ 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);
-
+ {
+ 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;
+ return ERROR_SUCCESS;
}
/*
@@ -207,7 +207,7 @@ extern "C" UINT __stdcall DeinstallExecSequenceEntry(MSIHANDLE)
RegDeleteValue(hKey, InfotipHandler.Key);
RegDeleteValue(hKey, PropHandler.Key);
RegDeleteValue(hKey, ThumbViewer.Key);
-
+
RegCloseKey(hKey);
}
return ERROR_SUCCESS;
diff --git a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx
index 9c5e6d4eb416..c7bffcdbaf59 100644
--- a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -42,9 +42,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -52,9 +52,9 @@
std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -62,10 +62,10 @@ std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
/*
@@ -74,28 +74,28 @@ std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
*/
extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
{
- std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
+ std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
std::_tstring sDesktopFile = sOfficeMenuFolder + TEXT("Desktop.ini");
-
+
// MessageBox(NULL, sDesktopFile.c_str(), TEXT("OfficeMenuFolder"), MB_OK | MB_ICONINFORMATION);
-
- std::_tstring sIconFile = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ) + TEXT("program\\soffice.exe");
-
- OSVERSIONINFO osverinfo;
+
+ std::_tstring sIconFile = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ) + TEXT("program\\soffice.exe");
+
+ OSVERSIONINFO osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx( &osverinfo );
-
+
if (osverinfo.dwMajorVersion < 6 /* && osverinfo.dwMinorVersion */ )
{
// This icon (18) is a Windows folder until XP Version (number is 0 based)
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("IconFile"),
sIconFile.c_str(),
sDesktopFile.c_str() );
-
+
// FYI: in tool 'ResHack' this icon can be found on position '19' (number is 1 based)
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("IconIndex"),
TEXT("18"),
@@ -106,32 +106,32 @@ extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
// // at the moment there exists no Vista Icon, so we use the default folder icon.
// // add the icon into desktop/util/verinfo.rc
// }
-
+
// The value '0' is to avoid a message like "You Are Deleting a System Folder" warning when deleting or moving the folder.
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("ConfirmFileOp"),
TEXT("0"),
sDesktopFile.c_str() );
-
+
/*
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("InfoTip"),
TEXT("StarOffice Productivity Suite"),
sDesktopFile.c_str() );
*/
-
+
SetFileAttributes( sDesktopFile.c_str(), FILE_ATTRIBUTE_HIDDEN );
SetFileAttributes( sOfficeMenuFolder.c_str(), FILE_ATTRIBUTE_SYSTEM );
-
-
- return ERROR_SUCCESS;
+
+
+ return ERROR_SUCCESS;
}
extern "C" UINT __stdcall DeinstallStartmenuFolderIcon(MSIHANDLE handle)
{
- std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
+ std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
std::_tstring sDesktopFile = sOfficeMenuFolder + TEXT("Desktop.ini");
SetFileAttributes( sDesktopFile.c_str(), FILE_ATTRIBUTE_NORMAL );
diff --git a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx
index 6280bfb5b2e5..2efd60ad868a 100644
--- a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -49,82 +49,82 @@
using namespace std;
-namespace
+namespace
{
// The provided GUID must be without surounding '{}'
string GetGuidPart(const string& guid, int index)
{
- assert((guid.length() == 36) && "No GUID or wrong format!");
+ assert((guid.length() == 36) && "No GUID or wrong format!");
assert(((index > -1) && (index < 5)) && "Out of range!");
-
+
if (index == 0) return string(guid.c_str(), 8);
if (index == 1) return string(guid.c_str() + 9, 4);
if (index == 2) return string(guid.c_str() + 14, 4);
if (index == 3) return string(guid.c_str() + 19, 4);
if (index == 4) return string(guid.c_str() + 24, 12);
-
+
return string();
}
-
+
void Swap(char* p1, char* p2)
{
char tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
-
+
string Invert(const string& str)
{
char* buff = reinterpret_cast<char*>(_alloca(str.length()));
strncpy(buff, str.c_str(), str.length());
-
+
char* front = buff;
char* back = buff + str.length() - 1;
-
- while (front < back)
- Swap(front++, back--);
-
- return string(buff, str.length());
+
+ while (front < back)
+ Swap(front++, back--);
+
+ return string(buff, str.length());
}
-
+
// Convert the upgrade code (which is a GUID) according
// to the way the windows installer does when writing it
// to the registry
- // The first 8 bytes will be inverted, from the the last
+ // The first 8 bytes will be inverted, from the the last
// 8 bytes always the nibbles will be inverted for further
- // details look in the MSDN under compressed registry keys
+ // details look in the MSDN under compressed registry keys
string ConvertGuid(const string& guid)
{
string convertedGuid;
-
+
string part = GetGuidPart(guid, 0);
convertedGuid = Invert(part);
-
+
part = GetGuidPart(guid, 1);
convertedGuid += Invert(part);
-
+
part = GetGuidPart(guid, 2);
convertedGuid += Invert(part);
-
+
part = GetGuidPart(guid, 3);
convertedGuid += Invert(string(part.c_str(), 2));
convertedGuid += Invert(string(part.c_str() + 2, 2));
-
- part = GetGuidPart(guid, 4);
+
+ part = GetGuidPart(guid, 4);
int pos = 0;
for (int i = 0; i < 6; i++)
{
convertedGuid += Invert(string(part.c_str() + pos, 2));
- pos += 2;
+ pos += 2;
}
return convertedGuid;
}
-
+
string GetMsiProperty(MSIHANDLE handle, const string& sProperty)
{
- string result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ string result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if (MsiGetProperty(handle, sProperty.c_str(), szDummy, &nChars) == ERROR_MORE_DATA)
{
@@ -132,13 +132,13 @@ namespace
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
inline bool IsSetMsiProperty(MSIHANDLE handle, const string& sProperty)
- {
+ {
return (GetMsiProperty(handle, sProperty).length() > 0);
}
@@ -157,51 +157,51 @@ namespace
{
HKEY hKey;
if (RegOpenKey(hRootKey, regKey.c_str(), &hKey) == ERROR_SUCCESS)
- {
+ {
DWORD nSubKeys;
DWORD lLongestSubKey;
-
+
if (RegQueryInfoKey(
hKey, NULL, NULL, NULL, &nSubKeys, &lLongestSubKey, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(lLongestSubKey + 1));
-
+
for (DWORD i = 0; i < nSubKeys; i++)
- {
- LONG ret = RegEnumKey(hKey, i, buffer, lLongestSubKey + 1);
- if ((ret == ERROR_SUCCESS) && (buffer == upgradeKey))
+ {
+ LONG ret = RegEnumKey(hKey, i, buffer, lLongestSubKey + 1);
+ if ((ret == ERROR_SUCCESS) && (buffer == upgradeKey))
return true;
}
}
}
return false;
}
-} // namespace
+} // namespace
extern "C" UINT __stdcall SetProductInstallMode(MSIHANDLE handle)
{
- string upgradeCode = GetMsiProperty(handle, TEXT("UpgradeCode"));
+ string upgradeCode = GetMsiProperty(handle, TEXT("UpgradeCode"));
upgradeCode = ConvertGuid(string(upgradeCode.c_str() + 1, upgradeCode.length() - 2));
-
- //MessageBox(NULL, upgradeCode.c_str(), TEXT("Debug"), MB_OK);
-
+
+ //MessageBox(NULL, upgradeCode.c_str(), TEXT("Debug"), MB_OK);
+
if (RegistryKeyHasUpgradeSubKey(
- HKEY_CURRENT_USER,
+ HKEY_CURRENT_USER,
TEXT("Software\\Microsoft\\Installer\\UpgradeCodes"),
upgradeCode) && IsSetMsiProperty(handle, TEXT("ALLUSERS")))
- {
+ {
UnsetMsiProperty(handle, TEXT("ALLUSERS"));
//MessageBox(NULL, "ALLUSERS removed", "DEBUG", MB_OK);
}
else if (RegistryKeyHasUpgradeSubKey(
- HKEY_LOCAL_MACHINE,
+ HKEY_LOCAL_MACHINE,
TEXT("Software\\Classes\\Installer\\UpgradeCodes"),
upgradeCode) && !IsSetMsiProperty(handle, TEXT("ALLUSERS")))
{
SetMsiProperty(handle, TEXT("ALLUSERS"));
//MessageBox(NULL, "ALLUSERS set", "DEBUG", MB_OK);
- }
- return ERROR_SUCCESS;
+ }
+ return ERROR_SUCCESS;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
index badd20ae241e..3c8e3483ec30 100644
--- a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -116,7 +116,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
mystr = "Current short file: " + sFileName;
// MessageBox(NULL, mystr.c_str(), "Current Content", MB_OK);
-
+
if (( strcmp(sFileName.c_str(),sCurrentDir.c_str()) != 0 ) &&
( strcmp(sFileName.c_str(),sParentDir.c_str()) != 0 ))
{
@@ -176,7 +176,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
bDirectoryRemoved = false;
}
}
-
+
return bDirectoryRemoved;
}
@@ -221,7 +221,7 @@ extern "C" UINT __stdcall RemovePrgFolder( MSIHANDLE handle )
std::_tstring sRemoveDir = sOfficeInstallPath + TEXT("program_old");
// MessageBox(NULL, sRemoveDir.c_str(), "REMOVING OLD DIR", MB_OK);
-
+
bool bSuccess = RemoveCompleteDirectory( sRemoveDir );
TCHAR sAppend[2] = TEXT("0");
diff --git a/setup_native/source/win32/customactions/tools/checkversion.cxx b/setup_native/source/win32/customactions/tools/checkversion.cxx
index b978301fb57a..044a00533c87 100644
--- a/setup_native/source/win32/customactions/tools/checkversion.cxx
+++ b/setup_native/source/win32/customactions/tools/checkversion.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/setup_native/source/win32/customactions/tools/seterror.cxx b/setup_native/source/win32/customactions/tools/seterror.cxx
index c9c74ec43d18..0927283be28a 100644
--- a/setup_native/source/win32/customactions/tools/seterror.cxx
+++ b/setup_native/source/win32/customactions/tools/seterror.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/setup_native/source/win32/customactions/tools/seterror.hxx b/setup_native/source/win32/customactions/tools/seterror.hxx
index 3a2a1b047d9f..abc76cac8151 100644
--- a/setup_native/source/win32/customactions/tools/seterror.hxx
+++ b/setup_native/source/win32/customactions/tools/seterror.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
diff --git a/setup_native/source/win32/stwrapper/stwrapper.cxx b/setup_native/source/win32/stwrapper/stwrapper.cxx
index b4e22cf7afca..210b5fb82c4f 100644
--- a/setup_native/source/win32/stwrapper/stwrapper.cxx
+++ b/setup_native/source/win32/stwrapper/stwrapper.cxx
@@ -32,8 +32,8 @@ static const TCHAR g_szSTExecutable[256] = TEXT("stclient.exe");
LONG RegReadValue( HKEY hBaseKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPVOID lpData, DWORD cbData )
{
- HKEY hKey = NULL;
- LONG lResult( 0 );
+ HKEY hKey = NULL;
+ LONG lResult( 0 );
lResult = RegOpenKeyEx( hBaseKey, lpSubKey, 0, KEY_QUERY_VALUE, &hKey );
@@ -74,7 +74,7 @@ static bool IsSupportedPlatform()
{
case VER_PLATFORM_WIN32_NT: // Windows NT based
return true;
-
+
case VER_PLATFORM_WIN32_WINDOWS: // Windows Me/98/95.
case VER_PLATFORM_WIN32s: // Win32s
return false;
@@ -181,16 +181,16 @@ static bool GetProgramFilesFolder( LPTSTR strPath )
if (( hLibrary = LoadLibrary( "shell32.dll" )) != NULL )
{
BOOL (WINAPI *pSHGetSpecialFolderPathA)( HWND, LPSTR, int, BOOL );
-
+
pSHGetSpecialFolderPathA = (BOOL (WINAPI *)(HWND, LPSTR, int, BOOL))GetProcAddress( hLibrary, "SHGetSpecialFolderPathA" );
-
+
if ( pSHGetSpecialFolderPathA )
{
if ( pSHGetSpecialFolderPathA( NULL, strPath, CSIDL_PROGRAM_FILES, TRUE ))
bRet = true;
}
}
-
+
FreeLibrary( hLibrary );
return ( bRet );
@@ -202,7 +202,7 @@ static PathResult RetrieveExecutablePath( LPTSTR szExecutablePath )
{
PathResult eRet = PATHRESULT_API_NOT_SUPPORTED;
TCHAR szProgramFilesFolder[MAX_PATH];
-
+
if ( GetProgramFilesFolder( szProgramFilesFolder ))
{
size_t nLen = _tcslen( szProgramFilesFolder );
@@ -236,19 +236,19 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
{
const DWORD ERR_NO_RECORDS_FOUND = 225;
const DWORD ERR_DUP_RECORD = 226;
-
+
DWORD dwExitCode = (DWORD)1;
int nArgs = 0;
LPTSTR* lpArgs = GetCommandArgs( &nArgs );
-
+
if ( !IsSupportedPlatform() )
{
// Return 0 for a successful run on not supported platforms
// We don't want that the Office tries to start us forever.
- return 0;
+ return 0;
}
-
+
if ( nArgs >= 11 )
{
TCHAR szTargetURN[1024] = {0};
@@ -260,11 +260,11 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
// -i) INSTANCE_URN="$2"; shift;;
// -t) TARGET_URN="$2"; shift;;
-// -p) PRODUCT_NAME="$2"; shift;;
-// -e) PRODUCT_VERSION="$2"; shift;;
-// -P) PARENT_PRODUCT_NAME="$2"; shift;;
-// -S) PRODUCT_SOURCE="$2"; shift;;
-// "usage: $0 [-i <instance urn>] -p <product name> -e <product version> -t <urn> -S <source> -P <parent product name>"
+// -p) PRODUCT_NAME="$2"; shift;;
+// -e) PRODUCT_VERSION="$2"; shift;;
+// -P) PARENT_PRODUCT_NAME="$2"; shift;;
+// -S) PRODUCT_SOURCE="$2"; shift;;
+// "usage: $0 [-i <instance urn>] -p <product name> -e <product version> -t <urn> -S <source> -P <parent product name>"
int i = 1;
while ( i < nArgs )
@@ -283,10 +283,10 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
SafeCopy( szInstanceURN, lpArgs[i], SAL_N_ELEMENTS( szInstanceURN ));
break;
}
-
+
case 't':
{
- if ( i < nArgs )
+ if ( i < nArgs )
++i;
SafeCopy( szTargetURN, lpArgs[i], SAL_N_ELEMENTS( szTargetURN ));
break;
@@ -325,7 +325,7 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
} // switch
}
}
-
+
++i;
}
@@ -333,15 +333,15 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
{
BOOL bSuccess = TRUE;
BOOL bProcessStarted = FALSE;
-
+
STARTUPINFO aStartupInfo;
- PROCESS_INFORMATION aProcessInfo;
+ PROCESS_INFORMATION aProcessInfo;
LPTSTR lpCommandLine = 0;
-
+
ZeroMemory( &aStartupInfo, sizeof( aStartupInfo ));
aStartupInfo.cb = sizeof( aStartupInfo );
ZeroMemory( &aProcessInfo, sizeof( aProcessInfo ));
-
+
if ( _tcslen( szInstanceURN ) == 0 )
{
// TEST=`${STCLIENT} -f -t ${TARGET_URN}`
@@ -367,12 +367,12 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
NULL,
&aStartupInfo,
&aProcessInfo );
-
+
bProcessStarted = TRUE;
-
+
// wait until process ends to receive exit code
WaitForSingleObject( aProcessInfo.hProcess, INFINITE );
-
+
delete []lpCommandLine;
}
@@ -430,11 +430,11 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
_tcscat( lpCommandLine, GetOperatingSystemString() );
_tcscat( lpCommandLine, TEXT( "\"" ));
_tcscat( lpCommandLine, TEXT( " -z global" ));
-
+
ZeroMemory( &aStartupInfo, sizeof( aStartupInfo ));
aStartupInfo.cb = sizeof(aStartupInfo);
ZeroMemory( &aProcessInfo, sizeof( aProcessInfo ));
-
+
bSuccess = CreateProcess(
NULL,
lpCommandLine,
@@ -446,19 +446,19 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
NULL,
&aStartupInfo,
&aProcessInfo );
-
+
delete []lpCommandLine;
-
+
// wait until process ends to receive exit code
WaitForSingleObject( aProcessInfo.hProcess, INFINITE );
-
+
dwSTClientExitCode = 0;
GetExitCodeProcess( aProcessInfo.hProcess, &dwSTClientExitCode );
dwSTClientExitCode &= 0x000000ff;
CloseHandle( aProcessInfo.hProcess );
CloseHandle( aProcessInfo.hThread );
-
+
if ( !bSuccess )
dwExitCode = 1; // couldn't start stclient process
else
@@ -490,7 +490,7 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int )
}
else
dwExitCode = 0; // wrong number of arguments
-
+
return dwExitCode;
}