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
d1617bea
Commit
d1617bea
authored
Jul 26, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Jul 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Download the MSI package if it is a remote URL.
parent
3882b4f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
Makefile.in
dlls/msi/Makefile.in
+1
-1
package.c
dlls/msi/package.c
+40
-1
No files found.
dlls/msi/Makefile.in
View file @
d1617bea
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
msi.dll
MODULE
=
msi.dll
IMPORTLIB
=
libmsi.
$(IMPLIBEXT)
IMPORTLIB
=
libmsi.
$(IMPLIBEXT)
IMPORTS
=
comctl32 shell32 shlwapi cabinet oleaut32 ole32 version user32 gdi32 advapi32 kernel32
IMPORTS
=
urlmon wininet
comctl32 shell32 shlwapi cabinet oleaut32 ole32 version user32 gdi32 advapi32 kernel32
EXTRALIBS
=
-luuid
EXTRALIBS
=
-luuid
C_SRCS
=
\
C_SRCS
=
\
...
...
dlls/msi/package.c
View file @
d1617bea
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
#include "objidl.h"
#include "objidl.h"
#include "wincrypt.h"
#include "wincrypt.h"
#include "winuser.h"
#include "winuser.h"
#include "wininet.h"
#include "urlmon.h"
#include "shlobj.h"
#include "shlobj.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#include "objbase.h"
#include "objbase.h"
...
@@ -452,6 +454,38 @@ static LPCWSTR copy_package_to_temp( LPCWSTR szPackage, LPWSTR filename )
...
@@ -452,6 +454,38 @@ static LPCWSTR copy_package_to_temp( LPCWSTR szPackage, LPWSTR filename )
return
filename
;
return
filename
;
}
}
static
LPCWSTR
msi_download_package
(
LPCWSTR
szUrl
,
LPWSTR
filename
)
{
LPINTERNET_CACHE_ENTRY_INFOW
cache_entry
;
DWORD
size
=
0
;
HRESULT
hr
;
/* call will always fail, becase size is 0,
* but will return ERROR_FILE_NOT_FOUND first
* if the file doesn't exist
*/
GetUrlCacheEntryInfoW
(
szUrl
,
NULL
,
&
size
);
if
(
GetLastError
()
!=
ERROR_FILE_NOT_FOUND
)
{
cache_entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
GetUrlCacheEntryInfoW
(
szUrl
,
cache_entry
,
&
size
)
)
{
HeapFree
(
GetProcessHeap
(),
0
,
cache_entry
);
return
szUrl
;
}
lstrcpyW
(
filename
,
cache_entry
->
lpszLocalFileName
);
HeapFree
(
GetProcessHeap
(),
0
,
cache_entry
);
return
filename
;
}
hr
=
URLDownloadToCacheFileW
(
NULL
,
szUrl
,
filename
,
MAX_PATH
,
0
,
NULL
);
if
(
FAILED
(
hr
)
)
return
szUrl
;
return
filename
;
}
UINT
MSI_OpenPackageW
(
LPCWSTR
szPackage
,
MSIPACKAGE
**
pPackage
)
UINT
MSI_OpenPackageW
(
LPCWSTR
szPackage
,
MSIPACKAGE
**
pPackage
)
{
{
MSIDATABASE
*
db
=
NULL
;
MSIDATABASE
*
db
=
NULL
;
...
@@ -471,7 +505,12 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
...
@@ -471,7 +505,12 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
else
else
{
{
WCHAR
temppath
[
MAX_PATH
];
WCHAR
temppath
[
MAX_PATH
];
LPCWSTR
file
=
copy_package_to_temp
(
szPackage
,
temppath
);
LPCWSTR
file
;
if
(
UrlIsW
(
szPackage
,
URLIS_URL
)
)
file
=
msi_download_package
(
szPackage
,
temppath
);
else
file
=
copy_package_to_temp
(
szPackage
,
temppath
);
r
=
MSI_OpenDatabaseW
(
file
,
MSIDBOPEN_READONLY
,
&
db
);
r
=
MSI_OpenDatabaseW
(
file
,
MSIDBOPEN_READONLY
,
&
db
);
...
...
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