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
246f9305
Commit
246f9305
authored
Feb 01, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Don't fail if the service to start is already running.
parent
d7069b61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
1 deletion
+102
-1
action.c
dlls/msi/action.c
+2
-1
install.c
dlls/msi/tests/install.c
+100
-0
No files found.
dlls/msi/action.c
View file @
246f9305
...
@@ -4492,7 +4492,8 @@ static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
...
@@ -4492,7 +4492,8 @@ static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
vector
=
msi_service_args_to_vector
(
args
,
&
numargs
);
vector
=
msi_service_args_to_vector
(
args
,
&
numargs
);
if
(
!
StartServiceW
(
service
,
numargs
,
vector
))
if
(
!
StartServiceW
(
service
,
numargs
,
vector
)
&&
GetLastError
()
!=
ERROR_SERVICE_ALREADY_RUNNING
)
{
{
ERR
(
"Failed to start service %s (%u)
\n
"
,
debugstr_w
(
name
),
GetLastError
());
ERR
(
"Failed to start service %s (%u)
\n
"
,
debugstr_w
(
name
),
GetLastError
());
goto
done
;
goto
done
;
...
...
dlls/msi/tests/install.c
View file @
246f9305
...
@@ -349,6 +349,29 @@ static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArgument
...
@@ -349,6 +349,29 @@ static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArgument
"ServiceControl
\t
ServiceControl
\n
"
"ServiceControl
\t
ServiceControl
\n
"
"ServiceControl
\t
TestService
\t
8
\t\t
0
\t
service_comp"
;
"ServiceControl
\t
TestService
\t
8
\t\t
0
\t
service_comp"
;
static
const
CHAR
sss_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
TermService
\t
1
\t\t
0
\t
service_comp"
;
static
const
CHAR
sss_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"CostFinalize
\t\t
1000
\n
"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"ResolveSource
\t\t
950
\n
"
"MoveFiles
\t\t
1700
\n
"
"InstallFiles
\t\t
4000
\n
"
"DuplicateFiles
\t\t
4500
\n
"
"WriteEnvironmentStrings
\t\t
4550
\n
"
"CreateShortcuts
\t\t
4600
\n
"
"StartServices
\t\t
5000
\n
"
"InstallFinalize
\t\t
6600
\n
"
"InstallInitialize
\t\t
1500
\n
"
"InstallValidate
\t\t
1400
\n
"
"LaunchConditions
\t\t
100
\n
"
;
/* tables for test_continuouscabs */
/* tables for test_continuouscabs */
static
const
CHAR
cc_component_dat
[]
=
"Component
\t
ComponentId
\t
Directory_
\t
Attributes
\t
Condition
\t
KeyPath
\n
"
static
const
CHAR
cc_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
"
"s72
\t
S38
\t
s72
\t
i2
\t
S255
\t
S72
\n
"
...
@@ -1812,6 +1835,19 @@ static const msi_table cf_tables[] =
...
@@ -1812,6 +1835,19 @@ static const msi_table cf_tables[] =
ADD_TABLE
(
property
)
ADD_TABLE
(
property
)
};
};
static
const
msi_table
sss_tables
[]
=
{
ADD_TABLE
(
component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
feature
),
ADD_TABLE
(
feature_comp
),
ADD_TABLE
(
file
),
ADD_TABLE
(
sss_install_exec_seq
),
ADD_TABLE
(
sss_service_control
),
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 */
...
@@ -7410,6 +7446,69 @@ static void test_create_folder(void)
...
@@ -7410,6 +7446,69 @@ static void test_create_folder(void)
delete_test_files
();
delete_test_files
();
}
}
static
void
test_start_services
(
void
)
{
UINT
r
;
SC_HANDLE
scm
,
service
;
BOOL
ret
;
DWORD
error
=
ERROR_SUCCESS
;
scm
=
OpenSCManager
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
ok
(
scm
!=
NULL
,
"Failed to open the SC Manager
\n
"
);
service
=
OpenService
(
scm
,
"TermService"
,
SC_MANAGER_ALL_ACCESS
);
ok
(
service
!=
NULL
,
"Failed to open TermService
\n
"
);
ret
=
StartService
(
service
,
0
,
NULL
);
if
(
!
ret
&&
(
error
=
GetLastError
())
!=
ERROR_SERVICE_ALREADY_RUNNING
)
{
skip
(
"Terminal service not available, skipping test
\n
"
);
CloseServiceHandle
(
service
);
CloseServiceHandle
(
scm
);
return
;
}
CloseServiceHandle
(
service
);
CloseServiceHandle
(
scm
);
create_test_files
();
create_database
(
msifile
,
sss_tables
,
sizeof
(
sss_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
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"
,
FALSE
),
"Directory not created
\n
"
);
delete_test_files
();
if
(
error
==
ERROR_SUCCESS
)
{
SERVICE_STATUS
status
;
scm
=
OpenSCManager
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
service
=
OpenService
(
scm
,
"TermService"
,
SC_MANAGER_ALL_ACCESS
);
ret
=
ControlService
(
service
,
SERVICE_CONTROL_STOP
,
&
status
);
ok
(
ret
,
"ControlService failed %u
\n
"
,
GetLastError
());
CloseServiceHandle
(
service
);
CloseServiceHandle
(
scm
);
}
}
START_TEST
(
install
)
START_TEST
(
install
)
{
{
DWORD
len
;
DWORD
len
;
...
@@ -7502,6 +7601,7 @@ START_TEST(install)
...
@@ -7502,6 +7601,7 @@ START_TEST(install)
test_allusers_prop
();
test_allusers_prop
();
test_feature_override
();
test_feature_override
();
test_create_folder
();
test_create_folder
();
test_start_services
();
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