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
98761037
Commit
98761037
authored
Feb 12, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement the UnregisterTypeLibraries standard action.
parent
30872b0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
146 additions
and
8 deletions
+146
-8
action.c
dlls/msi/action.c
+62
-8
msipriv.h
dlls/msi/msipriv.h
+1
-0
install.c
dlls/msi/tests/install.c
+83
-0
No files found.
dlls/msi/action.c
View file @
98761037
...
...
@@ -2862,8 +2862,6 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param)
HMODULE
module
;
HRESULT
hr
;
static
const
WCHAR
szTYPELIB
[]
=
{
'T'
,
'Y'
,
'P'
,
'E'
,
'L'
,
'I'
,
'B'
,
0
};
component
=
MSI_RecordGetString
(
row
,
3
);
comp
=
get_loaded_component
(
package
,
component
);
if
(
!
comp
)
...
...
@@ -2967,6 +2965,68 @@ static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package)
return
rc
;
}
static
UINT
ITERATE_UnregisterTypeLibraries
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
param
;
LPCWSTR
component
,
guid
;
MSICOMPONENT
*
comp
;
GUID
libid
;
UINT
version
;
LCID
language
;
SYSKIND
syskind
;
HRESULT
hr
;
component
=
MSI_RecordGetString
(
row
,
3
);
comp
=
get_loaded_component
(
package
,
component
);
if
(
!
comp
)
return
ERROR_SUCCESS
;
if
(
!
ACTION_VerifyComponentForAction
(
comp
,
INSTALLSTATE_ABSENT
))
{
TRACE
(
"Skipping, component is not scheduled for uninstall
\n
"
);
comp
->
Action
=
comp
->
Installed
;
return
ERROR_SUCCESS
;
}
comp
->
Action
=
INSTALLSTATE_ABSENT
;
guid
=
MSI_RecordGetString
(
row
,
1
);
CLSIDFromString
(
(
LPWSTR
)
guid
,
&
libid
);
version
=
MSI_RecordGetInteger
(
row
,
4
);
language
=
MSI_RecordGetInteger
(
row
,
2
);
#ifdef _WIN64
syskind
=
SYS_WIN64
;
#else
syskind
=
SYS_WIN32
;
#endif
hr
=
UnRegisterTypeLib
(
&
libid
,
(
version
>>
8
)
&
0xffff
,
version
&
0xff
,
language
,
syskind
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to unregister typelib: %08x
\n
"
,
hr
);
}
return
ERROR_SUCCESS
;
}
static
UINT
ACTION_UnregisterTypeLibraries
(
MSIPACKAGE
*
package
)
{
UINT
rc
;
MSIQUERY
*
view
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'T'
,
'y'
,
'p'
,
'e'
,
'L'
,
'i'
,
'b'
,
'`'
,
0
};
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
query
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
rc
=
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_UnregisterTypeLibraries
,
package
);
msiobj_release
(
&
view
->
hdr
);
return
rc
;
}
static
UINT
ITERATE_CreateShortcuts
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
param
;
...
...
@@ -6452,12 +6512,6 @@ static UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package )
return
msi_unimplemented_action_stub
(
package
,
"UnregisterProgIdInfo"
,
table
);
}
static
UINT
ACTION_UnregisterTypeLibraries
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
'L'
,
'i'
,
'b'
,
0
};
return
msi_unimplemented_action_stub
(
package
,
"UnregisterTypeLibraries"
,
table
);
}
typedef
UINT
(
*
STANDARDACTIONHANDLER
)(
MSIPACKAGE
*
);
static
const
struct
...
...
dlls/msi/msipriv.h
View file @
98761037
...
...
@@ -1075,6 +1075,7 @@ static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
static
const
WCHAR
szProductID
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
szPIDTemplate
[]
=
{
'P'
,
'I'
,
'D'
,
'T'
,
'e'
,
'm'
,
'p'
,
'l'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
szPIDKEY
[]
=
{
'P'
,
'I'
,
'D'
,
'K'
,
'E'
,
'Y'
,
0
};
static
const
WCHAR
szTYPELIB
[]
=
{
'T'
,
'Y'
,
'P'
,
'E'
,
'L'
,
'I'
,
'B'
,
0
};
/* memory allocation macro functions */
static
void
*
msi_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
...
...
dlls/msi/tests/install.c
View file @
98761037
...
...
@@ -1320,6 +1320,50 @@ static const CHAR odbc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\
"Media
\t
DiskId
\n
"
"1
\t
5
\t\t\t
DISK1
\t\n
"
;
static
const
CHAR
tl_file_dat
[]
=
"File
\t
Component_
\t
FileName
\t
FileSize
\t
Version
\t
Language
\t
Attributes
\t
Sequence
\n
"
"s72
\t
s72
\t
l255
\t
i4
\t
S72
\t
S20
\t
I2
\t
i2
\n
"
"File
\t
File
\n
"
"typelib.dll
\t
typelib
\t
typelib.dll
\t
1000
\t\t\t
8192
\t
1
\n
"
;
static
const
CHAR
tl_feature_dat
[]
=
"Feature
\t
Feature_Parent
\t
Title
\t
Description
\t
Display
\t
Level
\t
Directory_
\t
Attributes
\n
"
"s38
\t
S38
\t
L64
\t
L255
\t
I2
\t
i2
\t
S72
\t
i2
\n
"
"Feature
\t
Feature
\n
"
"typelib
\t\t\t
typelib feature
\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
;
static
const
CHAR
tl_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"typelib
\t
typelib
\n
"
;
static
const
CHAR
tl_component_dat
[]
=
"Component
\t
ComponentId
\t
Directory_
\t
Attributes
\t
Condition
\t
KeyPath
\n
"
"s72
\t
S38
\t
s72
\t
i2
\t
S255
\t
S72
\n
"
"Component
\t
Component
\n
"
"typelib
\t
{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}
\t
MSITESTDIR
\t
0
\t\t
typelib.dll
\n
"
;
static
const
CHAR
tl_typelib_dat
[]
=
"LibID
\t
Language
\t
Component_
\t
Version
\t
Description
\t
Directory_
\t
Feature_
\t
Cost
\n
"
"s38
\t
i2
\t
s72
\t
I4
\t
L128
\t
S72
\t
s38
\t
I4
\n
"
"TypeLib
\t
LibID
\t
Language
\t
Component_
\n
"
"{EAC5166A-9734-4D91-878F-1DD02304C66C}
\t
0
\t
typelib
\t
1793
\t\t
MSITESTDIR
\t
typelib
\t\n
"
;
static
const
CHAR
tl_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"LaunchConditions
\t\t
100
\n
"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"CostFinalize
\t\t
1000
\n
"
"InstallValidate
\t\t
1400
\n
"
"InstallInitialize
\t\t
1500
\n
"
"ProcessComponents
\t\t
1600
\n
"
"RemoveFiles
\t\t
1700
\n
"
"InstallFiles
\t\t
2000
\n
"
"RegisterTypeLibraries
\t
REGISTER_TYPELIB=1
\t
3000
\n
"
"UnregisterTypeLibraries
\t\t
3100
\n
"
"RegisterProduct
\t\t
5100
\n
"
"PublishFeatures
\t\t
5200
\n
"
"PublishProduct
\t\t
5300
\n
"
"InstallFinalize
\t\t
6000
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -2131,6 +2175,19 @@ static const msi_table odbc_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
tl_tables
[]
=
{
ADD_TABLE
(
tl_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
tl_feature
),
ADD_TABLE
(
tl_feature_comp
),
ADD_TABLE
(
tl_file
),
ADD_TABLE
(
tl_typelib
),
ADD_TABLE
(
tl_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -8022,6 +8079,31 @@ static void test_install_remove_odbc(void)
delete_test_files
();
}
static
void
test_register_typelib
(
void
)
{
UINT
r
;
create_test_files
();
create_file
(
"msitest
\\
typelib.dll"
,
1000
);
create_database
(
msifile
,
tl_tables
,
sizeof
(
tl_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
"REGISTER_TYPELIB=1"
);
todo_wine
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
typelib.dll"
,
TRUE
),
"file not removed
\n
"
);
todo_wine
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"directory not removed
\n
"
);
delete_test_files
();
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -8121,6 +8203,7 @@ START_TEST(install)
test_register_font
();
test_validate_product_id
();
test_install_remove_odbc
();
test_register_typelib
();
DeleteFileA
(
log_file
);
...
...
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