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
4160722b
Commit
4160722b
authored
Nov 25, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Nov 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Check the destination file's hash and skip that file if the hash matches.
parent
6a6a2185
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
4 deletions
+61
-4
action.c
dlls/msi/action.c
+37
-0
files.c
dlls/msi/files.c
+22
-0
msipriv.h
dlls/msi/msipriv.h
+1
-0
install.c
dlls/msi/tests/install.c
+1
-4
No files found.
dlls/msi/action.c
View file @
4160722b
...
...
@@ -1394,6 +1394,41 @@ static LPWSTR folder_split_path(LPWSTR p, WCHAR ch)
return
p
+
1
;
}
static
UINT
load_file_hash
(
MSIPACKAGE
*
package
,
MSIFILE
*
file
)
{
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'M'
,
's'
,
'i'
,
'F'
,
'i'
,
'l'
,
'e'
,
'H'
,
'a'
,
's'
,
'h'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'F'
,
'i'
,
'l'
,
'e'
,
'_'
,
'`'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
MSIQUERY
*
view
=
NULL
;
MSIRECORD
*
row
;
UINT
r
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
file
->
File
));
r
=
MSI_OpenQuery
(
package
->
db
,
&
view
,
query
,
file
->
File
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_ViewExecute
(
view
,
NULL
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
r
=
MSI_ViewFetch
(
view
,
&
row
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
file
->
hash
.
dwFileHashInfoSize
=
sizeof
(
MSIFILEHASHINFO
);
file
->
hash
.
dwData
[
0
]
=
MSI_RecordGetInteger
(
row
,
3
);
file
->
hash
.
dwData
[
1
]
=
MSI_RecordGetInteger
(
row
,
4
);
file
->
hash
.
dwData
[
2
]
=
MSI_RecordGetInteger
(
row
,
5
);
file
->
hash
.
dwData
[
3
]
=
MSI_RecordGetInteger
(
row
,
6
);
done:
if
(
view
)
msiobj_release
(
&
view
->
hdr
);
return
r
;
}
static
UINT
load_file
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
(
MSIPACKAGE
*
)
param
;
...
...
@@ -1444,6 +1479,8 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
file
->
IsCompressed
=
package
->
WordCount
&
MSIWORDCOUNT_COMPRESSED
;
}
load_file_hash
(
package
,
file
);
TRACE
(
"File Loaded (%s)
\n
"
,
debugstr_w
(
file
->
File
));
list_add_tail
(
&
package
->
files
,
&
file
->
entry
);
...
...
dlls/msi/files.c
View file @
4160722b
...
...
@@ -733,6 +733,22 @@ static UINT copy_install_file(MSIFILE *file)
return
gle
;
}
static
BOOL
check_dest_hash_matches
(
MSIFILE
*
file
)
{
MSIFILEHASHINFO
hash
;
UINT
r
;
if
(
!
file
->
hash
.
dwFileHashInfoSize
)
return
FALSE
;
hash
.
dwFileHashInfoSize
=
sizeof
(
MSIFILEHASHINFO
);
r
=
MsiGetFileHashW
(
file
->
TargetPath
,
0
,
&
hash
);
if
(
r
!=
ERROR_SUCCESS
)
return
FALSE
;
return
!
memcmp
(
&
hash
,
&
file
->
hash
,
sizeof
(
MSIFILEHASHINFO
));
}
/*
* ACTION_InstallFiles()
*
...
...
@@ -776,6 +792,12 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
if
(
file
->
state
!=
msifs_missing
&&
!
mi
->
is_continuous
&&
file
->
state
!=
msifs_overwrite
)
continue
;
if
(
check_dest_hash_matches
(
file
))
{
TRACE
(
"File hashes match, not overwriting
\n
"
);
continue
;
}
if
(
file
->
Sequence
>
mi
->
last_sequence
||
mi
->
is_continuous
||
(
file
->
IsCompressed
&&
!
mi
->
is_extracted
))
{
...
...
dlls/msi/msipriv.h
View file @
4160722b
...
...
@@ -424,6 +424,7 @@ typedef struct tagMSIFILE
LPWSTR
SourcePath
;
LPWSTR
TargetPath
;
BOOL
IsCompressed
;
MSIFILEHASHINFO
hash
;
}
MSIFILE
;
typedef
struct
tagMSITEMPFILE
...
...
dlls/msi/tests/install.c
View file @
4160722b
...
...
@@ -3540,10 +3540,7 @@ static void test_missingcab(void)
create_pf_data
(
"msitest
\\
caesar"
,
"abcdefgh"
,
TRUE
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
caesar"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
maximus"
,
TRUE
),
"File not installed
\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