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
ff2aa7e3
Commit
ff2aa7e3
authored
Dec 17, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix download of installer packages. Return errors from msi_download_file…
msi: Fix download of installer packages. Return errors from msi_download_file and copy_package_to_temp.
parent
4e7389e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
16 deletions
+34
-16
msipriv.h
dlls/msi/msipriv.h
+1
-1
package.c
dlls/msi/package.c
+33
-15
No files found.
dlls/msi/msipriv.h
View file @
ff2aa7e3
...
...
@@ -757,7 +757,7 @@ extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR );
extern
UINT
MSI_GetComponentStateW
(
MSIPACKAGE
*
,
LPCWSTR
,
INSTALLSTATE
*
,
INSTALLSTATE
*
);
extern
UINT
MSI_GetFeatureStateW
(
MSIPACKAGE
*
,
LPCWSTR
,
INSTALLSTATE
*
,
INSTALLSTATE
*
);
extern
UINT
WINAPI
MSI_SetFeatureStateW
(
MSIPACKAGE
*
,
LPCWSTR
,
INSTALLSTATE
);
extern
LPCWSTR
msi_download_file
(
LPCWSTR
szUrl
,
LPWSTR
filename
);
extern
UINT
msi_download_file
(
LPCWSTR
szUrl
,
LPWSTR
filename
);
extern
UINT
msi_package_add_info
(
MSIPACKAGE
*
,
DWORD
,
DWORD
,
LPCWSTR
,
LPWSTR
);
extern
UINT
msi_package_add_media_disk
(
MSIPACKAGE
*
,
DWORD
,
DWORD
,
DWORD
,
LPWSTR
,
LPWSTR
);
extern
UINT
msi_clone_properties
(
MSIPACKAGE
*
);
...
...
dlls/msi/package.c
View file @
ff2aa7e3
...
...
@@ -833,7 +833,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
* we should read all the tables to memory, then open the
* database to read binary streams on demand.
*/
static
LPCWSTR
copy_package_to_temp
(
LPCWSTR
szPackage
,
LPWSTR
filename
)
static
UINT
copy_package_to_temp
(
LPCWSTR
szPackage
,
LPWSTR
filename
)
{
WCHAR
path
[
MAX_PATH
];
...
...
@@ -842,16 +842,16 @@ static LPCWSTR copy_package_to_temp( LPCWSTR szPackage, LPWSTR filename )
if
(
!
CopyFileW
(
szPackage
,
filename
,
FALSE
)
)
{
UINT
error
=
GetLastError
();
ERR
(
"failed to copy package %s to %s (%u)
\n
"
,
debugstr_w
(
szPackage
),
debugstr_w
(
filename
),
error
);
DeleteFileW
(
filename
);
ERR
(
"failed to copy package %s
\n
"
,
debugstr_w
(
szPackage
)
);
return
szPackage
;
return
error
;
}
TRACE
(
"Opening relocated package %s
\n
"
,
debugstr_w
(
filename
));
return
filename
;
return
ERROR_SUCCESS
;
}
LPCWSTR
msi_download_file
(
LPCWSTR
szUrl
,
LPWSTR
filename
)
UINT
msi_download_file
(
LPCWSTR
szUrl
,
LPWSTR
filename
)
{
LPINTERNET_CACHE_ENTRY_INFOW
cache_entry
;
DWORD
size
=
0
;
...
...
@@ -867,20 +867,24 @@ LPCWSTR msi_download_file( LPCWSTR szUrl, LPWSTR filename )
cache_entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
GetUrlCacheEntryInfoW
(
szUrl
,
cache_entry
,
&
size
)
)
{
UINT
error
=
GetLastError
();
HeapFree
(
GetProcessHeap
(),
0
,
cache_entry
);
return
szUrl
;
return
error
;
}
lstrcpyW
(
filename
,
cache_entry
->
lpszLocalFileName
);
HeapFree
(
GetProcessHeap
(),
0
,
cache_entry
);
return
filename
;
return
ERROR_SUCCESS
;
}
hr
=
URLDownloadToCacheFileW
(
NULL
,
szUrl
,
filename
,
MAX_PATH
,
0
,
NULL
);
if
(
FAILED
(
hr
)
)
return
szUrl
;
{
WARN
(
"failed to download %s to cache file
\n
"
,
debugstr_w
(
szUrl
));
return
ERROR_FUNCTION_FAILED
;
}
return
filename
;
return
ERROR_SUCCESS
;
}
static
UINT
msi_get_local_package_name
(
LPWSTR
path
)
...
...
@@ -925,7 +929,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
MSIHANDLE
handle
;
LPWSTR
ptr
,
base_url
=
NULL
;
UINT
r
;
WCHAR
temppath
[
MAX_PATH
],
localfile
[
MAX_PATH
];
WCHAR
temppath
[
MAX_PATH
],
localfile
[
MAX_PATH
]
,
cachefile
[
MAX_PATH
]
;
LPCWSTR
file
=
szPackage
;
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
szPackage
),
pPackage
);
...
...
@@ -952,9 +956,15 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
{
if
(
UrlIsW
(
szPackage
,
URLIS_URL
)
)
{
file
=
msi_download_file
(
szPackage
,
temppath
);
if
(
file
!=
szPackage
)
file
=
copy_package_to_temp
(
file
,
temppath
);
r
=
msi_download_file
(
szPackage
,
cachefile
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
r
=
copy_package_to_temp
(
cachefile
,
temppath
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
file
=
temppath
;
base_url
=
strdupW
(
szPackage
);
if
(
!
base_url
)
...
...
@@ -964,7 +974,13 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
if
(
ptr
)
*
(
ptr
+
1
)
=
'\0'
;
}
else
file
=
copy_package_to_temp
(
szPackage
,
temppath
);
{
r
=
copy_package_to_temp
(
szPackage
,
temppath
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
file
=
temppath
;
}
r
=
msi_get_local_package_name
(
localfile
);
if
(
r
!=
ERROR_SUCCESS
)
...
...
@@ -979,6 +995,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
return
GetLastError
();
}
TRACE
(
"Opening relocated package %s
\n
"
,
debugstr_w
(
file
));
/* transforms that add binary streams require that we open the database
* read/write, which is safe because we always create a copy that is thrown
* away when we're done.
...
...
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