mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 12:23:28 +00:00
Sync to Wine-0_9_2:
Francois Gouget <[email protected]> - Remove spaces before '\n' in traces. - Assorted spelling and case fixes. Steven Edwards <[email protected]> - Partly implement MsiMessageBox[A/W] on top of MessageBoxEx[A/W] YunSong Hwang <[email protected]> - Add Korean translations. - Update Korean translations. Aric Stewart <[email protected]> - Use MsiDecomposeDescriptorW in MsiProvideQualifiedComponentExW. Mike McCormack <[email protected]> - Fix comparison of empty properties to numbers and add test cases. - Only return ERROR_MORE_DATA if there's a buffer to copy a result into. - Fix function prototype and spec file entry for MsiEnumComponentQualifiers. - Set the Installed property if the product is already installed. - Loop around calling RegQueryValue until we have a big enough string for both the name and the value. - Convert MsiEnumComponentQualifiers to use msi_strcpy_to_awstring. - Empty strings are not equal to any number, so all comparisons against them fail except for tests for non-equalness. svn path=/trunk/; revision=19589
This commit is contained in:
+39
-55
@@ -221,40 +221,42 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
/* source directories appear to always be at the root */
|
||||
if (source)
|
||||
{
|
||||
path = msi_dup_property( package, cszSourceDir );
|
||||
if (!path)
|
||||
{
|
||||
path = msi_dup_property( package, cszDatabase );
|
||||
if (path)
|
||||
{
|
||||
p = strrchrW(path,'\\');
|
||||
if (p)
|
||||
*(p+1) = 0;
|
||||
}
|
||||
}
|
||||
if (folder)
|
||||
*folder = get_loaded_folder( package, name );
|
||||
return path;
|
||||
}
|
||||
|
||||
/* special resolving for Target and Source root dir */
|
||||
if (strcmpW(name,cszTargetDir)==0 || strcmpW(name,cszSourceDir)==0)
|
||||
{
|
||||
if (!source)
|
||||
LPWSTR check_path;
|
||||
check_path = msi_dup_property( package, cszTargetDir );
|
||||
if (!check_path)
|
||||
{
|
||||
LPWSTR check_path;
|
||||
check_path = msi_dup_property( package, cszTargetDir );
|
||||
if (!check_path)
|
||||
{
|
||||
check_path = msi_dup_property( package, cszRootDrive );
|
||||
if (set_prop)
|
||||
MSI_SetPropertyW(package,cszTargetDir,check_path);
|
||||
}
|
||||
check_path = msi_dup_property( package, cszRootDrive );
|
||||
if (set_prop)
|
||||
MSI_SetPropertyW(package,cszTargetDir,check_path);
|
||||
}
|
||||
|
||||
/* correct misbuilt target dir */
|
||||
path = build_directory_name(2, check_path, NULL);
|
||||
if (strcmpiW(path,check_path)!=0)
|
||||
MSI_SetPropertyW(package,cszTargetDir,path);
|
||||
msi_free(check_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
path = msi_dup_property( package, cszSourceDir );
|
||||
if (!path)
|
||||
{
|
||||
path = msi_dup_property( package, cszDatabase );
|
||||
if (path)
|
||||
{
|
||||
p = strrchrW(path,'\\');
|
||||
if (p)
|
||||
*(p+1) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* correct misbuilt target dir */
|
||||
path = build_directory_name(2, check_path, NULL);
|
||||
if (strcmpiW(path,check_path)!=0)
|
||||
MSI_SetPropertyW(package,cszTargetDir,path);
|
||||
msi_free(check_path);
|
||||
if (folder)
|
||||
*folder = get_loaded_folder( package, name );
|
||||
return path;
|
||||
@@ -267,19 +269,13 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
|
||||
if (folder)
|
||||
*folder = f;
|
||||
|
||||
if (!source && f->ResolvedTarget)
|
||||
if (f->ResolvedTarget)
|
||||
{
|
||||
path = strdupW( f->ResolvedTarget );
|
||||
TRACE(" already resolved to %s\n",debugstr_w(path));
|
||||
return path;
|
||||
}
|
||||
else if (source && f->ResolvedSource)
|
||||
{
|
||||
path = strdupW( f->ResolvedSource );
|
||||
TRACE(" (source)already resolved to %s\n",debugstr_w(path));
|
||||
return path;
|
||||
}
|
||||
else if (!source && f->Property)
|
||||
else if (f->Property)
|
||||
{
|
||||
path = build_directory_name( 2, f->Property, NULL );
|
||||
|
||||
@@ -296,25 +292,13 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
|
||||
TRACE(" ! Parent is %s\n", debugstr_w(parent));
|
||||
|
||||
p = resolve_folder(package, parent, source, set_prop, NULL);
|
||||
if (!source)
|
||||
{
|
||||
TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault));
|
||||
TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault));
|
||||
|
||||
path = build_directory_name( 3, p, f->TargetDefault, NULL );
|
||||
f->ResolvedTarget = strdupW( path );
|
||||
TRACE(" resolved into %s\n",debugstr_w(path));
|
||||
if (set_prop)
|
||||
MSI_SetPropertyW(package,name,path);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (f->SourceDefault && f->SourceDefault[0]!='.')
|
||||
path = build_directory_name( 3, p, f->SourceDefault, NULL );
|
||||
else
|
||||
path = strdupW(p);
|
||||
TRACE(" (source)resolved into %s\n",debugstr_w(path));
|
||||
f->ResolvedSource = strdupW( path );
|
||||
}
|
||||
path = build_directory_name( 3, p, f->TargetDefault, NULL );
|
||||
f->ResolvedTarget = strdupW( path );
|
||||
TRACE(" resolved into %s\n",debugstr_w(path));
|
||||
if (set_prop)
|
||||
MSI_SetPropertyW(package,name,path);
|
||||
msi_free(p);
|
||||
}
|
||||
return path;
|
||||
|
||||
@@ -22,12 +22,12 @@ LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
5 "path %s not found"
|
||||
5 "%s 경로를 찾을수 없습니다"
|
||||
9 "디스크 %s 삽입"
|
||||
10 "절못된 매개변수"
|
||||
11 "enter which folder contains %s"
|
||||
12 "install source for feature missing"
|
||||
13 "network drive for feature missing"
|
||||
14 "feature from:"
|
||||
15 "choose which folder contains %s"
|
||||
11 "%s를 포함하는 폴더를 입력하세여"
|
||||
12 "빠진 부분(feature)을 위한 설치 원본"
|
||||
13 "빠진 부분(feature)을 위한 네트워크 드라이브"
|
||||
14 "부분(feature)에서:"
|
||||
15 " %s를 포함하는 폴더 선택"
|
||||
}
|
||||
|
||||
+46
-29
@@ -773,7 +773,7 @@ UINT WINAPI MSI_EnumComponentQualifiers( LPCWSTR szComponent, DWORD iIndex,
|
||||
awstring *lpQualBuf, DWORD* pcchQual,
|
||||
awstring *lpAppBuf, DWORD* pcchAppBuf )
|
||||
{
|
||||
DWORD name_sz, val_sz, type, ofs;
|
||||
DWORD name_sz, val_sz, name_max, val_max, type, ofs;
|
||||
LPWSTR name = NULL, val = NULL;
|
||||
UINT r, r2;
|
||||
HKEY key;
|
||||
@@ -789,40 +789,57 @@ UINT WINAPI MSI_EnumComponentQualifiers( LPCWSTR szComponent, DWORD iIndex,
|
||||
return ERROR_UNKNOWN_COMPONENT;
|
||||
|
||||
/* figure out how big the name is we want to return */
|
||||
name_sz = 0;
|
||||
if (pcchQual)
|
||||
{
|
||||
r = ERROR_OUTOFMEMORY;
|
||||
name_sz = *pcchQual * 4;
|
||||
name = msi_alloc( name_sz * sizeof(WCHAR) );
|
||||
if (!name)
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* figure out how big the value is */
|
||||
type = 0;
|
||||
val_sz = 0;
|
||||
r = RegEnumValueW( key, iIndex, NULL, NULL,
|
||||
NULL, &type, NULL, &val_sz );
|
||||
if (r != ERROR_SUCCESS)
|
||||
name_max = 0x10;
|
||||
r = ERROR_OUTOFMEMORY;
|
||||
name = msi_alloc( name_max * sizeof(WCHAR) );
|
||||
if (!name)
|
||||
goto end;
|
||||
|
||||
if (type != REG_MULTI_SZ)
|
||||
{
|
||||
ERR("component data has wrong type (%ld)\n", type);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* the value size is in bytes */
|
||||
val_sz += sizeof(WCHAR);
|
||||
val = msi_alloc( val_sz );
|
||||
val_max = 0x10;
|
||||
r = ERROR_OUTOFMEMORY;
|
||||
val = msi_alloc( val_max );
|
||||
if (!val)
|
||||
goto end;
|
||||
|
||||
r = RegEnumValueW( key, iIndex, name, &name_sz,
|
||||
NULL, &type, (LPBYTE)val, &val_sz );
|
||||
if (r != ERROR_SUCCESS)
|
||||
/* loop until we allocate enough memory */
|
||||
while (1)
|
||||
{
|
||||
name_sz = name_max;
|
||||
val_sz = val_max;
|
||||
r = RegEnumValueW( key, iIndex, name, &name_sz,
|
||||
NULL, &type, (LPBYTE)val, &val_sz );
|
||||
if (r == ERROR_SUCCESS)
|
||||
break;
|
||||
if (r != ERROR_MORE_DATA)
|
||||
goto end;
|
||||
|
||||
if (type != REG_MULTI_SZ)
|
||||
{
|
||||
ERR("component data has wrong type (%ld)\n", type);
|
||||
goto end;
|
||||
}
|
||||
|
||||
r = ERROR_OUTOFMEMORY;
|
||||
if ((name_sz+1) >= name_max)
|
||||
{
|
||||
name_max *= 2;
|
||||
msi_free( name );
|
||||
name = msi_alloc( name_max * sizeof (WCHAR) );
|
||||
if (!name)
|
||||
goto end;
|
||||
continue;
|
||||
}
|
||||
if (val_sz > val_max)
|
||||
{
|
||||
val_max = val_sz + sizeof (WCHAR);
|
||||
val = msi_alloc( val_max * sizeof (WCHAR) );
|
||||
if (!val)
|
||||
goto end;
|
||||
continue;
|
||||
}
|
||||
ERR("should be enough data, but isn't %ld %ld\n", name_sz, val_sz );
|
||||
goto end;
|
||||
}
|
||||
|
||||
ofs = 0;
|
||||
r = MsiDecomposeDescriptorW( val, NULL, NULL, NULL, &ofs );
|
||||
|
||||
Reference in New Issue
Block a user