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
916ef949
Commit
916ef949
authored
Jun 22, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework PublishProduct to use MSI_IterateRecords.
parent
aa0b9aac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
70 deletions
+56
-70
action.c
dlls/msi/action.c
+56
-70
No files found.
dlls/msi/action.c
View file @
916ef949
...
...
@@ -3002,6 +3002,57 @@ static UINT ACTION_CreateShortcuts(MSIPACKAGE *package)
return
rc
;
}
static
UINT
ITERATE_PublishProduct
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
(
MSIPACKAGE
*
)
param
;
HANDLE
the_file
;
LPWSTR
FilePath
=
NULL
;
LPCWSTR
FileName
=
NULL
;
CHAR
buffer
[
1024
];
DWORD
sz
;
UINT
rc
;
FileName
=
MSI_RecordGetString
(
row
,
1
);
if
(
!
FileName
)
{
ERR
(
"Unable to get FileName
\n
"
);
return
ERROR_SUCCESS
;
}
build_icon_path
(
package
,
FileName
,
&
FilePath
);
TRACE
(
"Creating icon file at %s
\n
"
,
debugstr_w
(
FilePath
));
the_file
=
CreateFileW
(
FilePath
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
the_file
==
INVALID_HANDLE_VALUE
)
{
ERR
(
"Unable to create file %s
\n
"
,
debugstr_w
(
FilePath
));
HeapFree
(
GetProcessHeap
(),
0
,
FilePath
);
return
ERROR_SUCCESS
;
}
do
{
DWORD
write
;
sz
=
1024
;
rc
=
MSI_RecordReadStream
(
row
,
2
,
buffer
,
&
sz
);
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to get stream
\n
"
);
CloseHandle
(
the_file
);
DeleteFileW
(
FilePath
);
break
;
}
WriteFile
(
the_file
,
buffer
,
sz
,
&
write
,
NULL
);
}
while
(
sz
==
1024
);
HeapFree
(
GetProcessHeap
(),
0
,
FilePath
);
CloseHandle
(
the_file
);
return
ERROR_SUCCESS
;
}
/*
* 99% of the work done here is only done for
...
...
@@ -3013,11 +3064,9 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
{
UINT
rc
;
MSIQUERY
*
view
;
MSIRECORD
*
row
=
0
;
static
const
WCHAR
Query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'I'
,
'c'
,
'o'
,
'n'
,
'`'
,
0
};
DWORD
sz
;
/* for registry stuff */
LPWSTR
productcode
;
HKEY
hkey
=
0
;
...
...
@@ -3046,80 +3095,17 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
Query
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
next
;
/* write out icon files */
rc
=
MSI_
ViewExecute
(
view
,
0
);
if
(
rc
!
=
ERROR_SUCCESS
)
rc
=
MSI_
DatabaseOpenViewW
(
package
->
db
,
Query
,
&
view
);
if
(
rc
=
=
ERROR_SUCCESS
)
{
MSI_
ViewClose
(
view
);
MSI_
IterateRecords
(
view
,
NULL
,
ITERATE_PublishProduct
,
package
);
msiobj_release
(
&
view
->
hdr
);
goto
next
;
}
while
(
1
)
{
HANDLE
the_file
;
LPWSTR
FilePath
=
NULL
;
LPCWSTR
FileName
=
NULL
;
CHAR
buffer
[
1024
];
rc
=
MSI_ViewFetch
(
view
,
&
row
);
if
(
rc
!=
ERROR_SUCCESS
)
{
rc
=
ERROR_SUCCESS
;
break
;
}
FileName
=
MSI_RecordGetString
(
row
,
1
);
if
(
!
FileName
)
{
ERR
(
"Unable to get FileName
\n
"
);
msiobj_release
(
&
row
->
hdr
);
continue
;
}
build_icon_path
(
package
,
FileName
,
&
FilePath
);
TRACE
(
"Creating icon file at %s
\n
"
,
debugstr_w
(
FilePath
));
the_file
=
CreateFileW
(
FilePath
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
the_file
==
INVALID_HANDLE_VALUE
)
{
ERR
(
"Unable to create file %s
\n
"
,
debugstr_w
(
FilePath
));
msiobj_release
(
&
row
->
hdr
);
HeapFree
(
GetProcessHeap
(),
0
,
FilePath
);
continue
;
}
do
{
DWORD
write
;
sz
=
1024
;
rc
=
MSI_RecordReadStream
(
row
,
2
,
buffer
,
&
sz
);
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Failed to get stream
\n
"
);
CloseHandle
(
the_file
);
DeleteFileW
(
FilePath
);
break
;
}
WriteFile
(
the_file
,
buffer
,
sz
,
&
write
,
NULL
);
}
while
(
sz
==
1024
);
HeapFree
(
GetProcessHeap
(),
0
,
FilePath
);
CloseHandle
(
the_file
);
msiobj_release
(
&
row
->
hdr
);
}
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
next:
/* ok there is a lot more done here but i need to figure out what */
productcode
=
load_dynamic_property
(
package
,
szProductCode
,
&
rc
);
if
(
!
productcode
)
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