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
6eb7eadf
Commit
6eb7eadf
authored
May 09, 2007
by
James Hawkins
Committed by
Alexandre Julliard
May 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Check the volume name when changing media.
parent
5b8bad75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
6 deletions
+40
-6
files.c
dlls/msi/files.c
+40
-6
No files found.
dlls/msi/files.c
View file @
6eb7eadf
...
...
@@ -68,10 +68,25 @@ struct media_info {
WCHAR
source
[
MAX_PATH
];
};
static
BOOL
source_matches_volume
(
struct
media_info
*
mi
,
LPWSTR
source_root
)
{
WCHAR
volume_name
[
MAX_PATH
+
1
];
if
(
!
GetVolumeInformationW
(
source_root
,
volume_name
,
MAX_PATH
+
1
,
NULL
,
NULL
,
NULL
,
NULL
,
0
))
{
ERR
(
"Failed to get volume information
\n
"
);
return
FALSE
;
}
return
!
lstrcmpW
(
mi
->
volume_label
,
volume_name
);
}
static
UINT
msi_change_media
(
MSIPACKAGE
*
package
,
struct
media_info
*
mi
)
{
LPSTR
msg
;
LPWSTR
error
,
error_dialog
;
LPWSTR
source_dir
;
UINT
r
=
ERROR_SUCCESS
;
static
const
WCHAR
szUILevel
[]
=
{
'U'
,
'I'
,
'L'
,
'e'
,
'v'
,
'e'
,
'l'
,
0
};
...
...
@@ -82,8 +97,11 @@ static UINT msi_change_media( MSIPACKAGE *package, struct media_info *mi )
error
=
generate_error_string
(
package
,
1302
,
1
,
mi
->
disk_prompt
);
error_dialog
=
msi_dup_property
(
package
,
error_prop
);
source_dir
=
msi_dup_property
(
package
,
cszSourceDir
);
PathStripToRootW
(
source_dir
);
while
(
r
==
ERROR_SUCCESS
&&
GetFileAttributesW
(
mi
->
source
)
==
INVALID_FILE_ATTRIBUTES
)
while
(
r
==
ERROR_SUCCESS
&&
!
source_matches_volume
(
mi
,
source_dir
)
)
{
r
=
msi_spawn_error_dialog
(
package
,
error_dialog
,
error
);
...
...
@@ -97,6 +115,7 @@ static UINT msi_change_media( MSIPACKAGE *package, struct media_info *mi )
msi_free
(
error
);
msi_free
(
error_dialog
);
msi_free
(
source_dir
);
return
r
;
}
...
...
@@ -572,8 +591,9 @@ static UINT load_media_info(MSIPACKAGE *package, MSIFILE *file, struct media_inf
static
UINT
ready_media
(
MSIPACKAGE
*
package
,
MSIFILE
*
file
,
struct
media_info
*
mi
)
{
UINT
rc
=
ERROR_SUCCESS
;
BOOL
found
=
FALSE
;
UINT
rc
=
ERROR_SUCCESS
,
type
;
BOOL
found
=
TRUE
;
LPWSTR
source_dir
;
/* media info for continuous cabinet is already loaded */
if
(
mi
->
is_continuous
)
...
...
@@ -586,9 +606,23 @@ static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *m
return
ERROR_FUNCTION_FAILED
;
}
if
(
mi
->
volume_label
)
{
source_dir
=
msi_dup_property
(
package
,
cszSourceDir
);
PathStripToRootW
(
source_dir
);
type
=
GetDriveTypeW
(
source_dir
);
if
(
type
==
DRIVE_CDROM
||
type
==
DRIVE_REMOVABLE
)
found
=
source_matches_volume
(
mi
,
source_dir
);
msi_free
(
source_dir
);
}
if
(
file
->
IsCompressed
&&
GetFileAttributesW
(
mi
->
source
)
==
INVALID_FILE_ATTRIBUTES
)
{
found
=
FALSE
;
if
(
package
->
BaseURL
&&
UrlIsW
(
package
->
BaseURL
,
URLIS_URL
))
{
rc
=
download_remote_cabinet
(
package
,
mi
);
...
...
@@ -598,11 +632,11 @@ static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *m
found
=
TRUE
;
}
}
if
(
!
found
)
rc
=
msi_change_media
(
package
,
mi
);
}
if
(
!
found
)
rc
=
msi_change_media
(
package
,
mi
);
return
rc
;
}
...
...
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