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
5d37be9e
Commit
5d37be9e
authored
Aug 10, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Aug 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Only remove a file if the version to be installed is strictly newer than the old file.
parent
6ca62033
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
files.c
dlls/msi/files.c
+24
-0
package.c
dlls/msi/tests/package.c
+4
-7
No files found.
dlls/msi/files.c
View file @
5d37be9e
...
...
@@ -823,6 +823,24 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
return
rc
;
}
/* compares the version of a file read from the filesystem and
* the version specified in the File table
*/
static
int
msi_compare_file_version
(
MSIFILE
*
file
)
{
WCHAR
version
[
MAX_PATH
];
DWORD
size
;
UINT
r
;
size
=
MAX_PATH
;
version
[
0
]
=
'\0'
;
r
=
MsiGetFileVersionW
(
file
->
TargetPath
,
version
,
&
size
,
NULL
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
return
0
;
return
lstrcmpW
(
version
,
file
->
Version
);
}
UINT
ACTION_RemoveFiles
(
MSIPACKAGE
*
package
)
{
MSIFILE
*
file
;
...
...
@@ -843,6 +861,12 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
if
(
file
->
state
!=
msifs_present
)
continue
;
/* only remove a file if the version to be installed
* is strictly newer than the old file
*/
if
(
msi_compare_file_version
(
file
)
>=
0
)
continue
;
TRACE
(
"removing %s
\n
"
,
debugstr_w
(
file
->
File
)
);
if
(
!
DeleteFileW
(
file
->
TargetPath
)
)
ERR
(
"failed to delete %s
\n
"
,
debugstr_w
(
file
->
TargetPath
)
);
...
...
dlls/msi/tests/package.c
View file @
5d37be9e
...
...
@@ -1938,13 +1938,10 @@ static void test_removefiles(void)
r
=
MsiDoAction
(
hpkg
,
"RemoveFiles"
);
ok
(
r
==
ERROR_SUCCESS
,
"remove files failed
\n
"
);
todo_wine
{
ok
(
DeleteFileA
(
"hydrogen.txt"
),
"Expected hydrogen.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"lithium.txt"
),
"Expected lithium.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"beryllium.txt"
),
"Expected beryllium.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"carbon.txt"
),
"Expected carbon.txt to exist
\n
"
);
}
ok
(
DeleteFileA
(
"hydrogen.txt"
),
"Expected hydrogen.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"lithium.txt"
),
"Expected lithium.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"beryllium.txt"
),
"Expected beryllium.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"carbon.txt"
),
"Expected carbon.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"helium.txt"
),
"Expected helium.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"boron.txt"
),
"Expected boron.txt to exist
\n
"
);
...
...
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