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
eece76b8
Commit
eece76b8
authored
Jul 21, 2008
by
Owen Rudge
Committed by
Alexandre Julliard
Jul 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appwiz.cpl: Add uninstall routine for applications.
parent
0215b55c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
0 deletions
+84
-0
En.rc
dlls/appwiz.cpl/En.rc
+2
-0
appwiz.c
dlls/appwiz.cpl/appwiz.c
+81
-0
res.h
dlls/appwiz.cpl/res.h
+1
-0
No files found.
dlls/appwiz.cpl/En.rc
View file @
eece76b8
...
...
@@ -27,6 +27,8 @@ STRINGTABLE
IDS_CPL_DESC, "Allows you to install new software, or remove existing software from your computer."
IDS_TAB1_TITLE, "Applications"
IDS_UNINSTALL_FAILED, "Unable to execute the uninstaller, '%s'. Do you want to remove the uninstall entry for this program from the registry?"
IDS_COLUMN_NAME, "Name"
IDS_COLUMN_PUBLISHER, "Publisher"
IDS_COLUMN_VERSION, "Version"
...
...
dlls/appwiz.cpl/appwiz.c
View file @
eece76b8
...
...
@@ -371,6 +371,61 @@ static void UpdateButtons(HWND hWnd)
EnableWindow
(
GetDlgItem
(
hWnd
,
IDC_SUPPORT_INFO
),
sel
);
}
/******************************************************************************
* Name : UninstallProgram
* Description: Executes the specified program's installer.
* Parameters : id - the internal ID of the installer to remove
*/
static
void
UninstallProgram
(
int
id
)
{
APPINFO
*
iter
;
STARTUPINFOW
si
;
PROCESS_INFORMATION
info
;
WCHAR
errormsg
[
MAX_STRING_LEN
];
WCHAR
sUninstallFailed
[
MAX_STRING_LEN
];
HKEY
hkey
;
BOOL
res
;
LoadStringW
(
hInst
,
IDS_UNINSTALL_FAILED
,
sUninstallFailed
,
sizeof
(
sUninstallFailed
)
/
sizeof
(
sUninstallFailed
[
0
]));
for
(
iter
=
AppInfo
;
iter
;
iter
=
iter
->
next
)
{
if
(
iter
->
id
==
id
)
{
TRACE
(
"Uninstalling %s (%s)
\n
"
,
wine_dbgstr_w
(
iter
->
title
),
wine_dbgstr_w
(
iter
->
path
));
memset
(
&
si
,
0
,
sizeof
(
STARTUPINFOW
));
si
.
cb
=
sizeof
(
STARTUPINFOW
);
si
.
wShowWindow
=
SW_NORMAL
;
res
=
CreateProcessW
(
NULL
,
iter
->
path
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
info
);
if
(
res
)
{
/* wait for the process to exit */
WaitForSingleObject
(
info
.
hProcess
,
INFINITE
);
}
else
{
wsprintfW
(
errormsg
,
sUninstallFailed
,
iter
->
path
);
if
(
MessageBoxW
(
0
,
errormsg
,
iter
->
title
,
MB_YESNO
|
MB_ICONQUESTION
)
==
IDYES
)
{
/* delete the application's uninstall entry */
RegOpenKeyExW
(
iter
->
regroot
,
PathUninstallW
,
0
,
KEY_READ
,
&
hkey
);
RegDeleteKeyW
(
hkey
,
iter
->
regkey
);
RegCloseKey
(
hkey
);
}
}
break
;
}
}
}
/* Definition of column headers for AddListViewColumns function */
typedef
struct
AppWizColumn
{
int
width
;
...
...
@@ -494,8 +549,10 @@ static HIMAGELIST ResetApplicationList(BOOL bFirstRun, HWND hWnd, HIMAGELIST hIm
*/
static
BOOL
CALLBACK
MainDlgProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
int
selitem
;
static
HIMAGELIST
hImageList
;
LPNMHDR
nmh
;
LVITEMW
lvItem
;
switch
(
msg
)
{
...
...
@@ -531,6 +588,30 @@ static BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar
}
return
TRUE
;
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
))
{
case
IDC_ADDREMOVE
:
selitem
=
SendDlgItemMessageW
(
hWnd
,
IDL_PROGRAMS
,
LVM_GETNEXTITEM
,
-
1
,
LVNI_FOCUSED
|
LVNI_SELECTED
);
if
(
selitem
!=
-
1
)
{
lvItem
.
iItem
=
selitem
;
lvItem
.
mask
=
LVIF_PARAM
;
if
(
SendDlgItemMessageW
(
hWnd
,
IDL_PROGRAMS
,
LVM_GETITEMW
,
0
,
(
LPARAM
)
&
lvItem
))
UninstallProgram
(
lvItem
.
lParam
);
}
hImageList
=
ResetApplicationList
(
FALSE
,
hWnd
,
hImageList
);
break
;
}
return
TRUE
;
}
return
FALSE
;
...
...
dlls/appwiz.cpl/res.h
View file @
eece76b8
...
...
@@ -38,6 +38,7 @@
#define IDS_CPL_TITLE 1
#define IDS_CPL_DESC 2
#define IDS_TAB1_TITLE 3
#define IDS_UNINSTALL_FAILED 4
#define IDS_COLUMN_NAME 6
#define IDS_COLUMN_PUBLISHER 7
#define IDS_COLUMN_VERSION 8
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