changeset 12098:73ee9bd3b537

Error message improved, wording.
author diego
date Thu, 01 Apr 2004 22:48:37 +0000
parents cb0cdaa0bddf
children 8dedd440c31c
files libdha/dhahelperwin/dhasetup.c
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libdha/dhahelperwin/dhasetup.c	Thu Apr 01 22:11:28 2004 +0000
+++ b/libdha/dhahelperwin/dhasetup.c	Thu Apr 01 22:48:37 2004 +0000
@@ -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 @@
   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 @@
   }
   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 @@
   }
   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;
 }