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
f0ea6004
Commit
f0ea6004
authored
Jun 11, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add support for 64-bit registry components.
parent
9fa443dc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
162 additions
and
12 deletions
+162
-12
action.c
dlls/msi/action.c
+20
-10
msi_main.c
dlls/msi/msi_main.c
+1
-0
msipriv.h
dlls/msi/msipriv.h
+1
-0
package.c
dlls/msi/package.c
+0
-2
install.c
dlls/msi/tests/install.c
+140
-0
No files found.
dlls/msi/action.c
View file @
f0ea6004
...
...
@@ -2554,12 +2554,13 @@ static const WCHAR *get_root_key( MSIPACKAGE *package, INT root, HKEY *root_key
return
ret
;
}
static
WCHAR
*
get_keypath
(
MSI
PACKAGE
*
package
,
HKEY
root
,
const
WCHAR
*
path
)
static
WCHAR
*
get_keypath
(
MSI
COMPONENT
*
comp
,
HKEY
root
,
const
WCHAR
*
path
)
{
static
const
WCHAR
prefixW
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
};
static
const
UINT
len
=
sizeof
(
prefixW
)
/
sizeof
(
prefixW
[
0
]);
if
(
is_64bit
&&
package
->
platform
==
PLATFORM_INTEL
&&
if
((
is_64bit
||
is_wow64
)
&&
!
(
comp
->
Attributes
&
msidbComponentAttributes64bit
)
&&
root
==
HKEY_LOCAL_MACHINE
&&
!
strncmpiW
(
path
,
prefixW
,
len
))
{
UINT
size
;
...
...
@@ -2574,7 +2575,6 @@ static WCHAR *get_keypath( MSIPACKAGE *package, HKEY root, const WCHAR *path )
strcatW
(
path_32node
,
path
+
len
);
return
path_32node
;
}
return
strdupW
(
path
);
}
...
...
@@ -2634,9 +2634,9 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
strcpyW
(
uikey
,
szRoot
);
strcatW
(
uikey
,
deformated
);
keypath
=
get_keypath
(
package
,
root_key
,
deformated
);
keypath
=
get_keypath
(
comp
,
root_key
,
deformated
);
msi_free
(
deformated
);
if
(
RegCreateKey
W
(
root_key
,
keypath
,
&
hkey
))
if
(
RegCreateKey
ExW
(
root_key
,
keypath
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
NULL
,
&
hkey
,
NULL
))
{
ERR
(
"Could not create key %s
\n
"
,
debugstr_w
(
keypath
));
msi_free
(
uikey
);
...
...
@@ -2722,7 +2722,7 @@ static void delete_reg_value( HKEY root, const WCHAR *keypath, const WCHAR *valu
HKEY
hkey
;
DWORD
num_subkeys
,
num_values
;
if
(
!
(
res
=
RegOpenKey
W
(
root
,
keypath
,
&
hkey
)))
if
(
!
(
res
=
RegOpenKey
ExW
(
root
,
keypath
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
&
hkey
)))
{
if
((
res
=
RegDeleteValueW
(
hkey
,
value
)))
{
...
...
@@ -2734,7 +2734,7 @@ static void delete_reg_value( HKEY root, const WCHAR *keypath, const WCHAR *valu
if
(
!
res
&&
!
num_subkeys
&&
!
num_values
)
{
TRACE
(
"removing empty key %s
\n
"
,
debugstr_w
(
keypath
));
RegDeleteKey
W
(
root
,
keypath
);
RegDeleteKey
ExW
(
root
,
keypath
,
KEY_WOW64_64KEY
,
0
);
}
return
;
}
...
...
@@ -2743,8 +2743,18 @@ static void delete_reg_value( HKEY root, const WCHAR *keypath, const WCHAR *valu
static
void
delete_reg_key
(
HKEY
root
,
const
WCHAR
*
keypath
)
{
LONG
res
=
RegDeleteTreeW
(
root
,
keypath
);
HKEY
hkey
;
LONG
res
=
RegOpenKeyExW
(
root
,
keypath
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
&
hkey
);
if
(
res
)
{
TRACE
(
"failed to open key %s (%d)
\n
"
,
debugstr_w
(
keypath
),
res
);
return
;
}
res
=
RegDeleteTreeW
(
hkey
,
NULL
);
if
(
res
)
TRACE
(
"failed to delete subtree of %s (%d)
\n
"
,
debugstr_w
(
keypath
),
res
);
res
=
RegDeleteKeyExW
(
root
,
keypath
,
KEY_WOW64_64KEY
,
0
);
if
(
res
)
TRACE
(
"failed to delete key %s (%d)
\n
"
,
debugstr_w
(
keypath
),
res
);
RegCloseKey
(
hkey
);
}
static
UINT
ITERATE_RemoveRegistryValuesOnUninstall
(
MSIRECORD
*
row
,
LPVOID
param
)
...
...
@@ -2800,7 +2810,7 @@ static UINT ITERATE_RemoveRegistryValuesOnUninstall( MSIRECORD *row, LPVOID para
deformat_string
(
package
,
name
,
&
deformated_name
);
keypath
=
get_keypath
(
package
,
hkey_root
,
deformated_key
);
keypath
=
get_keypath
(
comp
,
hkey_root
,
deformated_key
);
msi_free
(
deformated_key
);
if
(
delete_key
)
delete_reg_key
(
hkey_root
,
keypath
);
else
delete_reg_value
(
hkey_root
,
keypath
,
deformated_name
);
...
...
@@ -2865,7 +2875,7 @@ static UINT ITERATE_RemoveRegistryValuesOnInstall( MSIRECORD *row, LPVOID param
deformat_string
(
package
,
name
,
&
deformated_name
);
keypath
=
get_keypath
(
package
,
hkey_root
,
deformated_key
);
keypath
=
get_keypath
(
comp
,
hkey_root
,
deformated_key
);
msi_free
(
deformated_key
);
if
(
delete_key
)
delete_reg_key
(
hkey_root
,
keypath
);
else
delete_reg_value
(
hkey_root
,
keypath
,
deformated_name
);
...
...
dlls/msi/msi_main.c
View file @
f0ea6004
...
...
@@ -73,6 +73,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case
DLL_PROCESS_ATTACH
:
msi_hInstance
=
hinstDLL
;
DisableThreadLibraryCalls
(
hinstDLL
);
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
);
break
;
case
DLL_PROCESS_DETACH
:
msi_dialog_unregister_class
();
...
...
dlls/msi/msipriv.h
View file @
f0ea6004
...
...
@@ -39,6 +39,7 @@
#include "wine/debug.h"
static
const
BOOL
is_64bit
=
sizeof
(
void
*
)
>
sizeof
(
int
);
BOOL
is_wow64
;
#define MSI_DATASIZEMASK 0x00ff
#define MSITYPE_VALID 0x0100
...
...
dlls/msi/package.c
View file @
f0ea6004
...
...
@@ -1339,7 +1339,6 @@ static UINT msi_parse_summary( MSISUMMARYINFO *si, MSIPACKAGE *package )
static
UINT
validate_package
(
MSIPACKAGE
*
package
)
{
BOOL
is_wow64
;
UINT
i
;
if
(
package
->
platform
==
PLATFORM_INTEL64
)
...
...
@@ -1348,7 +1347,6 @@ static UINT validate_package( MSIPACKAGE *package )
if
(
package
->
platform
==
PLATFORM_ARM
)
return
ERROR_INSTALL_PLATFORM_UNSUPPORTED
;
#endif
IsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
);
if
(
package
->
platform
==
PLATFORM_X64
)
{
if
(
!
is_64bit
&&
!
is_wow64
)
...
...
dlls/msi/tests/install.c
View file @
f0ea6004
...
...
@@ -1237,6 +1237,53 @@ static const CHAR uc_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"PublishProduct
\t\t
1200
\n
"
"InstallFinalize
\t\t
1300
\n
"
;
static
const
char
mixed_feature_dat
[]
=
"Feature
\t
Feature_Parent
\t
Title
\t
Description
\t
Display
\t
Level
\t
Directory_
\t
Attributes
\n
"
"s38
\t
S38
\t
L64
\t
L255
\t
I2
\t
i2
\t
S72
\t
i2
\n
"
"Feature
\t
Feature
\n
"
"feature1
\t\t\t\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
"feature2
\t\t\t\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
;
static
const
char
mixed_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"feature1
\t
comp1
\n
"
"feature2
\t
comp2
\n
"
;
static
const
char
mixed_component_dat
[]
=
"Component
\t
ComponentId
\t
Directory_
\t
Attributes
\t
Condition
\t
KeyPath
\n
"
"s72
\t
S38
\t
s72
\t
i2
\t
S255
\t
S72
\n
"
"Component
\t
Component
\n
"
"comp1
\t
{DE9F0EF4-0ED3-495A-8105-060C0EA457B8}
\t
TARGETDIR
\t
4
\t\t
regdata1
\n
"
"comp2
\t
{4912DBE7-FC3A-4F91-BB5C-88F5C15C19A5}
\t
TARGETDIR
\t
260
\t\t
regdata2
\n
"
;
static
const
char
mixed_registry_dat
[]
=
"Registry
\t
Root
\t
Key
\t
Name
\t
Value
\t
Component_
\n
"
"s72
\t
i2
\t
l255
\t
L255
\t
L0
\t
s72
\n
"
"Registry
\t
Registry
\n
"
"regdata1
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
test1
\t\t
comp1
\n
"
"regdata2
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
test2
\t\t
comp2
\n
"
;
static
const
char
mixed_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"LaunchConditions
\t\t
100
\n
"
"CostInitialize
\t\t
200
\n
"
"FileCost
\t\t
300
\n
"
"CostFinalize
\t\t
400
\n
"
"InstallValidate
\t\t
500
\n
"
"InstallInitialize
\t\t
600
\n
"
"ProcessComponents
\t\t
700
\n
"
"UnpublishFeatures
\t\t
800
\n
"
"RemoveRegistryValues
\t\t
900
\n
"
"WriteRegistryValues
\t\t
1000
\n
"
"RegisterProduct
\t\t
1100
\n
"
"PublishFeatures
\t\t
1200
\n
"
"PublishProduct
\t\t
1300
\n
"
"InstallFinalize
\t\t
1400
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -1928,6 +1975,18 @@ static const msi_table uc_tables[] =
ADD_TABLE
(
uc_property
)
};
static
const
msi_table
mixed_tables
[]
=
{
ADD_TABLE
(
directory
),
ADD_TABLE
(
mixed_component
),
ADD_TABLE
(
mixed_feature
),
ADD_TABLE
(
mixed_feature_comp
),
ADD_TABLE
(
mixed_install_exec_seq
),
ADD_TABLE
(
mixed_registry
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -6618,6 +6677,86 @@ static void test_MsiSetFeatureAttributes(void)
DeleteFileA
(
msifile
);
}
static
void
test_mixed_package
(
void
)
{
UINT
r
;
LONG
res
;
HKEY
hkey
;
if
(
is_process_limited
())
{
skip
(
"process is limited
\n
"
);
return
;
}
if
(
!
is_wow64
&&
!
is_64bit
)
{
skip
(
"this test must be run on 64-bit
\n
"
);
return
;
}
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
create_database_template
(
msifile
,
mixed_tables
,
sizeof
(
mixed_tables
)
/
sizeof
(
msi_table
),
200
,
"x64;1033"
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
if
(
r
==
ERROR_INSTALL_PACKAGE_REJECTED
)
{
skip
(
"Not enough rights to perform tests
\n
"
);
goto
error
;
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_32KEY
,
&
hkey
);
ok
(
!
res
,
"can't open 32-bit component key
\n
"
);
res
=
RegQueryValueExA
(
hkey
,
"test1"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
res
,
"value test1 not found
\n
"
);
RegCloseKey
(
hkey
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
&
hkey
);
ok
(
!
res
,
"can't open 64-bit component key
\n
"
);
res
=
RegQueryValueExA
(
hkey
,
"test2"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
res
,
"value test2 not found
\n
"
);
RegCloseKey
(
hkey
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_32KEY
,
&
hkey
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"32-bit component key not removed
\n
"
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
&
hkey
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"64-bit component key not removed
\n
"
);
DeleteFileA
(
msifile
);
create_database_template
(
msifile
,
mixed_tables
,
sizeof
(
mixed_tables
)
/
sizeof
(
msi_table
),
200
,
"Intel;1033"
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_32KEY
,
&
hkey
);
ok
(
!
res
,
"can't open 32-bit component key
\n
"
);
res
=
RegQueryValueExA
(
hkey
,
"test1"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
res
,
"value test1 not found
\n
"
);
RegCloseKey
(
hkey
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
&
hkey
);
ok
(
!
res
,
"can't open 64-bit component key
\n
"
);
res
=
RegQueryValueExA
(
hkey
,
"test2"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
!
res
,
"value test2 not found
\n
"
);
RegCloseKey
(
hkey
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_32KEY
,
&
hkey
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"32-bit component key not removed
\n
"
);
res
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
msitest"
,
0
,
KEY_ALL_ACCESS
|
KEY_WOW64_64KEY
,
&
hkey
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"64-bit component key not removed
\n
"
);
error:
DeleteFileA
(
msifile
);
return
;
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -6709,6 +6848,7 @@ START_TEST(install)
test_upgrade_code
();
test_MsiGetFeatureInfo
();
test_MsiSetFeatureAttributes
();
test_mixed_package
();
DeleteFileA
(
log_file
);
...
...
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