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
230af9d2
Commit
230af9d2
authored
Jul 14, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Move version string conversions to registry.c.
parent
99172508
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
46 deletions
+39
-46
action.c
dlls/msi/action.c
+2
-2
action.h
dlls/msi/action.h
+0
-1
helpers.c
dlls/msi/helpers.c
+0
-41
msipriv.h
dlls/msi/msipriv.h
+3
-0
registry.c
dlls/msi/registry.c
+32
-0
upgrade.c
dlls/msi/upgrade.c
+2
-2
No files found.
dlls/msi/action.c
View file @
230af9d2
...
...
@@ -3088,7 +3088,7 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
buffer
=
msi_dup_property
(
package
,
szProductVersion
);
if
(
buffer
)
{
DWORD
verdword
=
build_version
_dword
(
buffer
);
DWORD
verdword
=
msi_version_str_to
_dword
(
buffer
);
msi_reg_set_val_dword
(
hkey
,
INSTALLPROPERTY_VERSIONW
,
verdword
);
}
msi_free
(
buffer
);
...
...
@@ -3588,7 +3588,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
buffer
=
msi_dup_property
(
package
,
szProductVersion
);
if
(
buffer
)
{
DWORD
verdword
=
build_version
_dword
(
buffer
);
DWORD
verdword
=
msi_version_str_to
_dword
(
buffer
);
msi_reg_set_val_dword
(
hkey
,
INSTALLPROPERTY_VERSIONW
,
verdword
);
msi_reg_set_val_dword
(
hkey
,
INSTALLPROPERTY_VERSIONMAJORW
,
verdword
>>
24
);
...
...
dlls/msi/action.h
View file @
230af9d2
...
...
@@ -266,7 +266,6 @@ extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
extern
int
track_tempfile
(
MSIPACKAGE
*
package
,
LPCWSTR
name
,
LPCWSTR
path
);
extern
UINT
schedule_action
(
MSIPACKAGE
*
package
,
UINT
script
,
LPCWSTR
action
);
extern
LPWSTR
build_icon_path
(
MSIPACKAGE
*
,
LPCWSTR
);
extern
DWORD
build_version_dword
(
LPCWSTR
);
extern
LPWSTR
build_directory_name
(
DWORD
,
...);
extern
BOOL
create_full_pathW
(
const
WCHAR
*
path
);
extern
BOOL
ACTION_VerifyComponentForAction
(
MSICOMPONENT
*
,
INSTALLSTATE
);
...
...
dlls/msi/helpers.c
View file @
230af9d2
...
...
@@ -43,47 +43,6 @@ const WCHAR cszSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
const
WCHAR
cszRootDrive
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
,
'D'
,
'R'
,
'I'
,
'V'
,
'E'
,
0
};
const
WCHAR
cszbs
[]
=
{
'\\'
,
0
};
DWORD
build_version_dword
(
LPCWSTR
version_string
)
{
SHORT
major
,
minor
;
WORD
build
;
DWORD
rc
=
0x00000000
;
LPCWSTR
ptr1
;
ptr1
=
version_string
;
if
(
!
ptr1
)
return
rc
;
else
major
=
atoiW
(
ptr1
);
if
(
ptr1
)
ptr1
=
strchrW
(
ptr1
,
'.'
);
if
(
ptr1
)
{
ptr1
++
;
minor
=
atoiW
(
ptr1
);
}
else
minor
=
0
;
if
(
ptr1
)
ptr1
=
strchrW
(
ptr1
,
'.'
);
if
(
ptr1
)
{
ptr1
++
;
build
=
atoiW
(
ptr1
);
}
else
build
=
0
;
rc
=
MAKELONG
(
build
,
MAKEWORD
(
minor
,
major
));
TRACE
(
"%s -> 0x%lx
\n
"
,
debugstr_w
(
version_string
),
rc
);
return
rc
;
}
LPWSTR
build_icon_path
(
MSIPACKAGE
*
package
,
LPCWSTR
icon_name
)
{
LPWSTR
SystemFolder
,
dest
,
FilePath
;
...
...
dlls/msi/msipriv.h
View file @
230af9d2
...
...
@@ -415,6 +415,9 @@ extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL cr
extern
UINT
MSIREG_OpenUpgradeCodesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserUpgradeCodesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
DWORD
msi_version_str_to_dword
(
LPCWSTR
p
);
extern
LPWSTR
msi_version_dword_to_str
(
DWORD
version
);
extern
LONG
msi_reg_set_val_str
(
HKEY
hkey
,
LPCWSTR
name
,
LPCWSTR
value
);
extern
LONG
msi_reg_set_val_multi_str
(
HKEY
hkey
,
LPCWSTR
name
,
LPCWSTR
value
);
extern
LONG
msi_reg_set_val_dword
(
HKEY
hkey
,
LPCWSTR
name
,
DWORD
val
);
...
...
dlls/msi/registry.c
View file @
230af9d2
...
...
@@ -305,6 +305,38 @@ BOOL encode_base85_guid( GUID *guid, LPWSTR str )
return
TRUE
;
}
DWORD
msi_version_str_to_dword
(
LPCWSTR
p
)
{
DWORD
major
,
minor
=
0
,
build
=
0
,
version
=
0
;
if
(
!
p
)
return
version
;
major
=
atoiW
(
p
);
p
=
strchrW
(
p
,
'.'
);
if
(
p
)
{
minor
=
atoiW
(
p
+
1
);
p
=
strchrW
(
p
+
1
,
'.'
);
if
(
p
)
build
=
atoiW
(
p
+
1
);
}
return
MAKELONG
(
build
,
MAKEWORD
(
minor
,
major
));
}
LPWSTR
msi_version_dword_to_str
(
DWORD
version
)
{
const
WCHAR
fmt
[]
=
{
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
0
};
LPWSTR
str
=
msi_alloc
(
20
);
sprintfW
(
str
,
fmt
,
(
version
&
0xff000000
)
>>
24
,
(
version
&
0x00ff0000
)
>>
16
,
version
&
0x0000ffff
);
return
str
;
}
LONG
msi_reg_set_val_str
(
HKEY
hkey
,
LPCWSTR
name
,
LPCWSTR
value
)
{
DWORD
len
=
value
?
(
lstrlenW
(
value
)
+
1
)
*
sizeof
(
WCHAR
)
:
0
;
...
...
dlls/msi/upgrade.c
View file @
230af9d2
...
...
@@ -151,7 +151,7 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
(
LPBYTE
)
&
check
,
&
sz
);
/* check min */
ver
=
MSI_RecordGetString
(
rec
,
2
);
comp_ver
=
build_version
_dword
(
ver
);
comp_ver
=
msi_version_str_to
_dword
(
ver
);
r
=
check
-
comp_ver
;
if
(
r
<
0
||
(
r
==
0
&&
!
(
attributes
&
msidbUpgradeAttributesVersionMinInclusive
)))
...
...
@@ -163,7 +163,7 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
/* check max */
ver
=
MSI_RecordGetString
(
rec
,
3
);
comp_ver
=
build_version
_dword
(
ver
);
comp_ver
=
msi_version_str_to
_dword
(
ver
);
r
=
check
-
comp_ver
;
if
(
r
>
0
||
(
r
==
0
&&
!
(
attributes
&
msidbUpgradeAttributesVersionMaxInclusive
)))
...
...
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