diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-22 12:23:03 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-12-06 20:25:48 +0100 |
commit | 3cc4623596c2aadf8608f8bb0ec52dfb24f59227 (patch) | |
tree | 869213a0ff3d97d8fe01516cf6f0e0044727b1e9 /libmsi | |
parent | 3e77508e10e4b8cbbc06dc74f200011934f6c69c (diff) | |
download | msitools-3cc4623596c2aadf8608f8bb0ec52dfb24f59227.tar.gz msitools-3cc4623596c2aadf8608f8bb0ec52dfb24f59227.tar.xz msitools-3cc4623596c2aadf8608f8bb0ec52dfb24f59227.zip |
do not download packages from URLs
Diffstat (limited to 'libmsi')
-rw-r--r-- | libmsi/package.c | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/libmsi/package.c b/libmsi/package.c index 06c13c5..9bc7ff1 100644 --- a/libmsi/package.c +++ b/libmsi/package.c @@ -743,42 +743,6 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) return package; } -UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename ) -{ - LPINTERNET_CACHE_ENTRY_INFOW cache_entry; - DWORD size = 0; - HRESULT hr; - - /* call will always fail, because 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 = msi_alloc( size ); - if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) ) - { - UINT error = GetLastError(); - msi_free( cache_entry ); - return error; - } - - lstrcpyW( filename, cache_entry->lpszLocalFileName ); - msi_free( cache_entry ); - return ERROR_SUCCESS; - } - - hr = URLDownloadToCacheFileW( NULL, szUrl, filename, MAX_PATH, 0, NULL ); - if ( FAILED(hr) ) - { - WARN("failed to download %s to cache file\n", debugstr_w(szUrl)); - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; -} - UINT msi_create_empty_local_file( LPWSTR path, LPCWSTR suffix ) { static const WCHAR szInstaller[] = { @@ -1096,21 +1060,6 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) } else { - if ( UrlIsW( szPackage, URLIS_URL ) ) - { - r = msi_download_file( szPackage, cachefile ); - if (r != ERROR_SUCCESS) - return r; - - file = cachefile; - - base_url = strdupW( szPackage ); - if (!base_url) - return ERROR_OUTOFMEMORY; - - ptr = strrchrW( base_url, '/' ); - if (ptr) *(ptr + 1) = '\0'; - } r = get_local_package( file, localfile ); if (r != ERROR_SUCCESS || GetFileAttributesW( localfile ) == INVALID_FILE_ATTRIBUTES) { @@ -1162,9 +1111,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) } msi_set_property( package->db, szDatabase, db->path ); - if( UrlIsW( szPackage, URLIS_URL ) ) - msi_set_property( package->db, szOriginalDatabase, szPackage ); - else if( szPackage[0] == '#' ) + if( szPackage[0] == '#' ) msi_set_property( package->db, szOriginalDatabase, db->path ); else { |