Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.2 KiB

  1. #include "windows.h"
  2. __cdecl main(int argc, char **argv)
  3. {
  4. char szSystemPath[_MAX_PATH];
  5. char szFilename[_MAX_PATH];
  6. char szCurPath[_MAX_PATH];
  7. int len;
  8. UINT dwFilename = _MAX_PATH;
  9. DWORD dwstatus;
  10. if (GetSystemDirectory(szSystemPath, _MAX_PATH) == 0)
  11. {
  12. return (dwstatus = GetLastError());
  13. }
  14. //Get the path to the install source directory
  15. if ((len = GetModuleFileName(NULL, szCurPath, _MAX_PATH)) == 0)
  16. {
  17. return (dwstatus =GetLastError());
  18. }
  19. while (szCurPath[--len] != '\\')
  20. continue;
  21. szCurPath[len+1] = '\0';
  22. // install the file to the system directory
  23. dwstatus = VerInstallFile(0,"DFLAYOUT.DLL", "DFLAYOUT.DLL",
  24. szCurPath, szSystemPath, szSystemPath,
  25. szFilename, &dwFilename);
  26. if (dwstatus)
  27. {
  28. return dwstatus;
  29. }
  30. // install the file to the system directory
  31. dwFilename = _MAX_PATH;
  32. dwstatus = VerInstallFile(0,"DFLAYOUT.EXE", "DFLAYOUT.EXE",
  33. szCurPath, szSystemPath, szSystemPath,
  34. szFilename, &dwFilename);
  35. return dwstatus;
  36. }