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
f3e7ed44
Commit
f3e7ed44
authored
Oct 26, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Open the log file once per package.
parent
29ee6540
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
msi.c
dlls/msi/msi.c
+7
-5
msi_main.c
dlls/msi/msi_main.c
+2
-1
msipriv.h
dlls/msi/msipriv.h
+2
-1
package.c
dlls/msi/package.c
+14
-18
No files found.
dlls/msi/msi.c
View file @
f3e7ed44
...
...
@@ -1766,24 +1766,26 @@ UINT WINAPI MsiEnableLogA(DWORD dwLogMode, LPCSTR szLogFile, DWORD attributes)
UINT
WINAPI
MsiEnableLogW
(
DWORD
dwLogMode
,
LPCWSTR
szLogFile
,
DWORD
attributes
)
{
HANDLE
file
=
INVALID_HANDLE_VALUE
;
TRACE
(
"%08x %s %08x
\n
"
,
dwLogMode
,
debugstr_w
(
szLogFile
),
attributes
);
msi_free
(
gszLogFile
);
gszLogFile
=
NULL
;
if
(
szLogFile
)
{
lstrcpyW
(
gszLogFile
,
szLogFile
);
HANDLE
file
;
if
(
!
(
attributes
&
INSTALLLOGATTRIBUTES_APPEND
))
DeleteFileW
(
szLogFile
);
file
=
CreateFileW
(
szLogFile
,
GENERIC_WRITE
,
FILE_SHARE_WRITE
,
NULL
,
OPEN_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
file
!=
INVALID_HANDLE_VALUE
)
{
gszLogFile
=
strdupW
(
szLogFile
);
CloseHandle
(
file
);
}
else
ERR
(
"Unable to enable log %s (%u)
\n
"
,
debugstr_w
(
szLogFile
),
GetLastError
());
}
else
gszLogFile
[
0
]
=
'\0'
;
return
ERROR_SUCCESS
;
}
...
...
dlls/msi/msi_main.c
View file @
f3e7ed44
...
...
@@ -44,7 +44,7 @@ INSTALLUI_HANDLERW gUIHandlerW = NULL;
INSTALLUI_HANDLER_RECORD
gUIHandlerRecord
=
NULL
;
DWORD
gUIFilter
=
0
;
LPVOID
gUIContext
=
NULL
;
WCHAR
gszLogFile
[
MAX_PATH
]
;
WCHAR
*
gszLogFile
=
NULL
;
HINSTANCE
msi_hInstance
;
static
WCHAR
msi_path
[
MAX_PATH
];
...
...
@@ -78,6 +78,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
if
(
msi_typelib
)
ITypeLib_Release
(
msi_typelib
);
msi_dialog_unregister_class
();
msi_free_handle_table
();
msi_free
(
gszLogFile
);
break
;
}
return
TRUE
;
...
...
dlls/msi/msipriv.h
View file @
f3e7ed44
...
...
@@ -331,6 +331,7 @@ typedef struct tagMSIPACKAGE
struct
list
folders
;
LPWSTR
ActionFormat
;
LPWSTR
LastAction
;
HANDLE
log_file
;
struct
list
classes
;
struct
list
extensions
;
...
...
@@ -879,7 +880,7 @@ extern INSTALLUI_HANDLERW gUIHandlerW;
extern
INSTALLUI_HANDLER_RECORD
gUIHandlerRecord
;
extern
DWORD
gUIFilter
;
extern
LPVOID
gUIContext
;
extern
WCHAR
gszLogFile
[
MAX_PATH
]
;
extern
WCHAR
*
gszLogFile
;
extern
HINSTANCE
msi_hInstance
;
/* action related functions */
...
...
dlls/msi/package.c
View file @
f3e7ed44
...
...
@@ -295,6 +295,7 @@ static void MSI_FreePackage( MSIOBJECTHDR *arg)
msiobj_release
(
&
package
->
db
->
hdr
);
free_package_structures
(
package
);
CloseHandle
(
package
->
log_file
);
}
static
UINT
create_temp_property_table
(
MSIPACKAGE
*
package
)
...
...
@@ -1121,6 +1122,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
if
(
package
->
WordCount
&
msidbSumInfoSourceTypeAdminImage
)
msi_load_admin_properties
(
package
);
package
->
log_file
=
INVALID_HANDLE_VALUE
;
}
return
package
;
...
...
@@ -1551,6 +1554,10 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
msi_adjust_privilege_properties
(
package
);
}
if
(
gszLogFile
)
package
->
log_file
=
CreateFileW
(
gszLogFile
,
GENERIC_WRITE
,
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
*
pPackage
=
package
;
return
ERROR_SUCCESS
;
}
...
...
@@ -1657,17 +1664,13 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
{
'S'
,
'e'
,
't'
,
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'e'
,
's'
,
's'
,
0
};
static
const
WCHAR
szActionText
[]
=
{
'A'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
'T'
,
'e'
,
'x'
,
't'
,
0
};
DWORD
log_type
=
0
;
LPWSTR
message
;
DWORD
sz
;
DWORD
total_size
=
0
;
INT
i
;
INT
rc
;
DWORD
sz
,
total_size
=
0
,
log_type
=
0
;
INT
i
,
rc
=
0
;
char
*
msg
;
int
len
;
TRACE
(
"%x
\n
"
,
eMessageType
);
rc
=
0
;
if
((
eMessageType
&
0xff000000
)
==
INSTALLMESSAGE_ERROR
)
log_type
|=
INSTALLLOGMODE_ERROR
;
...
...
@@ -1773,19 +1776,12 @@ INT MSI_ProcessMessage( MSIPACKAGE *package, INSTALLMESSAGE eMessageType,
MsiCloseHandle
(
rec
);
}
if
(
!
rc
&&
gszLogFile
[
0
]
&&
(
eMessageType
&
0xff000000
)
!=
INSTALLMESSAGE_PROGRESS
)
if
(
!
rc
&&
package
->
log_file
!=
INVALID_HANDLE_VALUE
&&
(
eMessageType
&
0xff000000
)
!=
INSTALLMESSAGE_PROGRESS
)
{
DWORD
write
;
HANDLE
log_file
=
CreateFileW
(
gszLogFile
,
GENERIC_WRITE
,
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
log_file
!=
INVALID_HANDLE_VALUE
)
{
SetFilePointer
(
log_file
,
0
,
NULL
,
FILE_END
);
WriteFile
(
log_file
,
msg
,
strlen
(
msg
),
&
write
,
NULL
);
WriteFile
(
log_file
,
"
\n
"
,
1
,
&
write
,
NULL
);
CloseHandle
(
log_file
);
}
DWORD
written
;
WriteFile
(
package
->
log_file
,
msg
,
len
-
1
,
&
written
,
NULL
);
WriteFile
(
package
->
log_file
,
"
\n
"
,
1
,
&
written
,
NULL
);
}
msi_free
(
msg
);
msi_free
(
message
);
...
...
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