Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b2c8f351
Commit
b2c8f351
authored
Feb 25, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for removing registry values.
parent
342f8660
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
0 deletions
+138
-0
install.c
dlls/msi/tests/install.c
+138
-0
No files found.
dlls/msi/tests/install.c
View file @
b2c8f351
...
@@ -1500,6 +1500,58 @@ static const CHAR rd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
...
@@ -1500,6 +1500,58 @@ static const CHAR rd_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"PublishProduct
\t\t
5200
\n
"
"PublishProduct
\t\t
5200
\n
"
"InstallFinalize
\t\t
6000
\n
"
;
"InstallFinalize
\t\t
6000
\n
"
;
static
const
CHAR
rrv_file_dat
[]
=
"File
\t
Component_
\t
FileName
\t
FileSize
\t
Version
\t
Language
\t
Attributes
\t
Sequence
\n
"
"s72
\t
s72
\t
l255
\t
i4
\t
S72
\t
S20
\t
I2
\t
i2
\n
"
"File
\t
File
\n
"
"registry.txt
\t
registry
\t
registry.txt
\t
1000
\t\t\t
8192
\t
1
\n
"
;
static
const
CHAR
rrv_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
"
"registry
\t\t\t
registry feature
\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
;
static
const
CHAR
rrv_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"registry
\t
registry
\n
"
;
static
const
CHAR
rrv_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
"
"registry
\t
{DA97585B-962D-45EB-AD32-DA15E60CA9EE}
\t
MSITESTDIR
\t
0
\t\t
registry.txt
\n
"
;
static
const
CHAR
rrv_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
"
"reg1
\t
2
\t
SOFTWARE
\\
Wine
\\
keyA
\t\t
A
\t
registry
\n
"
"reg2
\t
2
\t
SOFTWARE
\\
Wine
\\
keyA
\t
valueA
\t
A
\t
registry
\n
"
"reg3
\t
2
\t
SOFTWARE
\\
Wine
\\
key1
\t
-
\t\t
registry
\n
"
;
static
const
CHAR
rrv_remove_registry_dat
[]
=
"RemoveRegistry
\t
Root
\t
Key
\t
Name
\t
Component_
\n
"
"s72
\t
i2
\t
l255
\t
L255
\t
s72
\n
"
"RemoveRegistry
\t
RemoveRegistry
\n
"
"reg1
\t
2
\t
SOFTWARE
\\
Wine
\\
keyB
\t\t
registry
\n
"
"reg2
\t
2
\t
SOFTWARE
\\
Wine
\\
keyB
\t
ValueB
\t
registry
\n
"
"reg3
\t
2
\t
SOFTWARE
\\
Wine
\\
key2
\t
-
\t
registry
\n
"
;
static
const
CHAR
rrv_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
800
\n
"
"FileCost
\t\t
900
\n
"
"CostFinalize
\t\t
1000
\n
"
"InstallValidate
\t\t
1400
\n
"
"InstallInitialize
\t\t
1500
\n
"
"ProcessComponents
\t\t
1600
\n
"
"RemoveFiles
\t\t
1700
\n
"
"InstallFiles
\t\t
2000
\n
"
"RemoveRegistryValues
\t\t
3000
\n
"
"RegisterProduct
\t\t
5000
\n
"
"PublishFeatures
\t\t
5100
\n
"
"PublishProduct
\t\t
5200
\n
"
"InstallFinalize
\t\t
6000
\n
"
;
typedef
struct
_msi_table
typedef
struct
_msi_table
{
{
const
CHAR
*
filename
;
const
CHAR
*
filename
;
...
@@ -2363,6 +2415,20 @@ static const msi_table rd_tables[] =
...
@@ -2363,6 +2415,20 @@ static const msi_table rd_tables[] =
ADD_TABLE
(
property
)
ADD_TABLE
(
property
)
};
};
static
const
msi_table
rrv_tables
[]
=
{
ADD_TABLE
(
directory
),
ADD_TABLE
(
rrv_component
),
ADD_TABLE
(
rrv_feature
),
ADD_TABLE
(
rrv_feature_comp
),
ADD_TABLE
(
rrv_file
),
ADD_TABLE
(
rrv_registry
),
ADD_TABLE
(
rrv_remove_registry
),
ADD_TABLE
(
rrv_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* cabinet definitions */
/* make the max size large so there is only one cab file */
/* make the max size large so there is only one cab file */
...
@@ -8396,6 +8462,77 @@ static void test_remove_duplicate_files(void)
...
@@ -8396,6 +8462,77 @@ static void test_remove_duplicate_files(void)
delete_test_files
();
delete_test_files
();
}
}
static
void
test_remove_registry_values
(
void
)
{
UINT
r
;
LONG
res
;
HKEY
key
;
create_test_files
();
create_file
(
"msitest
\\
registry.txt"
,
1000
);
create_database
(
msifile
,
rrv_tables
,
sizeof
(
rrv_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key1"
,
&
key
);
RegSetValueExA
(
key
,
"value1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"1"
,
2
);
RegCloseKey
(
key
);
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key2"
,
&
key
);
RegSetValueExA
(
key
,
"value2"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"2"
,
2
);
RegCloseKey
(
key
);
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
keyA"
,
&
key
);
RegSetValueExA
(
key
,
""
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"default"
,
8
);
RegSetValueExA
(
key
,
"valueA"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"A"
,
2
);
RegSetValueExA
(
key
,
"valueB"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"B"
,
2
);
RegCloseKey
(
key
);
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
keyB"
,
&
key
);
RegSetValueExA
(
key
,
""
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"default"
,
8
);
RegSetValueExA
(
key
,
"valueB"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"B"
,
2
);
RegCloseKey
(
key
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key1"
,
&
key
);
ok
(
res
==
ERROR_SUCCESS
,
"key removed
\n
"
);
RegCloseKey
(
key
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key2"
,
&
key
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"key not removed
\n
"
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key2"
,
&
key
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
RegCloseKey
(
key
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key1"
,
&
key
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"key not removed
\n
"
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key2"
,
&
key
);
ok
(
res
==
ERROR_SUCCESS
,
"key removed
\n
"
);
RegCloseKey
(
key
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
keyA"
,
&
key
);
ok
(
res
==
ERROR_SUCCESS
,
"key removed
\n
"
);
RegCloseKey
(
key
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
keyB"
,
&
key
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"key not removed
\n
"
);
RegDeleteKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
keyA"
);
RegDeleteKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
key2"
);
RegDeleteKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine"
);
ok
(
!
delete_pf
(
"msitest
\\
registry.txt"
,
TRUE
),
"file not removed
\n
"
);
todo_wine
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"directory not removed
\n
"
);
delete_test_files
();
}
START_TEST
(
install
)
START_TEST
(
install
)
{
{
DWORD
len
;
DWORD
len
;
...
@@ -8499,6 +8636,7 @@ START_TEST(install)
...
@@ -8499,6 +8636,7 @@ START_TEST(install)
test_create_remove_shortcut
();
test_create_remove_shortcut
();
test_publish_components
();
test_publish_components
();
test_remove_duplicate_files
();
test_remove_duplicate_files
();
test_remove_registry_values
();
DeleteFileA
(
log_file
);
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