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
8136bd41
Commit
8136bd41
authored
May 17, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
May 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: automation: Implement Installer::ProductInfo.
parent
d800a082
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
39 deletions
+72
-39
automation.c
dlls/msi/automation.c
+34
-2
msiserver.idl
dlls/msi/msiserver.idl
+4
-0
msiserver_dispids.h
dlls/msi/msiserver_dispids.h
+1
-0
automation.c
dlls/msi/tests/automation.c
+33
-37
No files found.
dlls/msi/automation.c
View file @
8136bd41
...
...
@@ -1167,6 +1167,8 @@ static HRESULT WINAPI InstallerImpl_Invoke(
UINT
ret
;
VARIANTARG
varg0
,
varg1
,
varg2
;
HRESULT
hr
;
LPWSTR
szString
=
NULL
;
DWORD
dwSize
=
0
;
VariantInit
(
&
varg0
);
VariantInit
(
&
varg1
);
...
...
@@ -1256,8 +1258,7 @@ static HRESULT WINAPI InstallerImpl_Invoke(
case
DISPID_INSTALLER_REGISTRYVALUE
:
if
(
wFlags
&
DISPATCH_METHOD
)
{
HKEY
hkey
;
LPWSTR
szString
=
NULL
;
DWORD
dwSize
=
0
,
dwType
;
DWORD
dwType
;
UINT
posValue
=
2
;
/* Save valuePos so we can save puArgErr if we are unable to do our type conversions */
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_I4
,
&
varg0
,
puArgErr
);
...
...
@@ -1353,6 +1354,37 @@ static HRESULT WINAPI InstallerImpl_Invoke(
else
return
DISP_E_MEMBERNOTFOUND
;
break
;
case
DISPID_INSTALLER_PRODUCTINFO
:
if
(
wFlags
&
DISPATCH_PROPERTYGET
)
{
hr
=
DispGetParam
(
pDispParams
,
0
,
VT_BSTR
,
&
varg0
,
puArgErr
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
DispGetParam
(
pDispParams
,
1
,
VT_BSTR
,
&
varg1
,
puArgErr
);
if
(
FAILED
(
hr
))
{
VariantClear
(
&
varg0
);
return
hr
;
}
V_VT
(
pVarResult
)
=
VT_BSTR
;
V_BSTR
(
pVarResult
)
=
NULL
;
if
((
ret
=
MsiGetProductInfoW
(
V_BSTR
(
&
varg0
),
V_BSTR
(
&
varg1
),
NULL
,
&
dwSize
))
==
ERROR_SUCCESS
)
{
if
(
!
(
szString
=
msi_alloc
((
++
dwSize
)
*
sizeof
(
WCHAR
))))
ERR
(
"Out of memory
\n
"
);
else
if
((
ret
=
MsiGetProductInfoW
(
V_BSTR
(
&
varg0
),
V_BSTR
(
&
varg1
),
szString
,
&
dwSize
))
==
ERROR_SUCCESS
)
V_BSTR
(
pVarResult
)
=
SysAllocString
(
szString
);
msi_free
(
szString
);
}
if
(
ret
!=
ERROR_SUCCESS
)
{
ERR
(
"MsiGetProductInfo returned %d
\n
"
,
ret
);
VariantClear
(
&
varg1
);
VariantClear
(
&
varg0
);
return
DISP_E_EXCEPTION
;
}
}
else
return
DISP_E_MEMBERNOTFOUND
;
break
;
case
DISPID_INSTALLER_PRODUCTS
:
if
(
wFlags
&
DISPATCH_PROPERTYGET
)
{
...
...
dlls/msi/msiserver.idl
View file @
8136bd41
...
...
@@ -77,6 +77,10 @@ library WindowsInstaller
[id(DISPID_INSTALLER_PRODUCTSTATE), propget]
MsiInstallState ProductState(
[in] BSTR Product);
[id(DISPID_INSTALLER_PRODUCTINFO), propget]
BSTR ProductInfo(
[in] BSTR Product,
[in] BSTR Attribute);
[id(DISPID_INSTALLER_PRODUCTS), propget]
StringList *Products();
[id(DISPID_INSTALLER_RELATEDPRODUCTS), propget]
...
...
dlls/msi/msiserver_dispids.h
View file @
8136bd41
...
...
@@ -21,6 +21,7 @@
#define DISPID_INSTALLER_INSTALLPRODUCT 8
#define DISPID_INSTALLER_REGISTRYVALUE 11
#define DISPID_INSTALLER_PRODUCTSTATE 17
#define DISPID_INSTALLER_PRODUCTINFO 18
#define DISPID_INSTALLER_PRODUCTS 35
#define DISPID_INSTALLER_RELATEDPRODUCTS 40
...
...
dlls/msi/tests/automation.c
View file @
8136bd41
...
...
@@ -443,8 +443,8 @@ static void test_dispid(void)
ok
(
get_dispid
(
pInstaller
,
"FileVersion"
)
==
16
,
"dispid wrong
\n
"
);
}
ok
(
get_dispid
(
pInstaller
,
"ProductState"
)
==
17
,
"dispid wrong
\n
"
);
todo_wine
{
ok
(
get_dispid
(
pInstaller
,
"ProductInfo"
)
==
18
,
"dispid wrong
\n
"
);
todo_wine
{
ok
(
get_dispid
(
pInstaller
,
"ConfigureProduct"
)
==
19
,
"dispid wrong
\n
"
);
ok
(
get_dispid
(
pInstaller
,
"ReinstallProduct"
)
==
20
,
"dispid wrong
\n
"
);
ok
(
get_dispid
(
pInstaller
,
"CollectUserInfo"
)
==
21
,
"dispid wrong
\n
"
);
...
...
@@ -1686,32 +1686,30 @@ static void test_Installer_InstallProduct(LPCWSTR szPath)
ok
(
iValue
==
INSTALLSTATE_DEFAULT
,
"Installer_ProductState returned %d, expected %d
\n
"
,
iValue
,
INSTALLSTATE_DEFAULT
);
/* Installer::ProductInfo for our product code */
todo_wine
{
/* NULL attribute */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
NULL
,
szString
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
/* Non-existent
attribute */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
szMsifile
,
szString
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
/* NULL
attribute */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
NULL
,
szString
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
/* Package nam
e */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
INSTALLPROPERTY_PACKAGENAMEW
,
szString
);
ok
(
SUCCEEDED
(
hr
)
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_w2
(
"StringList_Item returned %s but expected %s
\n
"
,
szString
,
szMsifile
);
/* Non-existent attribut
e */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
szMsifile
,
szString
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
/* Product name */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
INSTALLPROPERTY_PRODUCTNAMEW
,
szString
);
ok
(
SUCCEEDED
(
hr
),
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_w2
(
"StringList_Item returned %s but expected %s
\n
"
,
szString
,
szMSITEST
);
}
/* Package name */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
INSTALLPROPERTY_PACKAGENAMEW
,
szString
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
todo_wine
ok_w2
(
"StringList_Item returned %s but expected %s
\n
"
,
szString
,
szMsifile
);
/* Product name */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
Installer_ProductInfo
(
szProductCode
,
INSTALLPROPERTY_PRODUCTNAMEW
,
szString
);
ok
(
SUCCEEDED
(
hr
),
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_w2
(
"StringList_Item returned %s but expected %s
\n
"
,
szString
,
szMSITEST
);
/* Installer::RelatedProducts for our upgrade code */
hr
=
Installer_RelatedProducts
(
szUpgradeCode
,
&
pStringList
);
...
...
@@ -1933,20 +1931,18 @@ static void test_Installer(void)
ok
(
iValue
==
INSTALLSTATE_UNKNOWN
,
"Installer_ProductState returned %d, expected %d
\n
"
,
iValue
,
INSTALLSTATE_UNKNOWN
);
/* Installer::ProductInfo for our product code, which should not be installed */
todo_wine
{
/* Package name */
memset
(
szPath
,
0
,
sizeof
(
szPath
));
hr
=
Installer_ProductInfo
(
szProductCode
,
INSTALLPROPERTY_PACKAGENAMEW
,
szPath
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
/* NULL attribute and NULL product code */
memset
(
szPath
,
0
,
sizeof
(
szPath
));
hr
=
Installer_ProductInfo
(
NULL
,
NULL
,
szPath
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
}
/* Package name */
memset
(
szPath
,
0
,
sizeof
(
szPath
));
hr
=
Installer_ProductInfo
(
szProductCode
,
INSTALLPROPERTY_PACKAGENAMEW
,
szPath
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
/* NULL attribute and NULL product code */
memset
(
szPath
,
0
,
sizeof
(
szPath
));
hr
=
Installer_ProductInfo
(
NULL
,
NULL
,
szPath
);
ok
(
hr
==
DISP_E_EXCEPTION
,
"Installer_ProductInfo failed, hresult 0x%08x
\n
"
,
hr
);
ok_exception
(
hr
,
szProductInfoException
);
/* Installer::RelatedProducts for our upgrade code, should not find anything */
hr
=
Installer_RelatedProducts
(
szUpgradeCode
,
&
pStringList
);
...
...
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