ooo-build r11587 - in trunk: . patches/src680



Author: tml
Date: Thu Feb 14 21:09:09 2008
New Revision: 11587
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11587&view=rev

Log:
2008-02-14  Tor Lillqvist  <tml novell com>

	* patches/src680/novell-win32-msi-patchability.diff: Improve the
	fileversion program a bit: Make sure it always passes a full
	pathname to GetFileVersionInfo(). Should not be relevant for the
	use of fileversion when building the OOo installer, as in that use
	case it's already full pathnames that are passed on the command
	line to fileversion.

	But fileversion can be run interactively too, and this change
	avoids strange surprises if one gives a name of a DLL in the
	current directory and the same DLL happens to be found first in a
	folder that is searched by GetFileVersionInfo() (or LoadLibrary())
	before the current directory. Case in point: On XP gdiplus.dll is
	found in a side-by-side folder even though a copy of it exists in
	the current folder. Note that there is no gdiplus.dll in the
	system32 folder, or anywhere in PATH.



Modified:
   trunk/ChangeLog
   trunk/patches/src680/novell-win32-msi-patchability.diff

Modified: trunk/patches/src680/novell-win32-msi-patchability.diff
==============================================================================
--- trunk/patches/src680/novell-win32-msi-patchability.diff	(original)
+++ trunk/patches/src680/novell-win32-msi-patchability.diff	Thu Feb 14 21:09:09 2008
@@ -38,7 +38,7 @@
 +.INCLUDE : target.mk
 --- /dev/null
 +++ soltools/fileversion/fileversion.c
-@@ -0,0 +1,112 @@
+@@ -0,0 +1,120 @@
 +#include <windows.h>
 +
 +#include <stdio.h>
@@ -55,6 +55,8 @@
 +  unsigned char *buffer;
 +  VS_FIXEDFILEINFO *fixed_file_info;
 +  UINT fixed_file_info_len;
++  char fullname[1024];
++  char *basename;
 +
 +  if (argc == 4 &&
 +      strcmp (argv[1], "-s") == 0)
@@ -89,11 +91,17 @@
 +      exit (1);
 +    }
 +
-+  version_info_size = GetFileVersionInfoSize (argv[1], &dummy);
++  if (!GetFullPathName (argv[1], sizeof (fullname), fullname, &basename))
++    {
++      fprintf (stderr, "GetFullPathName() failed\n");
++      exit (1);
++    }
++  
++  version_info_size = GetFileVersionInfoSize (fullname, &dummy);
 +
 +  buffer = malloc (version_info_size);
 +
-+  if (!GetFileVersionInfo (argv[1], 0, version_info_size, buffer))
++  if (!GetFileVersionInfo (fullname, 0, version_info_size, buffer))
 +    {
 +      if (update_version)
 +	fprintf (stderr, "GetFileVersionInfo() failed, file probably lacks a version resource block.\n");
@@ -121,7 +129,7 @@
 +      fixed_file_info->dwFileVersionMS = 0x10000 * new_v[0] + new_v[1];
 +      fixed_file_info->dwFileVersionLS = 0x10000 * new_v[2] + new_v[3];
 +      
-+      if (!(resource = BeginUpdateResource (argv[1], FALSE)))
++      if (!(resource = BeginUpdateResource (fullname, FALSE)))
 +	{
 +	  fprintf (stderr, "BeginUpdateResource() failed.\n");
 +	  exit (1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]