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
75ec82bb
Commit
75ec82bb
authored
Mar 02, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for removing values from .ini files.
parent
b891d088
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
114 additions
and
0 deletions
+114
-0
install.c
dlls/msi/tests/install.c
+114
-0
No files found.
dlls/msi/tests/install.c
View file @
75ec82bb
...
...
@@ -1601,6 +1601,54 @@ static const CHAR frp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"PublishProduct
\t\t
5200
\n
"
"InstallFinalize
\t\t
6000
\n
"
;
static
const
CHAR
riv_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
"
"inifile.txt
\t
inifile
\t
inifile.txt
\t
1000
\t\t\t
8192
\t
1
\n
"
;
static
const
CHAR
riv_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
"
"inifile
\t\t\t
inifile feature
\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
;
static
const
CHAR
riv_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"inifile
\t
inifile
\n
"
;
static
const
CHAR
riv_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
"
"inifile
\t
{A0F15705-4F57-4437-88C4-6C8B37ACC6DE}
\t
MSITESTDIR
\t
0
\t\t
inifile.txt
\n
"
;
static
const
CHAR
riv_ini_file_dat
[]
=
"IniFile
\t
FileName
\t
DirProperty
\t
Section
\t
Key
\t
Value
\t
Action
\t
Component_
\n
"
"s72
\t
l255
\t
S72
\t
l96
\t
l128
\t
l255
\t
i2
\t
s72
\n
"
"IniFile
\t
IniFile
\n
"
"inifile1
\t
test.ini
\t
MSITESTDIR
\t
section1
\t
key1
\t
value1
\t
0
\t
inifile
\n
"
;
static
const
CHAR
riv_remove_ini_file_dat
[]
=
"RemoveIniFile
\t
FileName
\t
DirProperty
\t
Section
\t
Key
\t
Value
\t
Action
\t
Component_
\n
"
"s72
\t
l255
\t
S72
\t
l96
\t
l128
\t
L255
\t
i2
\t
s72
\n
"
"RemoveIniFile
\t
RemoveIniFile
\n
"
"inifile1
\t
test.ini
\t
MSITESTDIR
\t
sectionA
\t
keyA
\t
valueA
\t
2
\t
inifile
\n
"
;
static
const
CHAR
riv_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
"
"RemoveIniValues
\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
;
...
...
@@ -2492,6 +2540,20 @@ static const msi_table frp_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
riv_tables
[]
=
{
ADD_TABLE
(
directory
),
ADD_TABLE
(
riv_component
),
ADD_TABLE
(
riv_feature
),
ADD_TABLE
(
riv_feature_comp
),
ADD_TABLE
(
riv_file
),
ADD_TABLE
(
riv_ini_file
),
ADD_TABLE
(
riv_remove_ini_file
),
ADD_TABLE
(
riv_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -8591,6 +8653,57 @@ static void test_find_related_products(void)
delete_test_files
();
}
static
void
test_remove_ini_values
(
void
)
{
UINT
r
;
DWORD
len
;
char
inifile
[
MAX_PATH
],
buf
[
0x10
];
HANDLE
file
;
BOOL
ret
;
create_test_files
();
create_file
(
"msitest
\\
inifile.txt"
,
1000
);
create_database
(
msifile
,
riv_tables
,
sizeof
(
riv_tables
)
/
sizeof
(
msi_table
));
lstrcpyA
(
inifile
,
PROG_FILES_DIR
);
lstrcatA
(
inifile
,
"
\\
msitest"
);
CreateDirectoryA
(
inifile
,
NULL
);
lstrcatA
(
inifile
,
"
\\
test.ini"
);
file
=
CreateFileA
(
inifile
,
GENERIC_WRITE
|
GENERIC_READ
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
CloseHandle
(
file
);
ret
=
WritePrivateProfileStringA
(
"section1"
,
"key1"
,
"value1"
,
inifile
);
ok
(
ret
,
"failed to write profile string %u
\n
"
,
GetLastError
());
ret
=
WritePrivateProfileStringA
(
"sectionA"
,
"keyA"
,
"valueA"
,
inifile
);
ok
(
ret
,
"failed to write profile string %u
\n
"
,
GetLastError
());
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
len
=
GetPrivateProfileStringA
(
"section1"
,
"key1"
,
NULL
,
buf
,
sizeof
(
buf
),
inifile
);
ok
(
len
==
6
,
"got %u expected 6
\n
"
,
len
);
len
=
GetPrivateProfileStringA
(
"sectionA"
,
"keyA"
,
NULL
,
buf
,
sizeof
(
buf
),
inifile
);
ok
(
!
len
,
"got %u expected 0
\n
"
,
len
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
len
=
GetPrivateProfileStringA
(
"section1"
,
"key1"
,
NULL
,
buf
,
sizeof
(
buf
),
inifile
);
ok
(
!
len
,
"got %u expected 0
\n
"
,
len
);
len
=
GetPrivateProfileStringA
(
"sectionA"
,
"keyA"
,
NULL
,
buf
,
sizeof
(
buf
),
inifile
);
ok
(
!
len
,
"got %u expected 0
\n
"
,
len
);
todo_wine
ok
(
!
delete_pf
(
"msitest
\\
test.ini"
,
TRUE
),
"file removed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
inifile.txt"
,
TRUE
),
"file not removed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"directory removed
\n
"
);
delete_test_files
();
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -8696,6 +8809,7 @@ START_TEST(install)
test_remove_duplicate_files
();
test_remove_registry_values
();
test_find_related_products
();
test_remove_ini_values
();
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