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
95ef6a1f
Commit
95ef6a1f
authored
Feb 19, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Simplify the MEDIAPACKAGEPATH and DISKPROMPT cases.
parent
fe987103
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
65 deletions
+33
-65
source.c
dlls/msi/source.c
+18
-23
source.c
dlls/msi/tests/source.c
+15
-42
No files found.
dlls/msi/source.c
View file @
95ef6a1f
...
...
@@ -395,9 +395,14 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
LPCWSTR
szProperty
,
LPCWSTR
szValue
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
HKEY
sourcekey
;
HKEY
sourcekey
,
media
;
LPCWSTR
property
;
UINT
rc
;
static
const
WCHAR
media_package
[]
=
{
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
'P'
,
'a'
,
'c'
,
'k'
,
'a'
,
'g'
,
'e'
,
0
};
TRACE
(
"%s %s %x %x %s %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szUserSid
),
dwContext
,
dwOptions
,
debugstr_w
(
szProperty
),
debugstr_w
(
szValue
));
...
...
@@ -415,40 +420,30 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
FIXME
(
"Unhandled options MSICODE_PATCH
\n
"
);
return
ERROR_UNKNOWN_PATCH
;
}
if
(
szUserSid
)
FIXME
(
"Unhandled UserSid %s
\n
"
,
debugstr_w
(
szUserSid
));
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
property
=
szProperty
;
if
(
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_MEDIAPACKAGEPATHW
))
property
=
media_package
;
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
dwContext
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
return
rc
;
if
(
strcmpW
(
szProperty
,
INSTALLPROPERTY_MEDIAPACKAGEPATHW
)
==
0
)
if
(
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_MEDIAPACKAGEPATHW
)
||
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_DISKPROMPTW
))
{
HKEY
key
;
DWORD
size
=
lstrlenW
(
szValue
)
*
sizeof
(
WCHAR
);
rc
=
OpenMediaSubkey
(
sourcekey
,
&
key
,
FALSE
);
rc
=
OpenMediaSubkey
(
sourcekey
,
&
media
,
TRUE
);
if
(
rc
==
ERROR_SUCCESS
)
rc
=
RegSetValueExW
(
key
,
INSTALLPROPERTY_MEDIAPACKAGEPATHW
,
0
,
REG_SZ
,
(
const
BYTE
*
)
szValue
,
size
);
if
(
rc
!=
ERROR_SUCCESS
)
rc
=
ERROR_UNKNOWN_PROPERTY
;
RegCloseKey
(
key
);
}
else
if
(
strcmpW
(
szProperty
,
INSTALLPROPERTY_DISKPROMPTW
)
==
0
)
{
HKEY
key
;
DWORD
size
=
lstrlenW
(
szValue
)
*
sizeof
(
WCHAR
);
rc
=
OpenMediaSubkey
(
sourcekey
,
&
key
,
FALSE
);
if
(
rc
==
ERROR_SUCCESS
)
rc
=
RegSetValueExW
(
key
,
INSTALLPROPERTY_DISKPROMPTW
,
0
,
REG_SZ
,
(
const
BYTE
*
)
szValue
,
size
);
if
(
rc
!=
ERROR_SUCCESS
)
rc
=
ERROR_UNKNOWN_PROPERTY
;
RegCloseKey
(
key
);
{
rc
=
msi_reg_set_val_str
(
media
,
property
,
szValue
);
RegCloseKey
(
media
);
}
}
else
if
(
strcmpW
(
szProperty
,
INSTALLPROPERTY_LASTUSEDSOURCEW
)
==
0
)
{
...
...
dlls/msi/tests/source.c
View file @
95ef6a1f
...
...
@@ -1509,28 +1509,19 @@ static void test_MsiSourceListSetInfo(void)
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_MEDIAPACKAGEPATH
,
"path"
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* Media key is created by MsiSourceListSetInfo */
res
=
RegOpenKeyA
(
source
,
"Media"
,
&
media
);
todo_wine
{
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path"
);
}
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path"
);
/* set the info again */
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_MEDIAPACKAGEPATH
,
"path2"
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path2"
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path2"
);
/* NULL szProperty */
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
...
...
@@ -1557,11 +1548,8 @@ static void test_MsiSourceListSetInfo(void)
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_MEDIAPACKAGEPATH
,
""
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
""
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
""
);
/* INSTALLPROPERTY_MEDIAPACKAGEPATH, MSISOURCETYPE_NETWORK */
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
...
...
@@ -1589,11 +1577,8 @@ static void test_MsiSourceListSetInfo(void)
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_DISKPROMPT
,
"prompt"
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
CHECK_REG_STR
(
media
,
"DiskPrompt"
,
"prompt"
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
CHECK_REG_STR
(
media
,
"DiskPrompt"
,
"prompt"
);
/* INSTALLPROPERTY_DISKPROMPT, MSISOURCETYPE_NETWORK */
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
...
...
@@ -1750,18 +1735,12 @@ static void test_MsiSourceListSetInfo(void)
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_MEDIAPACKAGEPATH
,
"path"
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* Media key is created by MsiSourceListSetInfo */
res
=
RegOpenKeyA
(
source
,
"Media"
,
&
media
);
todo_wine
{
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path"
);
}
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path"
);
RegDeleteValueA
(
media
,
"MediaPackage"
);
RegDeleteKeyA
(
media
,
""
);
...
...
@@ -1793,18 +1772,12 @@ static void test_MsiSourceListSetInfo(void)
r
=
MsiSourceListSetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_MACHINE
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_MEDIAPACKAGEPATH
,
"path"
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* Media key is created by MsiSourceListSetInfo */
res
=
RegOpenKeyA
(
source
,
"Media"
,
&
media
);
todo_wine
{
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path"
);
}
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
CHECK_REG_STR
(
media
,
"MediaPackage"
,
"path"
);
/* szUserSid is non-NULL */
r
=
MsiSourceListSetInfoA
(
prodcode
,
usersid
,
...
...
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