Re: MSIEXEC: Make installation of InstMsiA.exe possible

2004-11-06 Thread Tobias Burnus
Hello,
Hans Leidekker wrote:
I have an InstMsiA.exe that uses two undocumented msiexec command line
parameters: /m and /D and uses an undocumented modifier (!) with the /q
parameter. Our msiexec fails when it encounters these and responds with
a usage message.
For /m I found the following, don't know whether it helps.
Tobias
According to
http://safariexamples.informit.com/0321133455/ExecutiveSoftware/Diskeeper/Diskeeper-Users-Guide70.pdf
msiexec /m MIF /qn /I DKMSI INSTALLDIR="C:\MyDir"
Where MIF represents the Management Information File -- 8 characters 
maximum.




Re: MSIEXEC: Make installation of InstMsiA.exe possible

2004-11-06 Thread Hans Leidekker
On Saturday 6 November 2004 15:52, Dmitry Timoshkov wrote:

> > + else if(!strcasecmp(argv[i]+2, "b+!"))
> 
> Please use lstrcmpiA instead of strcasecmp. A difference between unix
> system locale and current ANSI code page in Wine might lead to undesired
> side effects.

Here's a patch relative to my previous patch that replaces all occurrences
of strcasecmp with lstrcmpiA. It also introduces MSIEXEC_lstrncmpiA (wrapper
around CompareString) to replace all occurrences of strncasecmp.

Changelog:
  Use string functions that are Windows locale aware.
--- programs/msiexec/msiexec.c.prev	2004-11-06 18:34:00.062353768 +0100
+++ programs/msiexec/msiexec.c	2004-11-06 18:24:15.0 +0100
@@ -110,6 +110,20 @@
 	if(len && String[len-1] == character) String[len-1] = 0;
 }
 
+static INT MSIEXEC_lstrncmpiA(LPCSTR str1, LPCSTR str2, INT size)
+{
+INT ret;
+
+if ((str1 == NULL) && (str2 == NULL)) return 0;
+if (str1 == NULL) return -1;
+if (str2 == NULL) return 1;
+
+ret = CompareStringA(GetThreadLocale(), NORM_IGNORECASE, str1, size, str2, -1);
+if (ret) ret -= 2;
+
+return ret;
+}
+
 static VOID *LoadProc(LPCSTR DllName, LPCSTR ProcName, HMODULE* DllHandle)
 {
 	VOID* (*proc)(void);
@@ -212,15 +226,15 @@
 	{
 		WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
 
-if (!strcasecmp(argv[i], "/regserver"))
+if (!lstrcmpiA(argv[i], "/regserver"))
 {
 FunctionRegServer = TRUE;
 }
-else if (!strcasecmp(argv[i], "/unregserver") || !strcasecmp(argv[i], "/unregister"))
+else if (!lstrcmpiA(argv[i], "/unregserver") || !lstrcmpiA(argv[i], "/unregister"))
 {
 FunctionUnregServer = TRUE;
 }
-		else if(!strncasecmp(argv[i], "/i", 2))
+		else if(!MSIEXEC_lstrncmpiA(argv[i], "/i", 2))
 		{
 			char *argvi = argv[i];
 			FunctionInstall = TRUE;
@@ -235,7 +249,7 @@
 			}
 			GotProductCode = GetProductCode(argvi, &PackageName, &ProductCode);
 		}
-		else if(!strcasecmp(argv[i], "/a"))
+		else if(!lstrcmpiA(argv[i], "/a"))
 		{
 			FunctionInstall = TRUE;
 			FunctionInstallAdmin = TRUE;
@@ -247,7 +261,7 @@
 			PackageName = argv[i];
 			StringListAppend(&Properties, ActionAdmin);
 		}
-		else if(!strncasecmp(argv[i], "/f", 2))
+		else if(!MSIEXEC_lstrncmpiA(argv[i], "/f", 2))
 		{
 			int j;
 			int len = strlen(argv[i]);
@@ -315,7 +329,7 @@
 			WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
 			GotProductCode = GetProductCode(argv[i], &PackageName, &ProductCode);
 		}
-		else if(!strcasecmp(argv[i], "/x"))
+		else if(!lstrcmpiA(argv[i], "/x"))
 		{
 			FunctionInstall = TRUE;
 			i++;
@@ -325,7 +339,7 @@
 			GotProductCode = GetProductCode(argv[i], &PackageName, &ProductCode);
 			StringListAppend(&Properties, RemoveAll);
 		}
-		else if(!strncasecmp(argv[i], "/j", 2))
+		else if(!MSIEXEC_lstrncmpiA(argv[i], "/j", 2))
 		{
 			int j;
 			int len = strlen(argv[i]);
@@ -353,7 +367,7 @@
 			WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
 			PackageName = argv[i];
 		}
-		else if(!strcasecmp(argv[i], "u"))
+		else if(!lstrcmpiA(argv[i], "u"))
 		{
 			FunctionAdvertise = TRUE;
 			AdvertiseMode = ADVERTISEFLAGS_USERASSIGN;
@@ -363,7 +377,7 @@
 			WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
 			PackageName = argv[i];
 		}
-		else if(!strcasecmp(argv[i], "m"))
+		else if(!lstrcmpiA(argv[i], "m"))
 		{
 			FunctionAdvertise = TRUE;
 			AdvertiseMode = ADVERTISEFLAGS_MACHINEASSIGN;
@@ -373,7 +387,7 @@
 			WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
 			PackageName = argv[i];
 		}
-		else if(!strcasecmp(argv[i], "/t"))
+		else if(!lstrcmpiA(argv[i], "/t"))
 		{
 			i++;
 			if(i >= argc)
@@ -382,12 +396,12 @@
 			StringListAppend(&Transforms, argv[i]);
 			StringListAppend(&Transforms, ";");
 		}
-		else if(!strncasecmp(argv[i], "TRANSFORMS=", 11))
+		else if(!MSIEXEC_lstrncmpiA(argv[i], "TRANSFORMS=", 11))
 		{
 			StringListAppend(&Transforms, argv[i]+11);
 			StringListAppend(&Transforms, ";");
 		}
-		else if(!strcasecmp(argv[i], "/g"))
+		else if(!lstrcmpiA(argv[i], "/g"))
 		{
 			i++;
 			if(i >= argc)
@@ -395,7 +409,7 @@
 			WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
 			Language = strtol(argv[i], NULL, 0);
 		}
-		else if(!strncasecmp(argv[i], "/l", 2))
+		else if(!MSIEXEC_lstrncmpiA(argv[i], "/l", 2))
 		{
 			int j;
 			int len = strlen(argv[i]);
@@ -485,7 +499,7 @@
 ExitProcess(1);
 			}
 		}
-		else if(!strcasecmp(argv[i], "/p"))
+		else if(!lstrcmpiA(argv[i], "/p"))
 		{
 			FunctionPatch = TRUE;
 			i++;
@@ -494,37 +508,37 @@
 			WINE_TRACE("argv[%d] = %s\n", i, argv[i]);
 			PatchFileName = argv[i];
 		}
-		else if(!strncasecmp(argv[i], "/q", 2))
+		else if(!MSIEXEC_lstrncmpiA(argv[i], "/q", 2))
 		{
-			if(strlen(argv[i]) == 2 || !strcasecmp(argv[i]+2, "n"))
+			if(strlen(argv[i]) == 2 || !lstrcmpiA(argv[i]+2, "n"))
 			{
 InstallUILevel = INSTALLUILEVEL_NONE;
 			}
-			else if(!strcasecmp(argv[i]+2, "b"))
+			else if(!lstrcmpiA(argv[i]+2, 

Re: MSIEXEC: Make installation of InstMsiA.exe possible

2004-11-06 Thread Dmitry Timoshkov
"Hans Leidekker" <[EMAIL PROTECTED]> wrote:

> @@ -523,6 +524,11 @@
>   {
>   InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_PROGRESSONLY;
>   }
> + else if(!strcasecmp(argv[i]+2, "b+!"))

Please use lstrcmpiA instead of strcasecmp. A difference between unix
system locale and current ANSI code page in Wine might lead to undesired
side effects.

-- 
Dmitry.