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
aaf5ffb2
Commit
aaf5ffb2
authored
Mar 03, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for removing environment strings.
parent
f6221119
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
180 additions
and
0 deletions
+180
-0
install.c
dlls/msi/tests/install.c
+180
-0
No files found.
dlls/msi/tests/install.c
View file @
aaf5ffb2
...
...
@@ -1649,6 +1649,53 @@ static const CHAR riv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"PublishProduct
\t\t
5200
\n
"
"InstallFinalize
\t\t
6000
\n
"
;
static
const
CHAR
res_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
"
"envvar.txt
\t
envvar
\t
envvar.txt
\t
1000
\t\t\t
8192
\t
1
\n
"
;
static
const
CHAR
res_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
"
"envvar
\t\t\t
envvar feature
\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
;
static
const
CHAR
res_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"envvar
\t
envvar
\n
"
;
static
const
CHAR
res_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
"
"envvar
\t
{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}
\t
MSITESTDIR
\t
0
\t\t
envvar.txt
\n
"
;
static
const
CHAR
res_environment_dat
[]
=
"Environment
\t
Name
\t
Value
\t
Component_
\n
"
"s72
\t
l255
\t
L255
\t
s72
\n
"
"Environment
\t
Environment
\n
"
"var1
\t
=-MSITESTVAR1
\t
1
\t
envvar
\n
"
"var2
\t
=+-MSITESTVAR2
\t
1
\t
envvar
\n
"
"var3
\t
=MSITESTVAR3
\t
1
\t
envvar
\n
"
"var4
\t
=-MSITESTVAR4
\t\t
envvar
\n
"
"var5
\t
=MSITESTVAR5
\t\t
envvar
\n
"
;
static
const
CHAR
res_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
"
"RemoveEnvironmentStrings
\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
{
const
CHAR
*
filename
;
...
...
@@ -2554,6 +2601,19 @@ static const msi_table riv_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
res_tables
[]
=
{
ADD_TABLE
(
directory
),
ADD_TABLE
(
res_component
),
ADD_TABLE
(
res_feature
),
ADD_TABLE
(
res_feature_comp
),
ADD_TABLE
(
res_file
),
ADD_TABLE
(
res_environment
),
ADD_TABLE
(
res_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -8704,6 +8764,125 @@ static void test_remove_ini_values(void)
delete_test_files
();
}
static
void
test_remove_env_strings
(
void
)
{
UINT
r
;
LONG
res
;
HKEY
key
;
DWORD
type
,
size
;
char
buffer
[
0x10
];
if
(
on_win9x
)
{
win_skip
(
"Environment variables are handled differently on win9x and winme
\n
"
);
return
;
}
create_test_files
();
create_file
(
"msitest
\\
envvar.txt"
,
1000
);
create_database
(
msifile
,
res_tables
,
sizeof
(
res_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
res
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Environment"
,
&
key
);
ok
(
!
res
,
"failed to open environment key %d
\n
"
,
res
);
RegSetValueExA
(
key
,
"MSITESTVAR1"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"1"
,
2
);
RegSetValueExA
(
key
,
"MSITESTVAR2"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"1"
,
2
);
RegSetValueExA
(
key
,
"MSITESTVAR3"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"1"
,
2
);
RegSetValueExA
(
key
,
"MSITESTVAR4"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"1"
,
2
);
RegSetValueExA
(
key
,
"MSITESTVAR5"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"1"
,
2
);
RegCloseKey
(
key
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Environment"
,
&
key
);
ok
(
!
res
,
"failed to open environment key %d
\n
"
,
res
);
type
=
REG_NONE
;
buffer
[
0
]
=
0
;
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR1"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"expected REG_SZ, got %u
\n
"
,
type
);
ok
(
!
lstrcmp
(
buffer
,
"1"
),
"expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buffer
);
type
=
REG_NONE
;
buffer
[
0
]
=
0
;
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR2"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"expected REG_SZ, got %u
\n
"
,
type
);
ok
(
!
lstrcmp
(
buffer
,
"1"
),
"expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buffer
);
type
=
REG_NONE
;
buffer
[
0
]
=
0
;
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR3"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"expected REG_SZ, got %u
\n
"
,
type
);
ok
(
!
lstrcmp
(
buffer
,
"1"
),
"expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buffer
);
type
=
REG_NONE
;
buffer
[
0
]
=
0
;
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR4"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"expected REG_SZ, got %u
\n
"
,
type
);
ok
(
!
lstrcmp
(
buffer
,
"1"
),
"expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buffer
);
type
=
REG_NONE
;
buffer
[
0
]
=
0
;
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR5"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"expected REG_SZ, got %u
\n
"
,
type
);
ok
(
!
lstrcmp
(
buffer
,
"1"
),
"expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buffer
);
RegCloseKey
(
key
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
res
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Environment"
,
&
key
);
ok
(
!
res
,
"failed to open environment key %d
\n
"
,
res
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR1"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
res
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR2"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
res
);
type
=
REG_NONE
;
buffer
[
0
]
=
0
;
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR3"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"expected REG_SZ, got %u
\n
"
,
type
);
ok
(
!
lstrcmp
(
buffer
,
"1"
),
"expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buffer
);
RegDeleteValueA
(
key
,
"MSITESTVAR3"
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR4"
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
res
);
type
=
REG_NONE
;
buffer
[
0
]
=
0
;
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"MSITESTVAR5"
,
NULL
,
&
type
,
(
LPBYTE
)
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
type
==
REG_SZ
,
"expected REG_SZ, got %u
\n
"
,
type
);
ok
(
!
lstrcmp
(
buffer
,
"1"
),
"expected
\"
1
\"
, got
\"
%s
\"\n
"
,
buffer
);
RegDeleteValueA
(
key
,
"MSITESTVAR5"
);
RegCloseKey
(
key
);
ok
(
!
delete_pf
(
"msitest
\\
envvar.txt"
,
TRUE
),
"file not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"directory not removed
\n
"
);
delete_test_files
();
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -8810,6 +8989,7 @@ START_TEST(install)
test_remove_registry_values
();
test_find_related_products
();
test_remove_ini_values
();
test_remove_env_strings
();
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