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
fa8fc162
Commit
fa8fc162
authored
Nov 08, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Nov 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add support for continuous cabinets.
parent
6d537a31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
23 deletions
+100
-23
files.c
dlls/msi/files.c
+100
-23
No files found.
dlls/msi/files.c
View file @
fa8fc162
...
...
@@ -67,6 +67,29 @@ struct media_info {
WCHAR
source
[
MAX_PATH
];
};
static
UINT
msi_change_media
(
MSIPACKAGE
*
package
,
struct
media_info
*
mi
)
{
LPWSTR
error
,
error_dialog
;
UINT
r
=
ERROR_SUCCESS
;
static
const
WCHAR
szUILevel
[]
=
{
'U'
,
'I'
,
'L'
,
'e'
,
'v'
,
'e'
,
'l'
,
0
};
static
const
WCHAR
error_prop
[]
=
{
'E'
,
'r'
,
'r'
,
'o'
,
'r'
,
'D'
,
'i'
,
'a'
,
'l'
,
'o'
,
'g'
,
0
};
if
(
msi_get_property_int
(
package
,
szUILevel
,
0
)
==
INSTALLUILEVEL_NONE
)
return
ERROR_SUCCESS
;
error
=
generate_error_string
(
package
,
1302
,
1
,
mi
->
disk_prompt
);
error_dialog
=
msi_dup_property
(
package
,
error_prop
);
while
(
r
==
ERROR_SUCCESS
&&
GetFileAttributesW
(
mi
->
source
)
==
INVALID_FILE_ATTRIBUTES
)
r
=
msi_spawn_error_dialog
(
package
,
error_dialog
,
error
);
msi_free
(
error
);
msi_free
(
error_dialog
);
return
r
;
}
/*
* This is a helper function for handling embedded cabinet media
*/
...
...
@@ -210,10 +233,83 @@ static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *ac
ui_progress
(
package
,
2
,
f
->
FileSize
,
0
,
0
);
}
static
UINT
msi_media_get_disk_info
(
CabData
*
data
)
{
MSIPACKAGE
*
package
=
data
->
package
;
MSIRECORD
*
row
;
LPWSTR
ptr
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'D'
,
'i'
,
's'
,
'k'
,
'I'
,
'd'
,
'`'
,
' '
,
'='
,
' '
,
'%'
,
'i'
,
0
};
row
=
MSI_QueryGetRecord
(
package
->
db
,
query
,
data
->
mi
->
disk_id
);
if
(
!
row
)
{
TRACE
(
"Unable to query row
\n
"
);
return
ERROR_FUNCTION_FAILED
;
}
data
->
mi
->
disk_prompt
=
strdupW
(
MSI_RecordGetString
(
row
,
3
));
data
->
mi
->
cabinet
=
strdupW
(
MSI_RecordGetString
(
row
,
4
));
ptr
=
strrchrW
(
data
->
mi
->
source
,
'\\'
)
+
1
;
lstrcpyW
(
ptr
,
data
->
mi
->
cabinet
);
return
ERROR_SUCCESS
;
}
static
INT_PTR
cabinet_notify
(
FDINOTIFICATIONTYPE
fdint
,
PFDINOTIFICATION
pfdin
)
{
TRACE
(
"(%d)
\n
"
,
fdint
);
switch
(
fdint
)
{
case
fdintPARTIAL_FILE
:
{
CabData
*
data
=
(
CabData
*
)
pfdin
->
pv
;
data
->
mi
->
is_continuous
=
FALSE
;
return
0
;
}
case
fdintNEXT_CABINET
:
{
CabData
*
data
=
(
CabData
*
)
pfdin
->
pv
;
struct
media_info
*
mi
=
data
->
mi
;
LPWSTR
cab
=
strdupAtoW
(
pfdin
->
psz1
);
UINT
rc
;
msi_free
(
mi
->
disk_prompt
);
mi
->
disk_id
++
;
mi
->
is_continuous
=
TRUE
;
rc
=
msi_media_get_disk_info
(
data
);
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to get next cabinet information: %d
\n
"
,
rc
);
return
-
1
;
}
if
(
lstrcmpiW
(
mi
->
cabinet
,
cab
))
{
msi_free
(
cab
);
ERR
(
"Continuous cabinet does not match the next cabinet in the Media table
\n
"
);
return
-
1
;
}
msi_free
(
cab
);
TRACE
(
"Searching for %s
\n
"
,
debugstr_w
(
mi
->
source
));
if
(
GetFileAttributesW
(
mi
->
source
)
==
INVALID_FILE_ATTRIBUTES
)
rc
=
msi_change_media
(
data
->
package
,
mi
);
if
(
rc
!=
ERROR_SUCCESS
)
return
-
1
;
return
0
;
}
case
fdintCOPY_FILE
:
{
CabData
*
data
=
(
CabData
*
)
pfdin
->
pv
;
...
...
@@ -354,29 +450,6 @@ static void free_media_info( struct media_info *mi )
msi_free
(
mi
);
}
static
UINT
msi_change_media
(
MSIPACKAGE
*
package
,
struct
media_info
*
mi
)
{
LPWSTR
error
,
error_dialog
;
UINT
r
=
ERROR_SUCCESS
;
static
const
WCHAR
szUILevel
[]
=
{
'U'
,
'I'
,
'L'
,
'e'
,
'v'
,
'e'
,
'l'
,
0
};
static
const
WCHAR
error_prop
[]
=
{
'E'
,
'r'
,
'r'
,
'o'
,
'r'
,
'D'
,
'i'
,
'a'
,
'l'
,
'o'
,
'g'
,
0
};
if
(
msi_get_property_int
(
package
,
szUILevel
,
0
)
==
INSTALLUILEVEL_NONE
)
return
ERROR_SUCCESS
;
error
=
generate_error_string
(
package
,
1302
,
1
,
mi
->
disk_prompt
);
error_dialog
=
msi_dup_property
(
package
,
error_prop
);
while
(
r
==
ERROR_SUCCESS
&&
GetFileAttributesW
(
mi
->
source
)
==
INVALID_FILE_ATTRIBUTES
)
r
=
msi_spawn_error_dialog
(
package
,
error_dialog
,
error
);
msi_free
(
error
);
msi_free
(
error_dialog
);
return
r
;
}
static
UINT
download_remote_cabinet
(
MSIPACKAGE
*
package
,
struct
media_info
*
mi
)
{
WCHAR
temppath
[
MAX_PATH
];
...
...
@@ -472,6 +545,10 @@ static UINT ready_media(MSIPACKAGE *package, MSIFILE *file, struct media_info *m
UINT
rc
=
ERROR_SUCCESS
;
BOOL
found
=
FALSE
;
/* media info for continuous cabinet is already loaded */
if
(
mi
->
is_continuous
)
return
ERROR_SUCCESS
;
rc
=
load_media_info
(
package
,
file
,
mi
);
if
(
rc
!=
ERROR_SUCCESS
)
{
...
...
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