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
ad4f747f
Commit
ad4f747f
authored
Dec 23, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix changing media for normal files.
parent
4ce176af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
54 deletions
+46
-54
files.c
dlls/msi/files.c
+2
-2
media.c
dlls/msi/media.c
+43
-51
msipriv.h
dlls/msi/msipriv.h
+1
-1
No files found.
dlls/msi/files.c
View file @
ad4f747f
...
...
@@ -331,7 +331,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
if
(
!
file
->
Component
->
Enabled
)
continue
;
if
(
file
->
state
!=
msifs_hashmatch
&&
(
rc
=
ready_media
(
package
,
file
->
Sequence
,
file
->
IsCompressed
,
mi
)))
(
rc
=
ready_media
(
package
,
file
->
IsCompressed
,
mi
)))
{
ERR
(
"Failed to ready media for %s
\n
"
,
debugstr_w
(
file
->
File
));
goto
done
;
...
...
@@ -512,7 +512,7 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
{
MSICABDATA
data
;
rc
=
ready_media
(
package
,
patch
->
Sequence
,
TRUE
,
mi
);
rc
=
ready_media
(
package
,
TRUE
,
mi
);
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to ready media for %s
\n
"
,
debugstr_w
(
file
->
File
));
...
...
dlls/msi/media.c
View file @
ad4f747f
...
...
@@ -838,79 +838,71 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
return
ERROR_FUNCTION_FAILED
;
}
UINT
ready_media
(
MSIPACKAGE
*
package
,
UINT
Sequence
,
BOOL
IsCompressed
,
MSIMEDIAINFO
*
mi
)
UINT
ready_media
(
MSIPACKAGE
*
package
,
BOOL
compressed
,
MSIMEDIAINFO
*
mi
)
{
UINT
rc
=
ERROR_SUCCESS
;
WCHAR
*
cabinet_file
;
UINT
rc
;
WCHAR
*
cabinet_file
=
NULL
;
/* media info for continuous cabinet is already loaded */
if
(
mi
->
is_continuous
)
return
ERROR_SUCCESS
;
/* cabinet is internal, no checks needed */
if
(
!
mi
->
cabinet
||
mi
->
cabinet
[
0
]
==
'#'
)
return
ERROR_SUCCESS
;
cabinet_file
=
get_cabinet_filename
(
mi
);
if
(
mi
->
is_continuous
)
return
ERROR_SUCCESS
;
/* package should be downloaded */
if
(
IsCompressed
&&
GetFileAttributesW
(
cabinet_file
)
==
INVALID_FILE_ATTRIBUTES
&&
package
->
BaseURL
&&
UrlIsW
(
package
->
BaseURL
,
URLIS_URL
))
if
(
mi
->
cabinet
)
{
WCHAR
temppath
[
MAX_PATH
],
*
p
;
/* cabinet is internal, no checks needed */
if
(
mi
->
cabinet
[
0
]
==
'#'
)
return
ERROR_SUCCESS
;
rc
=
msi_download_file
(
cabinet_file
,
temppath
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
!
(
cabinet_file
=
get_cabinet_filename
(
mi
)))
return
ERROR_OUTOFMEMORY
;
/* package should be downloaded */
if
(
compressed
&&
GetFileAttributesW
(
cabinet_file
)
==
INVALID_FILE_ATTRIBUTES
&&
package
->
BaseURL
&&
UrlIsW
(
package
->
BaseURL
,
URLIS_URL
))
{
ERR
(
"Failed to download %s (%u)
\n
"
,
debugstr_w
(
cabinet_file
),
rc
);
msi_free
(
cabinet_file
);
return
rc
;
}
if
((
p
=
strrchrW
(
temppath
,
'\\'
)))
*
p
=
0
;
strcpyW
(
mi
->
sourcedir
,
temppath
);
PathAddBackslashW
(
mi
->
sourcedir
);
msi_free
(
mi
->
cabinet
);
mi
->
cabinet
=
strdupW
(
p
+
1
);
WCHAR
temppath
[
MAX_PATH
],
*
p
;
msi_free
(
cabinet_file
);
return
ERROR_SUCCESS
;
if
((
rc
=
msi_download_file
(
cabinet_file
,
temppath
))
!=
ERROR_SUCCESS
)
{
ERR
(
"failed to download %s (%u)
\n
"
,
debugstr_w
(
cabinet_file
),
rc
);
msi_free
(
cabinet_file
);
return
rc
;
}
if
((
p
=
strrchrW
(
temppath
,
'\\'
)))
*
p
=
0
;
strcpyW
(
mi
->
sourcedir
,
temppath
);
PathAddBackslashW
(
mi
->
sourcedir
);
msi_free
(
mi
->
cabinet
);
mi
->
cabinet
=
strdupW
(
p
+
1
);
msi_free
(
cabinet_file
);
return
ERROR_SUCCESS
;
}
}
/* check volume matches, change media if not */
if
(
mi
->
volume_label
&&
mi
->
disk_id
>
1
&&
strcmpW
(
mi
->
first_volume
,
mi
->
volume_label
))
if
(
mi
->
volume_label
&&
mi
->
disk_id
>
1
&&
strcmpW
(
mi
->
first_volume
,
mi
->
volume_label
))
{
LPWSTR
source
=
msi_dup_property
(
package
->
db
,
szSourceDir
);
BOOL
matches
;
matches
=
source_matches_volume
(
mi
,
source
);
msi_free
(
source
);
WCHAR
*
source
=
msi_dup_property
(
package
->
db
,
szSourceDir
);
BOOL
match
=
source_matches_volume
(
mi
,
source
);
msi_free
(
source
);
if
(
(
mi
->
type
==
DRIVE_CDROM
||
mi
->
type
==
DRIVE_REMOVABLE
)
&&
!
matches
)
if
(
!
match
&&
(
mi
->
type
==
DRIVE_CDROM
||
mi
->
type
==
DRIVE_REMOVABLE
)
)
{
rc
=
msi_change_media
(
package
,
mi
);
if
(
rc
!=
ERROR_SUCCESS
)
if
((
rc
=
msi_change_media
(
package
,
mi
))
!=
ERROR_SUCCESS
)
{
msi_free
(
cabinet_file
);
msi_free
(
cabinet_file
);
return
rc
;
}
}
}
if
(
IsCompressed
&&
GetFileAttributesW
(
cabinet_file
)
==
INVALID_FILE_ATTRIBUTES
)
if
(
mi
->
cabinet
)
{
rc
=
find_published_source
(
package
,
mi
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
compressed
&&
GetFileAttributesW
(
cabinet_file
)
==
INVALID_FILE_ATTRIBUTES
)
{
ERR
(
"Cabinet not found: %s
\n
"
,
debugstr_w
(
cabinet_file
));
msi_free
(
cabinet_file
);
return
ERROR_INSTALL_FAILURE
;
if
((
rc
=
find_published_source
(
package
,
mi
))
!=
ERROR_SUCCESS
)
{
ERR
(
"cabinet not found: %s
\n
"
,
debugstr_w
(
cabinet_file
));
msi_free
(
cabinet_file
);
return
ERROR_INSTALL_FAILURE
;
}
}
}
msi_free
(
cabinet_file
);
msi_free
(
cabinet_file
);
return
ERROR_SUCCESS
;
}
...
...
dlls/msi/msipriv.h
View file @
ad4f747f
...
...
@@ -1041,7 +1041,7 @@ typedef struct
PVOID
user
;
}
MSICABDATA
;
extern
UINT
ready_media
(
MSIPACKAGE
*
package
,
UINT
Sequence
,
BOOL
IsC
ompressed
,
MSIMEDIAINFO
*
mi
)
DECLSPEC_HIDDEN
;
extern
UINT
ready_media
(
MSIPACKAGE
*
package
,
BOOL
c
ompressed
,
MSIMEDIAINFO
*
mi
)
DECLSPEC_HIDDEN
;
extern
UINT
msi_load_media_info
(
MSIPACKAGE
*
package
,
UINT
Sequence
,
MSIMEDIAINFO
*
mi
)
DECLSPEC_HIDDEN
;
extern
void
msi_free_media_info
(
MSIMEDIAINFO
*
mi
)
DECLSPEC_HIDDEN
;
extern
BOOL
msi_cabextract
(
MSIPACKAGE
*
package
,
MSIMEDIAINFO
*
mi
,
LPVOID
data
)
DECLSPEC_HIDDEN
;
...
...
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