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
9bc12ade
Commit
9bc12ade
authored
Oct 19, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Oct 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement the InstallServices action.
parent
1f766011
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
15 deletions
+97
-15
action.c
dlls/msi/action.c
+95
-7
install.c
dlls/msi/tests/install.c
+2
-8
No files found.
dlls/msi/action.c
View file @
9bc12ade
...
...
@@ -34,6 +34,7 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/stand
#include "winbase.h"
#include "winerror.h"
#include "winreg.h"
#include "winsvc.h"
#include "wine/debug.h"
#include "msidefs.h"
#include "msipriv.h"
...
...
@@ -4075,6 +4076,100 @@ static UINT ACTION_PublishComponents(MSIPACKAGE *package)
return
rc
;
}
static
UINT
ITERATE_InstallService
(
MSIRECORD
*
rec
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
(
MSIPACKAGE
*
)
param
;
MSIRECORD
*
row
;
MSIFILE
*
file
;
SC_HANDLE
hscm
,
service
=
NULL
;
LPCWSTR
name
,
disp
,
comp
,
depends
,
pass
;
LPCWSTR
load_order
,
serv_name
,
key
;
DWORD
serv_type
,
start_type
;
DWORD
err_control
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'o'
,
'm'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'C'
,
'o'
,
'm'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
'`'
,
' '
,
'='
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
hscm
=
OpenSCManagerW
(
NULL
,
SERVICES_ACTIVE_DATABASEW
,
GENERIC_WRITE
);
if
(
!
hscm
)
{
ERR
(
"Failed to open the SC Manager!
\n
"
);
goto
done
;
}
start_type
=
MSI_RecordGetInteger
(
rec
,
5
);
if
(
start_type
==
SERVICE_BOOT_START
||
start_type
==
SERVICE_SYSTEM_START
)
goto
done
;
depends
=
MSI_RecordGetString
(
rec
,
8
);
if
(
depends
&&
*
depends
)
FIXME
(
"Dependency list unhandled!
\n
"
);
name
=
MSI_RecordGetString
(
rec
,
2
);
disp
=
MSI_RecordGetString
(
rec
,
3
);
serv_type
=
MSI_RecordGetInteger
(
rec
,
4
);
err_control
=
MSI_RecordGetInteger
(
rec
,
6
);
load_order
=
MSI_RecordGetString
(
rec
,
7
);
serv_name
=
MSI_RecordGetString
(
rec
,
9
);
pass
=
MSI_RecordGetString
(
rec
,
10
);
comp
=
MSI_RecordGetString
(
rec
,
12
);
/* fetch the service path */
row
=
MSI_QueryGetRecord
(
package
->
db
,
query
,
comp
);
if
(
!
row
)
{
ERR
(
"Control query failed!
\n
"
);
goto
done
;
}
key
=
MSI_RecordGetString
(
row
,
6
);
msiobj_release
(
&
row
->
hdr
);
file
=
get_loaded_file
(
package
,
key
);
if
(
!
file
)
{
ERR
(
"Failed to load the service file
\n
"
);
goto
done
;
}
service
=
CreateServiceW
(
hscm
,
name
,
disp
,
GENERIC_ALL
,
serv_type
,
start_type
,
err_control
,
file
->
TargetPath
,
load_order
,
NULL
,
NULL
,
serv_name
,
pass
);
if
(
!
service
)
{
if
(
GetLastError
()
!=
ERROR_SERVICE_EXISTS
)
ERR
(
"Failed to create service %s: %d
\n
"
,
debugstr_w
(
name
),
GetLastError
());
}
done:
CloseServiceHandle
(
service
);
CloseServiceHandle
(
hscm
);
return
ERROR_SUCCESS
;
}
static
UINT
ACTION_InstallServices
(
MSIPACKAGE
*
package
)
{
UINT
rc
;
MSIQUERY
*
view
;
static
const
WCHAR
ExecSeqQuery
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
0
};
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
ExecSeqQuery
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
rc
=
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_InstallService
,
package
);
msiobj_release
(
&
view
->
hdr
);
return
rc
;
}
static
UINT
msi_unimplemented_action_stub
(
MSIPACKAGE
*
package
,
LPCSTR
action
,
LPCWSTR
table
)
{
...
...
@@ -4149,13 +4244,6 @@ static UINT ACTION_SelfUnregModules( MSIPACKAGE *package )
return
msi_unimplemented_action_stub
(
package
,
"SelfUnregModules"
,
table
);
}
static
UINT
ACTION_InstallServices
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
0
};
return
msi_unimplemented_action_stub
(
package
,
"InstallServices"
,
table
);
}
static
UINT
ACTION_StartServices
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
...
...
dlls/msi/tests/install.c
View file @
9bc12ade
...
...
@@ -622,16 +622,10 @@ static void check_service_is_installed(void)
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
"
);
}
ok
(
service
!=
NULL
,
"Failed to open TestService
\n
"
);
res
=
DeleteService
(
service
);
todo_wine
{
ok
(
res
,
"Failed to delete TestService
\n
"
);
}
ok
(
res
,
"Failed to delete TestService
\n
"
);
}
static
void
test_MsiInstallProduct
(
void
)
...
...
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