Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
0f36dc8d
Commit
0f36dc8d
authored
12 years ago
by
Francois Gouget
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
appwiz.cpl: Only offer to download an addon if its installer is missing.
parent
f757f3fb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/appwiz.cpl/addons.c
+29
-20
29 additions, 20 deletions
dlls/appwiz.cpl/addons.c
with
29 additions
and
20 deletions
dlls/appwiz.cpl/addons.c
+
29
−
20
View file @
0f36dc8d
...
...
@@ -175,25 +175,31 @@ static void set_status(DWORD id)
SendMessageW
(
status
,
WM_SETTEXT
,
0
,
(
LPARAM
)
buf
);
}
static
BOOL
install_file
(
const
WCHAR
*
file_name
)
enum
install_res
{
INSTALL_OK
=
0
,
INSTALL_FAILED
,
INSTALL_NEXT
,
};
static
enum
install_res
install_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
INSTALL_FAILED
;
}
return
TRUE
;
return
INSTALL_OK
;
}
static
BOOL
install_from_unix_file
(
const
char
*
dir
,
const
char
*
subdir
,
const
char
*
file_name
)
static
enum
install_res
install_from_unix_file
(
const
char
*
dir
,
const
char
*
subdir
,
const
char
*
file_name
)
{
LPWSTR
dos_file_name
;
char
*
file_path
;
int
fd
,
len
;
BOOL
ret
;
enum
install_res
ret
;
static
WCHAR
*
(
CDECL
*
wine_get_dos_file_name
)(
const
char
*
);
static
const
WCHAR
kernel32W
[]
=
{
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
...
...
@@ -201,7 +207,7 @@ static BOOL install_from_unix_file(const char *dir, const char *subdir, const ch
len
=
strlen
(
dir
);
file_path
=
heap_alloc
(
len
+
strlen
(
subdir
)
+
strlen
(
file_name
)
+
3
);
if
(
!
file_path
)
return
FALSE
;
return
INSTALL_FAILED
;
memcpy
(
file_path
,
dir
,
len
);
if
(
len
&&
file_path
[
len
-
1
]
!=
'/'
&&
file_path
[
len
-
1
]
!=
'\\'
)
...
...
@@ -217,7 +223,7 @@ static BOOL install_from_unix_file(const char *dir, const char *subdir, const ch
if
(
fd
==
-
1
)
{
TRACE
(
"%s not found
\n
"
,
debugstr_a
(
file_path
));
heap_free
(
file_path
);
return
FALSE
;
return
INSTALL_NEXT
;
}
close
(
fd
);
...
...
@@ -230,7 +236,7 @@ static BOOL install_from_unix_file(const char *dir, const char *subdir, const ch
if
(
!
dos_file_name
)
{
ERR
(
"Could not get dos file name of %s
\n
"
,
debugstr_a
(
file_path
));
heap_free
(
file_path
);
return
FALSE
;
return
INSTALL_FAILED
;
}
}
else
{
/* Windows mode */
UINT
res
;
...
...
@@ -265,16 +271,16 @@ static HKEY open_config_key(void)
return
res
==
ERROR_SUCCESS
?
ret
:
NULL
;
}
static
BOOL
install_from_registered_dir
(
void
)
static
enum
install_res
install_from_registered_dir
(
void
)
{
char
*
package_dir
;
HKEY
hkey
;
DWORD
res
,
type
,
size
=
MAX_PATH
;
BOOL
ret
;
enum
install_res
ret
;
hkey
=
open_config_key
();
if
(
!
hkey
)
return
FALSE
;
return
INSTALL_NEXT
;
package_dir
=
heap_alloc
(
size
);
res
=
RegGetValueA
(
hkey
,
NULL
,
addon
->
dir_config_key
,
RRF_RT_ANY
,
&
type
,
(
PBYTE
)
package_dir
,
&
size
);
...
...
@@ -283,9 +289,12 @@ static BOOL install_from_registered_dir(void)
res
=
RegGetValueA
(
hkey
,
NULL
,
addon
->
dir_config_key
,
RRF_RT_ANY
,
&
type
,
(
PBYTE
)
package_dir
,
&
size
);
}
RegCloseKey
(
hkey
);
if
(
res
!
=
ERROR_
SUCCESS
||
(
type
!=
REG_SZ
&&
type
!=
REG_EXPAND_SZ
)
)
{
if
(
res
=
=
ERROR_
FILE_NOT_FOUND
)
{
heap_free
(
package_dir
);
return
FALSE
;
return
INSTALL_NEXT
;
}
else
if
(
res
!=
ERROR_SUCCESS
||
(
type
!=
REG_SZ
&&
type
!=
REG_EXPAND_SZ
))
{
heap_free
(
package_dir
);
return
INSTALL_FAILED
;
}
TRACE
(
"Trying %s/%s
\n
"
,
debugstr_a
(
package_dir
),
debugstr_a
(
addon
->
file_name
));
...
...
@@ -296,7 +305,7 @@ static BOOL install_from_registered_dir(void)
return
ret
;
}
static
BOOL
install_from_default_dir
(
void
)
static
enum
install_res
install_from_default_dir
(
void
)
{
const
char
*
data_dir
,
*
package_dir
;
char
*
dir_buf
=
NULL
;
...
...
@@ -312,15 +321,15 @@ static BOOL install_from_default_dir(void)
strcpy
(
dir_buf
+
len
,
"/../"
);
package_dir
=
dir_buf
;
}
else
{
return
FALSE
;
return
INSTALL_NEXT
;
}
ret
=
install_from_unix_file
(
package_dir
,
addon
->
subdir_name
,
addon
->
file_name
);
heap_free
(
dir_buf
);
if
(
!
ret
)
if
(
ret
==
INSTALL_NEXT
)
ret
=
install_from_unix_file
(
INSTALL_DATADIR
"/wine/"
,
addon
->
subdir_name
,
addon
->
file_name
);
if
(
!
ret
&&
strcmp
(
INSTALL_DATADIR
,
"/usr/share"
))
if
(
ret
==
INSTALL_NEXT
&&
strcmp
(
INSTALL_DATADIR
,
"/usr/share"
))
ret
=
install_from_unix_file
(
"/usr/share/wine/"
,
addon
->
subdir_name
,
addon
->
file_name
);
return
ret
;
}
...
...
@@ -588,9 +597,9 @@ BOOL install_addon(addon_t addon_type)
* - /usr/share/wine/$addon_subdir/
* - download from URL stored in $url_config_key value of HKCU/Wine/Software/$config_key key
*/
if
(
!
install_from_registered_dir
()
&&
!
install_from_default_dir
()
&&
(
url
=
get_url
()))
if
(
install_from_registered_dir
()
==
INSTALL_NEXT
&&
install_from_default_dir
()
==
INSTALL_NEXT
&&
(
url
=
get_url
()))
DialogBoxW
(
hInst
,
addon
->
dialog_template
,
0
,
installer_proc
);
heap_free
(
url
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment