Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
26ae6589
Commit
26ae6589
authored
Jul 08, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jul 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Only use the long filename when resolving the source path.
parent
44bfb991
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
37 deletions
+75
-37
helpers.c
dlls/msi/helpers.c
+0
-24
install.c
dlls/msi/tests/install.c
+1
-1
package.c
dlls/msi/tests/package.c
+74
-12
No files found.
dlls/msi/helpers.c
View file @
26ae6589
...
...
@@ -323,34 +323,10 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
}
else
{
/* source may be in a few different places ... check each of them */
path
=
NULL
;
/* try the long path directory */
if
(
f
->
SourceLongPath
)
{
path
=
build_directory_name
(
3
,
p
,
f
->
SourceLongPath
,
NULL
);
if
(
INVALID_FILE_ATTRIBUTES
==
GetFileAttributesW
(
path
))
{
msi_free
(
path
);
path
=
NULL
;
}
}
/* try the short path directory */
if
(
!
path
&&
f
->
SourceShortPath
)
{
path
=
build_directory_name
(
3
,
p
,
f
->
SourceShortPath
,
NULL
);
if
(
INVALID_FILE_ATTRIBUTES
==
GetFileAttributesW
(
path
))
{
msi_free
(
path
);
path
=
NULL
;
}
}
/* try the root of the install */
if
(
!
path
)
path
=
get_source_root
(
package
);
TRACE
(
"source -> %s
\n
"
,
debugstr_w
(
path
));
f
->
ResolvedSource
=
strdupW
(
path
);
...
...
dlls/msi/tests/install.c
View file @
26ae6589
...
...
@@ -4422,11 +4422,11 @@ static void test_sourcefolder(void)
RemoveDirectoryA
(
"msitest"
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
!
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File installed
\n
"
);
todo_wine
{
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"File installed
\n
"
);
}
...
...
dlls/msi/tests/package.c
View file @
26ae6589
...
...
@@ -5546,11 +5546,8 @@ static void test_MsiGetSourcePath(void)
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
r
=
MsiDoAction
(
hpkg
,
"ResolveSource"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
...
...
@@ -5593,11 +5590,8 @@ static void test_MsiGetSourcePath(void)
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
r
=
MsiDoAction
(
hpkg
,
"FileCost"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
...
...
@@ -5632,11 +5626,8 @@ static void test_MsiGetSourcePath(void)
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
r
=
MsiDoAction
(
hpkg
,
"CostFinalize"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
...
...
@@ -5671,11 +5662,8 @@ static void test_MsiGetSourcePath(void)
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
/* nonexistent directory */
size
=
MAX_PATH
;
...
...
@@ -5730,6 +5718,79 @@ static void test_MsiGetSourcePath(void)
DeleteFile
(
msifile
);
}
static
void
test_shortlongsource
(
void
)
{
MSIHANDLE
hdb
,
hpkg
;
CHAR
path
[
MAX_PATH
];
CHAR
cwd
[
MAX_PATH
];
CHAR
subsrc
[
MAX_PATH
];
DWORD
size
;
UINT
r
;
lstrcpyA
(
cwd
,
CURR_DIR
);
lstrcatA
(
cwd
,
"
\\
"
);
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"long"
);
lstrcatA
(
subsrc
,
"
\\
"
);
hdb
=
create_package_db
();
ok
(
hdb
,
"failed to create database
\n
"
);
r
=
add_directory_entry
(
hdb
,
"'TARGETDIR', '', 'SourceDir'"
);
ok
(
r
==
S_OK
,
"failed
\n
"
);
r
=
add_directory_entry
(
hdb
,
"'SubDir', 'TARGETDIR', 'short|long'"
);
ok
(
r
==
S_OK
,
"failed
\n
"
);
hpkg
=
package_from_db
(
hdb
);
ok
(
hpkg
,
"failed to create package
\n
"
);
MsiCloseHandle
(
hdb
);
r
=
MsiDoAction
(
hpkg
,
"CostInitialize"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
r
=
MsiDoAction
(
hpkg
,
"FileCost"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
r
=
MsiDoAction
(
hpkg
,
"CostFinalize"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
/* neither short nor long source directories exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
CreateDirectoryA
(
"short"
,
NULL
);
/* short source directory exists */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
CreateDirectoryA
(
"long"
,
NULL
);
/* both short and long source directories exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
MsiCloseHandle
(
hpkg
);
RemoveDirectoryA
(
"short"
);
RemoveDirectoryA
(
"long"
);
DeleteFileA
(
msifile
);
}
START_TEST
(
package
)
{
GetCurrentDirectoryA
(
MAX_PATH
,
CURR_DIR
);
...
...
@@ -5755,4 +5816,5 @@ START_TEST(package)
test_ccpsearch
();
test_complocator
();
test_MsiGetSourcePath
();
test_shortlongsource
();
}
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