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
d6632dd0
Commit
d6632dd0
authored
Oct 18, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Oct 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for the InstallServices action.
parent
39c4bbe5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
7 deletions
+51
-7
install.c
dlls/msi/tests/install.c
+51
-7
No files found.
dlls/msi/tests/install.c
View file @
d6632dd0
...
...
@@ -72,7 +72,8 @@ static const CHAR component_dat[] = "Component\tComponentId\tDirectory_\tAttribu
"Three
\t
{010B6ADD-B27D-4EDD-9B3D-34C4F7D61684}
\t
CHANGEDDIR
\t
2
\t\t
three.txt
\n
"
"Two
\t
{BF03D1A6-20DA-4A65-82F3-6CAC995915CE}
\t
FIRSTDIR
\t
2
\t\t
two.txt
\n
"
"dangler
\t
{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}
\t
TARGETDIR
\t
4
\t\t
regdata
\n
"
"component
\t\t
TARGETDIR
\t
0
\t
1
\t
file"
;
"component
\t\t
MSITESTDIR
\t
0
\t
1
\t
file
\n
"
"service_comp
\t\t
MSITESTDIR
\t
0
\t
1
\t
service_file"
;
static
const
CHAR
directory_dat
[]
=
"Directory
\t
Directory_Parent
\t
DefaultDir
\n
"
"s72
\t
S72
\t
l255
\n
"
...
...
@@ -93,7 +94,8 @@ static const CHAR feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\t
"One
\t\t
One
\t
The One Feature
\t
1
\t
3
\t
MSITESTDIR
\t
0
\n
"
"Three
\t\t
Three
\t
The Three Feature
\t
3
\t
3
\t
CHANGEDDIR
\t
0
\n
"
"Two
\t\t
Two
\t
The Two Feature
\t
2
\t
3
\t
FIRSTDIR
\t
0
\n
"
"feature
\t\t\t\t
2
\t
1
\t
TARGETDIR
\t
0"
;
"feature
\t\t\t\t
2
\t
1
\t
TARGETDIR
\t
0
\n
"
"service_feature
\t\t\t\t
2
\t
1
\t
TARGETDIR
\t
0"
;
static
const
CHAR
feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
...
...
@@ -103,7 +105,8 @@ static const CHAR feature_comp_dat[] = "Feature_\tComponent_\n"
"One
\t
One
\n
"
"Three
\t
Three
\n
"
"Two
\t
Two
\n
"
"feature
\t
component"
;
"feature
\t
component
\n
"
"service_feature
\t
service_comp
\n
"
;
static
const
CHAR
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
"
...
...
@@ -113,7 +116,8 @@ static const CHAR file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tL
"one.txt
\t
One
\t
one.txt
\t
1000
\t\t\t
0
\t
1
\n
"
"three.txt
\t
Three
\t
three.txt
\t
1000
\t\t\t
0
\t
3
\n
"
"two.txt
\t
Two
\t
two.txt
\t
1000
\t\t\t
0
\t
2
\n
"
"file
\t
component
\t
filename
\t
100
\t\t\t
8192
\t
1"
;
"file
\t
component
\t
filename
\t
100
\t\t\t
8192
\t
1
\n
"
"service_file
\t
service_comp
\t
service.exe
\t
100
\t\t\t
8192
\t
1"
;
static
const
CHAR
install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
...
...
@@ -123,6 +127,7 @@ static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"InstallFiles
\t\t
4000
\n
"
"InstallServices
\t\t
5000
\n
"
"InstallFinalize
\t\t
6600
\n
"
"InstallInitialize
\t\t
1500
\n
"
"InstallValidate
\t\t
1400
\n
"
...
...
@@ -160,6 +165,17 @@ static const CHAR registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_
"regdata
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
blah
\t
bad
\t
dangler
\n
"
"OrderTest
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
OrderTestName
\t
OrderTestValue
\t
component"
;
static
const
CHAR
service_install_dat
[]
=
"ServiceInstall
\t
Name
\t
DisplayName
\t
ServiceType
\t
StartType
\t
ErrorControl
\t
"
"LoadOrderGroup
\t
Dependencies
\t
StartName
\t
Password
\t
Arguments
\t
Component_
\t
Description
\n
"
"s72
\t
s255
\t
L255
\t
i4
\t
i4
\t
i4
\t
S255
\t
S255
\t
S255
\t
S255
\t
S255
\t
s72
\t
L255
\n
"
"ServiceInstall
\t
ServiceInstall
\n
"
"TestService
\t
TestService
\t
TestService
\t
2
\t
3
\t
0
\t\t\t
TestService
\t\t\t
service_comp
\t\t
"
;
static
const
CHAR
service_control_dat
[]
=
"ServiceControl
\t
Name
\t
Event
\t
Arguments
\t
Wait
\t
Component_
\n
"
"s72
\t
l255
\t
i2
\t
L255
\t
I2
\t
s72
\n
"
"ServiceControl
\t
ServiceControl
\n
"
"ServiceControl
\t
TestService
\t
8
\t\t
0
\t
service_comp"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -181,7 +197,9 @@ static const msi_table tables[] =
ADD_TABLE
(
install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
),
ADD_TABLE
(
registry
)
ADD_TABLE
(
registry
),
ADD_TABLE
(
service_install
),
ADD_TABLE
(
service_control
)
};
/* cabinet definitions */
...
...
@@ -491,7 +509,8 @@ static void create_test_files(void)
create_file
(
"five.txt"
);
create_cab_file
(
"msitest.cab"
);
create_file
(
"filename"
);
create_file
(
"msitest
\\
filename"
);
create_file
(
"msitest
\\
service.exe"
);
DeleteFileA
(
"four.txt"
);
DeleteFileA
(
"five.txt"
);
...
...
@@ -513,12 +532,13 @@ static BOOL delete_pf(const CHAR *rel_path, BOOL is_file)
static
void
delete_test_files
(
void
)
{
DeleteFileA
(
"filename"
);
DeleteFileA
(
"msitest.msi"
);
DeleteFileA
(
"msitest.cab"
);
DeleteFileA
(
"msitest
\\
second
\\
three.txt"
);
DeleteFileA
(
"msitest
\\
first
\\
two.txt"
);
DeleteFileA
(
"msitest
\\
one.txt"
);
DeleteFileA
(
"msitest
\\
service.exe"
);
DeleteFileA
(
"msitest
\\
filename"
);
RemoveDirectoryA
(
"msitest
\\
second"
);
RemoveDirectoryA
(
"msitest
\\
first"
);
RemoveDirectoryA
(
"msitest"
);
...
...
@@ -593,6 +613,27 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t
MsiCloseHandle
(
db
);
}
static
void
check_service_is_installed
(
void
)
{
SC_HANDLE
scm
,
service
;
BOOL
res
;
scm
=
OpenSCManager
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
ok
(
scm
!=
NULL
,
"Failed to open the SC Manager
\n
"
);
service
=
OpenService
(
scm
,
"TestService"
,
SC_MANAGER_ALL_ACCESS
);
todo_wine
{
ok
(
service
!=
NULL
,
"Failed to open TestService
\n
"
);
}
res
=
DeleteService
(
service
);
todo_wine
{
ok
(
res
,
"Failed to delete TestService
\n
"
);
}
}
static
void
test_MsiInstallProduct
(
void
)
{
UINT
r
;
...
...
@@ -618,6 +659,8 @@ static void test_MsiInstallProduct(void)
ok
(
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File not installed
\n
"
);
}
...
...
@@ -650,6 +693,7 @@ static void test_MsiInstallProduct(void)
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
!
lstrcmpA
(
path
,
"OrderTestValue"
),
"Expected imaname, got %s
\n
"
,
path
);
check_service_is_installed
();
RegDeleteKeyA
(
HKEY_LOCAL_MACHINE
,
"SOFTWARE
\\
Wine
\\
msitest"
);
...
...
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