Commit a300682f authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Handle quoting on the command line in uninstaller.

parent 9964e429
...@@ -3,7 +3,7 @@ TOPOBJDIR = ../.. ...@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = uninstaller.exe MODULE = uninstaller.exe
APPMODE = gui APPMODE = cui
IMPORTS = user32 gdi32 advapi32 kernel32 IMPORTS = user32 gdi32 advapi32 kernel32
C_SRCS = \ C_SRCS = \
......
...@@ -121,32 +121,42 @@ void RemoveSpecificProgram(char *name) ...@@ -121,32 +121,42 @@ void RemoveSpecificProgram(char *name)
} }
} }
int main( int argc, char *argv[])
int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow )
{ {
MSG msg; MSG msg;
WNDCLASS wc; WNDCLASS wc;
HWND hWnd; HWND hWnd;
LPSTR token = NULL;
int i = 1;
HINSTANCE hInst = NULL;
while( i<argc )
{
token = argv[i++];
/*------------------------------------------------------------------------ /* Handle requests just to list the programs */
** Handle requests just to list the programs if( !lstrcmpA( token, "--list" ) )
**----------------------------------------------------------------------*/
if (cmdline && strlen(cmdline) >= 6 && memcmp(cmdline, "--list", 6) == 0)
{ {
ListUninstallPrograms(); ListUninstallPrograms();
return(0); return 0;
} }
else if( !lstrcmpA( token, "--remove" ) )
/*------------------------------------------------------------------------ {
** Handle requests to remove one program if( i >= argc )
**----------------------------------------------------------------------*/
if (cmdline && strlen(cmdline) > 9 && memcmp(cmdline, "--remove ", 9) == 0)
{ {
RemoveSpecificProgram(cmdline + 9); WINE_ERR( "The remove option requires a parameter.\n");
return(0); return 1;
} }
RemoveSpecificProgram( argv[i++] );
return 0;
}
else
{
WINE_ERR( "unknown option %s\n",token);
return 1;
}
}
LoadString( hInst, IDS_APPNAME, appname, sizeof(appname)); LoadString( hInst, IDS_APPNAME, appname, sizeof(appname));
...@@ -169,7 +179,7 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd ...@@ -169,7 +179,7 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd
if (!hWnd) exit(1); if (!hWnd) exit(1);
ShowWindow( hWnd, cmdshow ); ShowWindow( hWnd, SW_SHOW );
UpdateWindow( hWnd ); UpdateWindow( hWnd );
while( GetMessage(&msg, NULL_HANDLE, 0, 0) ) { while( GetMessage(&msg, NULL_HANDLE, 0, 0) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment