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
e1e83bc5
Commit
e1e83bc5
authored
Feb 10, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appwiz.cpl: Added support for installing packages from MSI files.
parent
92b5b3fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
Makefile.in
dlls/appwiz.cpl/Makefile.in
+1
-0
addons.c
dlls/appwiz.cpl/addons.c
+43
-2
No files found.
dlls/appwiz.cpl/Makefile.in
View file @
e1e83bc5
MODULE
=
appwiz.cpl
IMPORTS
=
uuid urlmon advpack comctl32 advapi32 shell32 user32 comdlg32
DELAYIMPORTS
=
msi
EXTRADEFS
=
-DINSTALL_DATADIR
=
"
\"
$(datadir)
\"
"
C_SRCS
=
\
...
...
dlls/appwiz.cpl/addons.c
View file @
e1e83bc5
...
...
@@ -40,6 +40,7 @@
#include "wininet.h"
#include "shellapi.h"
#include "urlmon.h"
#include "msi.h"
#include "appwiz.h"
#include "res.h"
...
...
@@ -242,6 +243,46 @@ static BOOL install_cab(LPCWSTR file_name)
return
TRUE
;
}
static
BOOL
install_msi_file
(
const
WCHAR
*
file_name
)
{
ULONG
res
;
res
=
MsiInstallProductW
(
file_name
,
NULL
);
if
(
res
!=
ERROR_SUCCESS
)
{
ERR
(
"MsiInstallProduct failed: %u
\n
"
,
res
);
return
FALSE
;
}
return
TRUE
;
}
static
BOOL
install_file
(
const
WCHAR
*
file_name
)
{
BYTE
magic
[
4
];
HANDLE
file
;
DWORD
size
;
BOOL
res
;
static
const
BYTE
msi_magic
[]
=
{
0xd0
,
0xcf
,
0x11
,
0xe0
};
file
=
CreateFileW
(
file_name
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_READONLY
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
res
=
ReadFile
(
file
,
magic
,
sizeof
(
magic
),
&
size
,
NULL
);
CloseHandle
(
file
);
if
(
!
res
||
size
!=
sizeof
(
magic
))
return
INET_E_DOWNLOAD_FAILURE
;
if
(
!
memcmp
(
magic
,
"MSCF"
,
sizeof
(
magic
)))
return
install_cab
(
file_name
);
else
if
(
!
memcmp
(
magic
,
msi_magic
,
sizeof
(
magic
)))
return
install_msi_file
(
file_name
);
ERR
(
"Unknown file magic
\n
"
);
return
FALSE
;
}
static
BOOL
install_from_unix_file
(
const
char
*
file_name
)
{
LPWSTR
dos_file_name
;
...
...
@@ -276,7 +317,7 @@ static BOOL install_from_unix_file(const char *file_name)
MultiByteToWideChar
(
CP_ACP
,
0
,
file_name
,
-
1
,
dos_file_name
,
res
);
}
ret
=
install_
cab
(
dos_file_name
);
ret
=
install_
file
(
dos_file_name
);
heap_free
(
dos_file_name
);
return
ret
;
...
...
@@ -513,7 +554,7 @@ static DWORD WINAPI download_proc(PVOID arg)
}
if
(
sha_check
(
tmp_file
))
install_
cab
(
tmp_file
);
install_
file
(
tmp_file
);
DeleteFileW
(
tmp_file
);
EndDialog
(
install_dialog
,
0
);
return
0
;
...
...
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