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
1ae3bcc9
Commit
1ae3bcc9
authored
Feb 21, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Don't install services without an image path.
Spotted by Aric Stewart.
parent
175dc763
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
3 deletions
+99
-3
action.c
dlls/msi/action.c
+1
-1
action.c
dlls/msi/tests/action.c
+98
-2
No files found.
dlls/msi/action.c
View file @
1ae3bcc9
...
...
@@ -5793,7 +5793,7 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
ERR
(
"Query failed
\n
"
);
goto
done
;
}
key
=
MSI_RecordGetString
(
row
,
6
)
;
if
(
!
(
key
=
MSI_RecordGetString
(
row
,
6
)))
goto
done
;
file
=
msi_get_loaded_file
(
package
,
key
);
msiobj_release
(
&
row
->
hdr
);
if
(
!
file
)
...
...
dlls/msi/tests/action.c
View file @
1ae3bcc9
...
...
@@ -78,7 +78,8 @@ static const char component_dat[] =
"dangler
\t
{6091DF25-EF96-45F1-B8E9-A9B1420C7A3C}
\t
TARGETDIR
\t
4
\t\t
regdata
\n
"
"component
\t\t
MSITESTDIR
\t
0
\t
1
\t
file
\n
"
"service_comp
\t
{935A0A91-22A3-4F87-BCA8-928FFDFE2353}
\t
MSITESTDIR
\t
0
\t\t
service_file
\n
"
"service_comp2
\t
{3F7B04A4-9521-4649-BDC9-0C8722740A49}
\t
MSITESTDIR
\t
0
\t\t
service_file2"
;
"service_comp2
\t
{3F7B04A4-9521-4649-BDC9-0C8722740A49}
\t
MSITESTDIR
\t
0
\t\t
service_file2
\n
"
"service_comp3
\t
{DBCD1502-20E3-423F-B53E-F37E263CDC7E}
\t
MSITESTDIR
\t
0
\t\t\n
"
;
static
const
char
directory_dat
[]
=
"Directory
\t
Directory_Parent
\t
DefaultDir
\n
"
...
...
@@ -115,7 +116,8 @@ static const char feature_comp_dat[] =
"Two
\t
Two
\n
"
"feature
\t
component
\n
"
"service_feature
\t
service_comp
\n
"
"service_feature
\t
service_comp2"
;
"service_feature
\t
service_comp2
\n
"
"service_feature
\t
service_comp3"
;
static
const
char
file_dat
[]
=
"File
\t
Component_
\t
FileName
\t
FileSize
\t
Version
\t
Language
\t
Attributes
\t
Sequence
\n
"
...
...
@@ -223,6 +225,14 @@ static const char service_install_dat[] =
"TestService
\t
[SERVNAME]
\t
[SERVDISP]
\t
2
\t
3
\t
0
\t\t
service1[~]+group1[~]service2[~]+group2[~][~]
\t
TestService
\t\t
-a arg
\t
service_comp
\t
description
\n
"
"TestService2
\t
SERVNAME2]
\t
[SERVDISP2]
\t
2
\t
3
\t
0
\t\t
service1[~]+group1[~]service2[~]+group2[~][~]
\t
TestService2
\t\t
-a arg
\t
service_comp2
\t
description"
;
static
const
char
service_install2_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\n
"
"TestService4
\t
TestService4
\t
TestService4
\t
2
\t
3
\t
0
\t\t\t
TestService4
\t\t\t
service_comp3
\t\n
"
;
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
"
...
...
@@ -1681,6 +1691,19 @@ static const msi_table sds_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
sis_tables
[]
=
{
ADD_TABLE
(
component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
feature
),
ADD_TABLE
(
feature_comp
),
ADD_TABLE
(
file
),
ADD_TABLE
(
sds_install_exec_seq
),
ADD_TABLE
(
service_install2
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
static
const
msi_table
sr_tables
[]
=
{
ADD_TABLE
(
component
),
...
...
@@ -5263,6 +5286,78 @@ error:
DeleteFileA
(
msifile
);
}
static
void
test_install_services
(
void
)
{
UINT
r
;
SC_HANDLE
manager
,
service
;
BOOL
ret
;
if
(
is_process_limited
())
{
skip
(
"process is limited
\n
"
);
return
;
}
create_test_files
();
create_database
(
msifile
,
sis_tables
,
sizeof
(
sis_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
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
);
manager
=
OpenSCManagerA
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
ok
(
manager
!=
NULL
,
"can't open service manager
\n
"
);
if
(
!
manager
)
goto
error
;
service
=
OpenServiceA
(
manager
,
"TestService"
,
GENERIC_ALL
);
ok
(
service
!=
NULL
,
"TestService not installed
\n
"
);
CloseServiceHandle
(
service
);
service
=
OpenServiceA
(
manager
,
"TestService4"
,
GENERIC_ALL
);
ok
(
service
==
NULL
,
"TestService4 installed
\n
"
);
CloseServiceHandle
(
manager
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
changed
\\
three.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
changed"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
service2.exe"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"Directory not created
\n
"
);
manager
=
OpenSCManagerA
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
ok
(
manager
!=
NULL
,
"can't open service manager
\n
"
);
if
(
!
manager
)
goto
error
;
service
=
OpenServiceA
(
manager
,
"TestService"
,
GENERIC_ALL
);
ok
(
service
!=
NULL
,
"TestService doesn't exist
\n
"
);
ret
=
DeleteService
(
service
);
ok
(
ret
,
"failed to delete service %u
\n
"
,
GetLastError
()
);
CloseServiceHandle
(
service
);
CloseServiceHandle
(
manager
);
error:
delete_test_files
();
DeleteFileA
(
msifile
);
}
static
void
test_self_registration
(
void
)
{
UINT
r
;
...
...
@@ -6476,6 +6571,7 @@ START_TEST(action)
test_create_remove_folder
();
test_start_services
();
test_delete_services
();
test_install_services
();
test_self_registration
();
test_register_font
();
test_validate_product_id
();
...
...
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