summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2011-01-05 15:54:17 +0100
committerVladimir Glazunov <vg@openoffice.org>2011-01-05 15:54:17 +0100
commit08bc345be049c400fa216dd65829a70de383be93 (patch)
treea33d31a8f1e50a1d2617a93a7d185faf8027d7ea
parente6d5491a9c3a9a1a4f01064ae7819d1d73cd13fc (diff)
parentc2ccafd7a292593c89ff3f3bdde88933df536167 (diff)
CWS-TOOLING: integrate CWS jl160
-rw-r--r--setup_native/scripts/admin.pl2
-rwxr-xr-xsetup_native/source/packinfo/shellscripts_extensions.txt168
-rw-r--r--setup_native/source/win32/customactions/shellextensions/registerextensions.cxx208
3 files changed, 109 insertions, 269 deletions
diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl
index ea186f5a8ba4..1aed8214cb30 100644
--- a/setup_native/scripts/admin.pl
+++ b/setup_native/scripts/admin.pl
@@ -1127,7 +1127,7 @@ sub register_extensions_sync
$preregdir =~ s/\/\s*$//g;
- my $systemcall = $executable . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file:///" . $preregdir . "\"" . " -env:UserInstallation=file:///" . $localtemppath . " 2\>\&1 |";
+ my $systemcall = $executable . " sync --verbose 2\>\&1 |";
print "... $systemcall\n";
diff --git a/setup_native/source/packinfo/shellscripts_extensions.txt b/setup_native/source/packinfo/shellscripts_extensions.txt
index c73e7fae5838..0be870990b71 100755
--- a/setup_native/source/packinfo/shellscripts_extensions.txt
+++ b/setup_native/source/packinfo/shellscripts_extensions.txt
@@ -2,26 +2,6 @@
%postinstall << END
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/usr/bin/mktemp" ]
-then
- INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
-
#
# Need to check diskless service install and make sure use the correct unpkg
#
@@ -38,7 +18,7 @@ fi
if [ -x $$POSTRUN ]; then
( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
echo "umask 022"
- echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'"
+ echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync"
echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
) | $$POSTRUN -b -c UNOPKG
if [ "$$?" != "0" ]; then
@@ -48,7 +28,7 @@ if [ -x $$POSTRUN ]; then
fi
else
# No postrun available, try running unopkg directly
- "$$UNOPKG" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$UNOPKG" sync
find "$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
if [ "$$?" != "0" ]; then
echo "\nERROR: Installation of UNO extensions failed."
@@ -58,48 +38,23 @@ else
fi
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%postremove << END
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/usr/bin/mktemp" ]
-then
- INSTDIR=`/usr/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
-
# Use postrun command on Solaris where available (OpenSolaris)
if [ -x $$PKG_INSTALL_ROOT/usr/lib/postrun ]; then
( echo "test -x \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" || exit 0"
echo "cd \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program\""
echo "umask 022"
- echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync \"-env:BUNDLED_EXTENSIONS_USER=file:////$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" \"-env:UserInstallation=file:////$$INSTDIR\" '-env:UNO_JAVA_JFW_INSTALL_DATA=\$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'"
+ echo "\"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg\" sync"
echo "find \"$$CLIENT_BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
- echo "rm -rf \"$$INSTDIR\""
) | $$PKG_INSTALL_ROOT/usr/lib/postrun -c UNOPKG
else
# No postrun available, try running unopkg directly
test -x $$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg || exit 0
- "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////////$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$BASEDIR/PRODUCTDIRECTORYNAME/program/unopkg" sync
echo "find \"$$BASEDIR/PRODUCTDIRECTORYNAME/share/prereg/bundled\" -type f -exec chmod 644 {} \\;"
if [ "$$?" != "0" ]; then
echo "\nERROR: Removal of UNO extension failed."
@@ -109,9 +64,6 @@ else
fi
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
exit 0
END
@@ -121,151 +73,47 @@ END
%format rpm
%postinstall << END
-#Find the temp dir
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
- "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync
find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%postremove << END
-#Find the temp dir
-if [ -n "$$TMPDIR" ]; then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]; then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]; then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" ]; then
- "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file:////$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file:////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/program/unopkg" sync
find "$$RPM_INSTALL_PREFIX/PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]; then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%format deb
%postinstall << END
-#Find the temp dir
-if [ -n "$$TMPDIR" ]
-then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]
-then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]
-then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]; then
- "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "PRODUCTDIRECTORYNAME/program/unopkg" sync
find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]
-then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
%postremove << END
-# Find the temp dir
-if [ -n "$$TMPDIR" ]
-then
- UNOPKGTMP="$$TMPDIR"
-elif [ -n "$$TMP" ]
-then
- UNOPKGTMP="$$TMP"
-elif [ -d "/tmp" ]
-then
- UNOPKGTMP="/tmp"
-else
- echo "No tmp directory found!"
- exit 1
-fi
-
-#Create the command which creates a temporary directory
-if [ -x "/bin/mktemp" ]
-then
- INSTDIR=`/bin/mktemp -d "$${UNOPKGTMP}/userinstall.XXXXXX"`
-else
- INSTDIR="$${UNOPKGTMP}/userinstall.$$$$"
- mkdir "$$INSTDIR"
-fi
if [ -x "PRODUCTDIRECTORYNAME/program/unopkg" ]
then
- "PRODUCTDIRECTORYNAME/program/unopkg" sync "-env:BUNDLED_EXTENSIONS_USER=file://////PRODUCTDIRECTORYNAME/share/prereg/bundled" "-env:UserInstallation=file://////$$INSTDIR" '-env:UNO_JAVA_JFW_INSTALL_DATA=$$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ "PRODUCTDIRECTORYNAME/program/unopkg" sync
find "PRODUCTDIRECTORYNAME/share/prereg/bundled" -type f -exec chmod 644 {} \;
fi
-if [ -n "$$INSTDIR" ]
-then
- rm -rf "$$INSTDIR"
-fi
-
exit 0
END
diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
index 9eaad6959a63..9a748e9f2008 100644
--- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
@@ -58,112 +58,112 @@
The returned string is a file URL.
*/
-static std::_tstring createTempFolder()
-{
- BOOL bExist = FALSE;
- TCHAR szTempName[MAX_PATH];
- do
- {
- bExist = FALSE;
- // Get the temp path.
- TCHAR lpPathBuffer[MAX_PATH];
- DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer);
- if (dwRetVal > MAX_PATH || (dwRetVal == 0))
- {
- //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
- if (uRetVal == 0)
- {
- //fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError());
- return TEXT("");
- }
- //Delete the file
- BOOL bDel = DeleteFile(szTempName);
- if (FALSE == bDel)
- {
- //fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError());
- return TEXT("");
- }
- // Create the directory
- BOOL bDir = CreateDirectory(szTempName, NULL);
- if (FALSE == bDir)
- {
- DWORD error =GetLastError();
- if (ERROR_ALREADY_EXISTS == error)
- {
- bExist = TRUE;
- }
- else
- {
- //fprintf(stderr, "CreateDirectory failed with error %d.\n", error);
- return TEXT("");
- }
- }
- } while(bExist);
+// static std::_tstring createTempFolder()
+// {
+// BOOL bExist = FALSE;
+// TCHAR szTempName[MAX_PATH];
+// do
+// {
+// bExist = FALSE;
+// // Get the temp path.
+// TCHAR lpPathBuffer[MAX_PATH];
+// DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer);
+// if (dwRetVal > MAX_PATH || (dwRetVal == 0))
+// {
+// //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
+// if (uRetVal == 0)
+// {
+// //fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError());
+// return TEXT("");
+// }
+// //Delete the file
+// BOOL bDel = DeleteFile(szTempName);
+// if (FALSE == bDel)
+// {
+// //fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError());
+// return TEXT("");
+// }
+// // Create the directory
+// BOOL bDir = CreateDirectory(szTempName, NULL);
+// if (FALSE == bDir)
+// {
+// DWORD error =GetLastError();
+// if (ERROR_ALREADY_EXISTS == error)
+// {
+// bExist = TRUE;
+// }
+// else
+// {
+// //fprintf(stderr, "CreateDirectory failed with error %d.\n", error);
+// return TEXT("");
+// }
+// }
+// } while(bExist);
- std::_tstring cur(szTempName);
- //make a file URL from the path
- std::_tstring ret(TEXT("file:///"));
- for (std::_tstring::iterator i = cur.begin(); i != cur.end(); i++)
- {
- if (*i == '\\')
- ret.append(TEXT("/"));
- else
- ret.push_back(*i);
- }
-// MessageBox(NULL, ret.c_str(), "createTempFolder", MB_OK);
- return ret.c_str();
-}
+// std::_tstring cur(szTempName);
+// //make a file URL from the path
+// std::_tstring ret(TEXT("file:///"));
+// for (std::_tstring::iterator i = cur.begin(); i != cur.end(); i++)
+// {
+// if (*i == '\\')
+// ret.append(TEXT("/"));
+// else
+// ret.push_back(*i);
+// }
+// // MessageBox(NULL, ret.c_str(), "createTempFolder", MB_OK);
+// return ret.c_str();
+// }
/** deletes the temporary folder.
The argument must be a file URL.
*/
-static void deleteTempFolder(const std::_tstring& sTempFolder)
-{
- if (sTempFolder.size() == 0)
- return;
- //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);
- for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++)
- {
- if (*i == '/')
- path2.append(TEXT("\\"));
- else
- path2.push_back(*i);
- }
+// static void deleteTempFolder(const std::_tstring& sTempFolder)
+// {
+// if (sTempFolder.size() == 0)
+// return;
+// //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);
+// for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++)
+// {
+// if (*i == '/')
+// path2.append(TEXT("\\"));
+// else
+// path2.push_back(*i);
+// }
- //We need a null terminated string with two nulls in the end
- //for the SHFILEOPSTRUCT
- const TCHAR * szTemp = path2.c_str();
- size_t size = path2.size();
- TCHAR * szTemp2 = new TCHAR[size + 2];
- ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR));
- memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
+// //We need a null terminated string with two nulls in the end
+// //for the SHFILEOPSTRUCT
+// const TCHAR * szTemp = path2.c_str();
+// size_t size = path2.size();
+// TCHAR * szTemp2 = new TCHAR[size + 2];
+// ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR));
+// memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
-// MessageBox(NULL, szTemp2, "del3", MB_OK);
- SHFILEOPSTRUCT operation =
- {
- NULL,
- FO_DELETE,
- szTemp2,
- NULL,
- FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR,
- FALSE,
- NULL,
- NULL
- };
-
- SHFileOperation( &operation);
- delete [] szTemp2;
-}
+// // MessageBox(NULL, szTemp2, "del3", MB_OK);
+// SHFILEOPSTRUCT operation =
+// {
+// NULL,
+// FO_DELETE,
+// szTemp2,
+// NULL,
+// FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR,
+// FALSE,
+// NULL,
+// NULL
+// };
+
+// SHFileOperation( &operation);
+// delete [] szTemp2;
+// }
@@ -332,21 +332,13 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
if ( hFindUnopkg != INVALID_HANDLE_VALUE )
{
// unopkg.exe exists in program directory
-
- const std::_tstring sTempFolder(createTempFolder());
- std::_tstring sCommandPart1 = sUnoPkgFile + " sync";
- std::_tstring sCommand = sCommandPart1
- + TEXT(" -env:BUNDLED_EXTENSIONS_USER=$BRAND_BASE_DIR/share/prereg/bundled")
- + TEXT(" -env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml")
- + TEXT(" -env:UserInstallation=") + sTempFolder;
+ std::_tstring sCommand = sUnoPkgFile + " sync";
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!";