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
82a6a3b8
Commit
82a6a3b8
authored
Jan 17, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Jan 17, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First pass implement ion of MsiQueryProductState[A/W] as well as a few
fixes for MsiGetComponentPath.
parent
4c8d59dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
6 deletions
+106
-6
msi.c
dlls/msi/msi.c
+106
-6
No files found.
dlls/msi/msi.c
View file @
82a6a3b8
...
...
@@ -809,14 +809,93 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
INSTALLSTATE
WINAPI
MsiQueryProductStateA
(
LPCSTR
szProduct
)
{
FIXME
(
"%s
\n
"
,
debugstr_a
(
szProduct
));
return
INSTALLSTATE_UNKNOWN
;
LPWSTR
szwProduct
;
UINT
len
;
INSTALLSTATE
rc
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
NULL
,
0
);
szwProduct
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
szProduct
,
-
1
,
szwProduct
,
len
);
rc
=
MsiQueryProductStateW
(
szwProduct
);
HeapFree
(
GetProcessHeap
(),
0
,
szwProduct
);
return
rc
;
}
INSTALLSTATE
WINAPI
MsiQueryProductStateW
(
LPCWSTR
szProduct
)
{
FIXME
(
"%s
\n
"
,
debugstr_w
(
szProduct
));
return
INSTALLSTATE_UNKNOWN
;
WCHAR
squished_pc
[
0x100
];
UINT
rc
;
INSTALLSTATE
rrc
=
INSTALLSTATE_UNKNOWN
;
HKEY
hkey
=
0
,
hkey2
=
0
,
hkey3
=
0
;
static
const
WCHAR
szInstaller
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
szUninstaller
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'U'
,
'n'
,
'i'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
szProducts
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
's'
,
0
};
static
const
WCHAR
szWindowsInstaller
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
0
};
DWORD
sz
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProduct
));
squash_guid
(
szProduct
,
squished_pc
);
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
rc
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
szInstaller
,
&
hkey
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
/* check the products key for the product */
rc
=
RegOpenKeyW
(
hkey
,
szProducts
,
&
hkey2
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
rc
=
RegOpenKeyW
(
hkey2
,
squished_pc
,
&
hkey3
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
RegCloseKey
(
hkey3
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey
);
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
szUninstaller
,
&
hkey
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
rc
=
RegOpenKeyW
(
hkey
,
szProduct
,
&
hkey2
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
sz
=
sizeof
(
rrc
);
rc
=
RegQueryValueExW
(
hkey2
,
szWindowsInstaller
,
NULL
,
NULL
,(
LPVOID
)
&
rrc
,
&
sz
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
switch
(
rrc
)
{
case
1
:
/* default */
rrc
=
INSTALLSTATE_DEFAULT
;
break
;
default:
FIXME
(
"Unknown install state read from registry (%i)
\n
"
,
rrc
);
rrc
=
INSTALLSTATE_UNKNOWN
;
break
;
}
end:
RegCloseKey
(
hkey3
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey
);
return
rrc
;
}
INSTALLUILEVEL
WINAPI
MsiSetInternalUI
(
INSTALLUILEVEL
dwUILevel
,
HWND
*
phWnd
)
...
...
@@ -1297,7 +1376,8 @@ INSTALLSTATE WINAPI MsiGetComponentPathA(LPCSTR szProduct, LPCSTR szComponent,
HeapFree
(
GetProcessHeap
(),
0
,
szwComponent
);
if
(
lpwPathBuf
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
lpwPathBuf
,
incoming_len
,
if
(
rc
!=
INSTALLSTATE_UNKNOWN
)
WideCharToMultiByte
(
CP_ACP
,
0
,
lpwPathBuf
,
incoming_len
,
lpPathBuf
,
incoming_len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwPathBuf
);
}
...
...
@@ -1311,7 +1391,7 @@ INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR szProduct, LPCWSTR szComponent,
WCHAR
squished_pc
[
0x100
];
WCHAR
squished_cc
[
0x100
];
UINT
rc
;
INSTALLSTATE
rrc
=
INSTALLSTATE_
ABSENT
;
INSTALLSTATE
rrc
=
INSTALLSTATE_
UNKNOWN
;
HKEY
hkey
=
0
,
hkey2
=
0
,
hkey3
=
0
;
static
const
WCHAR
szInstaller
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
...
...
@@ -1321,6 +1401,8 @@ INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR szProduct, LPCWSTR szComponent,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
szComponents
[]
=
{
'C'
,
'o'
,
'm'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
's'
,
0
};
static
const
WCHAR
szProducts
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
's'
,
0
};
TRACE
(
"(%s %s %p %p)
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szComponent
),
lpPathBuf
,
pcchBuf
);
...
...
@@ -1328,10 +1410,26 @@ INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR szProduct, LPCWSTR szComponent,
squash_guid
(
szProduct
,
squished_pc
);
squash_guid
(
szComponent
,
squished_cc
);
TRACE
(
"squished (%s:%s)
\n
"
,
debugstr_w
(
squished_cc
),
debugstr_w
(
squished_pc
));
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
szInstaller
,
&
hkey
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
/* check the products key for the product */
rc
=
RegOpenKeyW
(
hkey
,
szProducts
,
&
hkey2
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
rc
=
RegOpenKeyW
(
hkey2
,
squished_pc
,
&
hkey3
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
RegCloseKey
(
hkey3
);
RegCloseKey
(
hkey2
);
rc
=
RegOpenKeyW
(
hkey
,
szComponents
,
&
hkey2
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
...
...
@@ -1354,6 +1452,8 @@ INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR szProduct, LPCWSTR szComponent,
FIXME
(
"Only working for installed files, not registry keys
\n
"
);
if
(
GetFileAttributesW
(
lpPathBuf
)
!=
INVALID_FILE_ATTRIBUTES
)
rrc
=
INSTALLSTATE_LOCAL
;
else
rrc
=
INSTALLSTATE_ABSENT
;
end:
RegCloseKey
(
hkey3
);
...
...
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