Error message improved, wording.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12099 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2004-04-01 22:48:37 +00:00
parent 0a60a8fd25
commit 27e0e8a759
1 changed files with 13 additions and 12 deletions

View File

@ -1,6 +1,6 @@
/*dhahelper setup program (c) 2004 Sascha Sommer*/
/*compile with gcc -o dhasetup.exe dhasetup.c */
/*LICENSE: GPL */
/* dhahelper setup program (c) 2004 Sascha Sommer */
/* compile with gcc -o dhasetup.exe dhasetup.c */
/* LICENSE: GPL */
#include <windows.h>
#include <stdio.h>
@ -10,19 +10,20 @@ int main(int argc,char* argv[]){
SC_HANDLE hService;
char path[MAX_PATH];
printf("dhasetup (c) 2004 Sascha Sommer\n");
GetWindowsDirectory(path,MAX_PATH);
strcpy(path+strlen(path),"\\system32\\drivers\\dhahelper.sys");
if(argc==1){
printf("usage:\n");
printf("dhasetup install - copys dhahelper.sys from the current dir to windows/system32/drivers and configures it to start at system start\n");
printf("dhasetup remove - removes the dhahelper util\n");
printf("Usage:\n");
printf("dhasetup install - Copies dhahelper.sys from the current directory to\n%s and configures it to start at boot.\n", path);
printf("dhasetup remove - Removes the dhahelper utility.\n");
return 0;
}
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
GetWindowsDirectory(path,MAX_PATH);
strcpy(path+strlen(path),"\\system32\\drivers\\dhahelper.sys");
if(!strcmp(argv[1],"install")){
printf("installing dhahelper\n");
printf("Installing dhahelper...\n");
if(!CopyFile("dhahelper.sys",path,FALSE))
printf("can't find dhahelper.sys\n");
printf("Copying dhahelper.sys failed.\nEither dhahelper.sys is not in the current directory or you lack sufficient\nprivileges to write to %s.", path);
return 1;
// Install the driver
hService = CreateService(hSCManager,
"DHAHELPER",
@ -40,7 +41,7 @@ int main(int argc,char* argv[]){
}
else if(!strcmp(argv[1],"remove")){
SERVICE_STATUS ServiceStatus;
printf("removing dhahelper\n");
printf("Removing dhahelper...\n");
hService = OpenService(hSCManager, "DHAHELPER", SERVICE_ALL_ACCESS);
ControlService(hService, SERVICE_CONTROL_STOP, &ServiceStatus);
DeleteService(hService);
@ -51,6 +52,6 @@ int main(int argc,char* argv[]){
}
CloseServiceHandle(hService);
CloseServiceHandle(hSCManager);
printf("please reboot to let the changes take effect\n");
printf("Please reboot to let the changes take effect.\n");
return 0;
}