Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bc801f85
Commit
bc801f85
authored
Jan 16, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Set the SourceDir and SOURCEDIR properties in MsiGetSourcePath.
parent
4381cabf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
21 deletions
+72
-21
install.c
dlls/msi/install.c
+5
-11
package.c
dlls/msi/tests/package.c
+67
-10
No files found.
dlls/msi/install.c
View file @
bc801f85
...
...
@@ -347,16 +347,10 @@ UINT WINAPI MsiGetTargetPathW( MSIHANDLE hInstall, LPCWSTR szFolder,
return
MSI_GetTargetPath
(
hInstall
,
szFolder
,
&
path
,
pcchPathBuf
);
}
static
WCHAR
*
get_source_root
(
MSI
DATABASE
*
db
)
static
WCHAR
*
get_source_root
(
MSI
PACKAGE
*
package
)
{
WCHAR
*
path
,
*
p
;
if
((
path
=
msi_dup_property
(
db
,
szSourceDir
)))
return
path
;
if
((
path
=
msi_dup_property
(
db
,
szDatabase
)))
{
if
((
p
=
strrchrW
(
path
,
'\\'
)))
p
[
1
]
=
0
;
}
return
path
;
msi_set_sourcedir_props
(
package
,
FALSE
);
return
msi_dup_property
(
package
->
db
,
szSourceDir
);
}
WCHAR
*
msi_resolve_source_folder
(
MSIPACKAGE
*
package
,
const
WCHAR
*
name
,
MSIFOLDER
**
folder
)
...
...
@@ -372,7 +366,7 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
/* special resolving for root dir */
if
(
!
strcmpW
(
name
,
szTargetDir
)
&&
!
f
->
ResolvedSource
)
{
f
->
ResolvedSource
=
get_source_root
(
package
->
db
);
f
->
ResolvedSource
=
get_source_root
(
package
);
}
if
(
folder
)
*
folder
=
f
;
if
(
f
->
ResolvedSource
)
...
...
@@ -388,7 +382,7 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
p
=
msi_resolve_source_folder
(
package
,
parent
,
NULL
);
if
(
package
->
WordCount
&
msidbSumInfoSourceTypeCompressed
)
path
=
get_source_root
(
package
->
db
);
path
=
get_source_root
(
package
);
else
if
(
package
->
WordCount
&
msidbSumInfoSourceTypeSFN
)
path
=
msi_build_directory_name
(
3
,
p
,
f
->
SourceShortPath
,
NULL
);
else
...
...
dlls/msi/tests/package.c
View file @
bc801f85
...
...
@@ -10972,13 +10972,17 @@ static void test_MsiGetSourcePath(void)
/* source path does not exist, but the property exists */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
}
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
/* try SubDir after CostInitialize */
size
=
MAX_PATH
;
...
...
@@ -11027,6 +11031,13 @@ static void test_MsiGetSourcePath(void)
/* source path does not exist, but the property exists */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
...
...
@@ -11079,6 +11090,13 @@ static void test_MsiGetSourcePath(void)
/* source path does not exist, but the property exists */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
...
...
@@ -11131,6 +11149,13 @@ static void test_MsiGetSourcePath(void)
/* source path does not exist, but the property exists */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
...
...
@@ -11268,6 +11293,13 @@ static void test_MsiGetSourcePath(void)
/* source path nor the property exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
path
);
ok
(
size
==
0
,
"Expected 0, got %d
\n
"
,
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
path
);
...
...
@@ -11324,13 +11356,17 @@ static void test_MsiGetSourcePath(void)
/* source path does not exist, but the property exists */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
}
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
/* try SubDir after CostInitialize */
size
=
MAX_PATH
;
...
...
@@ -11381,6 +11417,13 @@ static void test_MsiGetSourcePath(void)
/* source path and the property exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
...
...
@@ -11435,6 +11478,13 @@ static void test_MsiGetSourcePath(void)
/* source path and the property exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
...
...
@@ -11489,6 +11539,13 @@ static void test_MsiGetSourcePath(void)
/* source path and the property exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
ok
(
size
==
lstrlenA
(
cwd
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
cwd
),
size
);
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
cwd
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
cwd
,
path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment