Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1282d7ad
Commit
1282d7ad
authored
Nov 03, 2004
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle 3 more custom action types
parent
2a798e5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
148 additions
and
2 deletions
+148
-2
action.c
dlls/msi/action.c
+148
-2
No files found.
dlls/msi/action.c
View file @
1282d7ad
...
...
@@ -157,6 +157,12 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, const LPWSTR source,
const
LPWSTR
target
,
const
INT
type
);
static
UINT
HANDLE_CustomType2
(
MSIPACKAGE
*
package
,
const
LPWSTR
source
,
const
LPWSTR
target
,
const
INT
type
);
static
UINT
HANDLE_CustomType18
(
MSIPACKAGE
*
package
,
const
LPWSTR
source
,
const
LPWSTR
target
,
const
INT
type
);
static
UINT
HANDLE_CustomType50
(
MSIPACKAGE
*
package
,
const
LPWSTR
source
,
const
LPWSTR
target
,
const
INT
type
);
static
UINT
HANDLE_CustomType34
(
MSIPACKAGE
*
package
,
const
LPWSTR
source
,
const
LPWSTR
target
,
const
INT
type
);
static
DWORD
deformat_string
(
MSIPACKAGE
*
package
,
WCHAR
*
ptr
,
WCHAR
**
data
);
static
UINT
resolve_folder
(
MSIPACKAGE
*
package
,
LPCWSTR
name
,
LPWSTR
path
,
...
...
@@ -760,6 +766,9 @@ static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran)
rc
=
ACTION_PerformAction
(
package
,
buffer
);
if
(
rc
==
ERROR_FUNCTION_NOT_CALLED
)
rc
=
ERROR_SUCCESS
;
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Execution halted due to error (%i)
\n
"
,
rc
);
...
...
@@ -850,6 +859,9 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package)
rc
=
ACTION_PerformAction
(
package
,
buffer
);
if
(
rc
==
ERROR_FUNCTION_NOT_CALLED
)
rc
=
ERROR_SUCCESS
;
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Execution halted due to error (%i)
\n
"
,
rc
);
...
...
@@ -935,7 +947,7 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
else
if
((
rc
=
ACTION_CustomAction
(
package
,
action
))
!=
ERROR_SUCCESS
)
{
FIXME
(
"UNHANDLED MSI ACTION %s
\n
"
,
debugstr_w
(
action
));
rc
=
ERROR_
SUCCESS
;
rc
=
ERROR_
FUNCTION_NOT_CALLED
;
}
ui_actioninfo
(
package
,
action
,
FALSE
,
rc
);
...
...
@@ -999,6 +1011,15 @@ static UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action)
case
2
:
/* EXE file stored in a Binary table strem */
rc
=
HANDLE_CustomType2
(
package
,
source
,
target
,
type
);
break
;
case
18
:
/*EXE file installed with package */
rc
=
HANDLE_CustomType18
(
package
,
source
,
target
,
type
);
break
;
case
50
:
/*EXE file specified by a property value */
rc
=
HANDLE_CustomType50
(
package
,
source
,
target
,
type
);
break
;
case
34
:
/*EXE to be run in specified directory */
rc
=
HANDLE_CustomType34
(
package
,
source
,
target
,
type
);
break
;
case
35
:
/* Directory set with formatted text. */
case
51
:
/* Property set with formatted text. */
deformat_string
(
package
,
target
,
&
deformated
);
...
...
@@ -1233,7 +1254,6 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, const LPWSTR source,
static
const
WCHAR
spc
[]
=
{
' '
,
0
};
memset
(
&
si
,
0
,
sizeof
(
STARTUPINFOW
));
memset
(
&
info
,
0
,
sizeof
(
PROCESS_INFORMATION
));
store_binary_to_temp
(
package
,
source
,
tmp_file
);
...
...
@@ -1257,6 +1277,132 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, const LPWSTR source,
if
(
!
(
type
&
0xc0
))
WaitForSingleObject
(
info
.
hProcess
,
INFINITE
);
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
return
ERROR_SUCCESS
;
}
static
UINT
HANDLE_CustomType18
(
MSIPACKAGE
*
package
,
const
LPWSTR
source
,
const
LPWSTR
target
,
const
INT
type
)
{
WCHAR
filename
[
MAX_PATH
*
2
];
STARTUPINFOW
si
;
PROCESS_INFORMATION
info
;
BOOL
rc
;
WCHAR
*
deformated
;
static
const
WCHAR
spc
[]
=
{
' '
,
0
};
int
index
;
memset
(
&
si
,
0
,
sizeof
(
STARTUPINFOW
));
index
=
get_loaded_file
(
package
,
source
);
strcpyW
(
filename
,
package
->
files
[
index
].
TargetPath
);
strcatW
(
filename
,
spc
);
deformat_string
(
package
,
target
,
&
deformated
);
strcatW
(
filename
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
TRACE
(
"executing exe %s
\n
"
,
debugstr_w
(
filename
));
rc
=
CreateProcessW
(
NULL
,
filename
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
c_collen
,
&
si
,
&
info
);
if
(
!
rc
)
{
ERR
(
"Unable to execute command
\n
"
);
return
ERROR_SUCCESS
;
}
if
(
!
(
type
&
0xc0
))
WaitForSingleObject
(
info
.
hProcess
,
INFINITE
);
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
return
ERROR_SUCCESS
;
}
static
UINT
HANDLE_CustomType50
(
MSIPACKAGE
*
package
,
const
LPWSTR
source
,
const
LPWSTR
target
,
const
INT
type
)
{
WCHAR
filename
[
MAX_PATH
*
2
];
STARTUPINFOW
si
;
PROCESS_INFORMATION
info
;
BOOL
rc
;
WCHAR
*
deformated
;
static
const
WCHAR
spc
[]
=
{
' '
,
0
};
DWORD
sz
;
memset
(
&
si
,
0
,
sizeof
(
STARTUPINFOW
));
sz
=
MAX_PATH
*
2
;
if
(
MSI_GetPropertyW
(
package
,
source
,
filename
,
&
sz
)
!=
ERROR_SUCCESS
)
return
ERROR_FUNCTION_FAILED
;
strcatW
(
filename
,
spc
);
deformat_string
(
package
,
target
,
&
deformated
);
strcatW
(
filename
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
TRACE
(
"executing exe %s
\n
"
,
debugstr_w
(
filename
));
rc
=
CreateProcessW
(
NULL
,
filename
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
c_collen
,
&
si
,
&
info
);
if
(
!
rc
)
{
ERR
(
"Unable to execute command
\n
"
);
return
ERROR_SUCCESS
;
}
if
(
!
(
type
&
0xc0
))
WaitForSingleObject
(
info
.
hProcess
,
INFINITE
);
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
return
ERROR_SUCCESS
;
}
static
UINT
HANDLE_CustomType34
(
MSIPACKAGE
*
package
,
const
LPWSTR
source
,
const
LPWSTR
target
,
const
INT
type
)
{
WCHAR
filename
[
MAX_PATH
*
2
];
STARTUPINFOW
si
;
PROCESS_INFORMATION
info
;
BOOL
rc
;
WCHAR
*
deformated
;
memset
(
&
si
,
0
,
sizeof
(
STARTUPINFOW
));
rc
=
resolve_folder
(
package
,
source
,
filename
,
FALSE
,
FALSE
,
NULL
);
if
(
rc
!=
ERROR_SUCCESS
)
return
rc
;
SetCurrentDirectoryW
(
filename
);
deformat_string
(
package
,
target
,
&
deformated
);
strcpyW
(
filename
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
TRACE
(
"executing exe %s
\n
"
,
debugstr_w
(
filename
));
rc
=
CreateProcessW
(
NULL
,
filename
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
c_collen
,
&
si
,
&
info
);
if
(
!
rc
)
{
ERR
(
"Unable to execute command
\n
"
);
return
ERROR_SUCCESS
;
}
if
(
!
(
type
&
0xc0
))
WaitForSingleObject
(
info
.
hProcess
,
INFINITE
);
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
return
ERROR_SUCCESS
;
}
...
...
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