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
eb7ae99d
Commit
eb7ae99d
authored
Aug 23, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Remove icons when the product is uninstalled.
parent
db6dbcf2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
action.c
dlls/msi/action.c
+41
-0
install.c
dlls/msi/tests/install.c
+2
-0
No files found.
dlls/msi/action.c
View file @
eb7ae99d
...
...
@@ -4896,6 +4896,45 @@ static UINT ACTION_InstallExecute(MSIPACKAGE *package)
return
execute_script
(
package
,
INSTALL_SCRIPT
);
}
static
UINT
ITERATE_UnpublishIcon
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
param
;
const
WCHAR
*
icon
=
MSI_RecordGetString
(
row
,
1
);
WCHAR
*
p
,
*
icon_path
;
if
(
!
icon
)
return
ERROR_SUCCESS
;
if
((
icon_path
=
msi_build_icon_path
(
package
,
icon
)))
{
TRACE
(
"removing icon file %s
\n
"
,
debugstr_w
(
icon_path
));
DeleteFileW
(
icon_path
);
if
((
p
=
strrchrW
(
icon_path
,
'\\'
)))
{
*
p
=
0
;
RemoveDirectoryW
(
icon_path
);
}
msi_free
(
icon_path
);
}
return
ERROR_SUCCESS
;
}
static
UINT
msi_unpublish_icons
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'I'
,
'c'
,
'o'
,
'n'
,
'`'
,
0
};
MSIQUERY
*
view
;
UINT
r
;
r
=
MSI_DatabaseOpenViewW
(
package
->
db
,
query
,
&
view
);
if
(
r
==
ERROR_SUCCESS
)
{
r
=
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_UnpublishIcon
,
package
);
msiobj_release
(
&
view
->
hdr
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
}
return
ERROR_SUCCESS
;
}
static
UINT
msi_unpublish_product
(
MSIPACKAGE
*
package
,
const
WCHAR
*
remove
)
{
static
const
WCHAR
szUpgradeCode
[]
=
{
'U'
,
'p'
,
'g'
,
'r'
,
'a'
,
'd'
,
'e'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
...
...
@@ -4948,6 +4987,8 @@ static UINT msi_unpublish_product( MSIPACKAGE *package, const WCHAR *remove )
}
TRACE
(
"removing local package %s
\n
"
,
debugstr_w
(
package
->
localfile
));
package
->
delete_on_close
=
TRUE
;
msi_unpublish_icons
(
package
);
return
ERROR_SUCCESS
;
}
...
...
dlls/msi/tests/install.c
View file @
eb7ae99d
...
...
@@ -5980,6 +5980,7 @@ static void test_icon_table(void)
res
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to uninstall per-user
\n
"
);
ok
(
!
file_exists
(
path
),
"Per-user icon file not removed (%s)
\n
"
,
path
);
/* system-wide */
res
=
MsiInstallProductA
(
msifile
,
"PUBLISH_PRODUCT=1 ALLUSERS=1"
);
...
...
@@ -5994,6 +5995,7 @@ static void test_icon_table(void)
res
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to uninstall system-wide
\n
"
);
ok
(
!
file_exists
(
path
),
"System-wide icon file not removed (%s)
\n
"
,
path
);
delete_pfmsitest_files
();
DeleteFile
(
msifile
);
...
...
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