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
d1723de5
Commit
d1723de5
authored
Oct 24, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Split code to get a file's verion into a separate comment.
parent
8939587b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
31 deletions
+42
-31
action.c
dlls/msi/action.c
+42
-31
No files found.
dlls/msi/action.c
View file @
d1723de5
...
...
@@ -1957,6 +1957,39 @@ static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param)
return
ERROR_SUCCESS
;
}
LPWSTR
msi_get_disk_file_version
(
LPCWSTR
filename
)
{
static
const
WCHAR
name_fmt
[]
=
{
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
0
};
static
WCHAR
name
[]
=
{
'\\'
,
0
};
VS_FIXEDFILEINFO
*
lpVer
;
WCHAR
filever
[
0x100
];
LPVOID
version
;
DWORD
versize
;
DWORD
handle
;
UINT
sz
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
filename
));
versize
=
GetFileVersionInfoSizeW
(
filename
,
&
handle
);
if
(
!
versize
)
return
NULL
;
version
=
msi_alloc
(
versize
);
GetFileVersionInfoW
(
filename
,
0
,
versize
,
version
);
VerQueryValueW
(
version
,
name
,
(
LPVOID
*
)
&
lpVer
,
&
sz
);
msi_free
(
version
);
sprintfW
(
filever
,
name_fmt
,
HIWORD
(
lpVer
->
dwFileVersionMS
),
LOWORD
(
lpVer
->
dwFileVersionMS
),
HIWORD
(
lpVer
->
dwFileVersionLS
),
LOWORD
(
lpVer
->
dwFileVersionLS
));
return
strdupW
(
filever
);
}
/*
* A lot is done in this function aside from just the costing.
* The costing needs to be implemented at some point but for now I am going
...
...
@@ -1980,7 +2013,7 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
MSIFILE
*
file
;
UINT
rc
;
MSIQUERY
*
view
;
LPWSTR
level
;
LPWSTR
level
,
file_version
;
if
(
1
==
msi_get_property_int
(
package
,
szCosting
,
0
)
)
return
ERROR_SUCCESS
;
...
...
@@ -2014,14 +2047,14 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
msi_free
(
file
->
TargetPath
);
TRACE
(
"file %s is named %s
\n
"
,
debugstr_w
(
file
->
File
),
debugstr_w
(
file
->
FileName
));
debugstr_w
(
file
->
File
),
debugstr_w
(
file
->
FileName
));
file
->
TargetPath
=
build_directory_name
(
2
,
p
,
file
->
FileName
);
msi_free
(
p
);
TRACE
(
"file %s resolves to %s
\n
"
,
debugstr_w
(
file
->
File
),
debugstr_w
(
file
->
TargetPath
));
debugstr_w
(
file
->
File
),
debugstr_w
(
file
->
TargetPath
));
if
(
GetFileAttributesW
(
file
->
TargetPath
)
==
INVALID_FILE_ATTRIBUTES
)
{
...
...
@@ -2030,42 +2063,20 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
continue
;
}
if
(
file
->
Version
)
if
(
file
->
Version
&&
(
file_version
=
msi_get_disk_file_version
(
file
->
TargetPath
)))
{
DWORD
handle
;
DWORD
versize
;
UINT
sz
;
LPVOID
version
;
static
WCHAR
name
[]
=
{
'\\'
,
0
};
static
const
WCHAR
name_fmt
[]
=
{
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
0
};
WCHAR
filever
[
0x100
];
VS_FIXEDFILEINFO
*
lpVer
;
TRACE
(
"Version comparison..
\n
"
);
versize
=
GetFileVersionInfoSizeW
(
file
->
TargetPath
,
&
handle
);
version
=
msi_alloc
(
versize
);
GetFileVersionInfoW
(
file
->
TargetPath
,
0
,
versize
,
version
);
VerQueryValueW
(
version
,
name
,
(
LPVOID
*
)
&
lpVer
,
&
sz
);
sprintfW
(
filever
,
name_fmt
,
HIWORD
(
lpVer
->
dwFileVersionMS
),
LOWORD
(
lpVer
->
dwFileVersionMS
),
HIWORD
(
lpVer
->
dwFileVersionLS
),
LOWORD
(
lpVer
->
dwFileVersionLS
));
TRACE
(
"new %s old %s
\n
"
,
debugstr_w
(
file
->
Version
),
debugstr_w
(
filever
));
if
(
strcmpiW
(
filever
,
file
->
Version
)
<
0
)
debugstr_w
(
file_version
));
/* FIXME: seems like a bad way to compare version numbers */
if
(
lstrcmpiW
(
file_version
,
file
->
Version
)
<
0
)
{
file
->
state
=
msifs_overwrite
;
/* FIXME: cost should be diff in size */
comp
->
Cost
+=
file
->
FileSize
;
}
else
file
->
state
=
msifs_present
;
msi_free
(
version
);
msi_free
(
file_version
);
}
else
file
->
state
=
msifs_present
;
...
...
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