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.

219 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. office.c
  5. Abstract:
  6. This source file implements the operations needed to properly migrate
  7. Office settings from Windows 9x to Windows NT. This is part of the
  8. Setup Migration DLL.
  9. Author:
  10. Jim Schmidt (jimschm) 07-Apr-1999
  11. Revision History:
  12. --*/
  13. #include "pch.h"
  14. #define S_WINWORD6_INI "WINWORD6.INI"
  15. #define S_WORD6_INI "WORD6.INI"
  16. #define S_EXCEL5_INI "EXCEL5.INI"
  17. #define S_WINWORD6_SECTION "Microsoft Word"
  18. #define S_EXCEL5_SECTION "Microsoft Excel"
  19. #define S_WINWORD6_KEY "CBT-PATH"
  20. #define S_EXCEL5_KEY "CBTLOCATION"
  21. #define S_NO_CBT "<<NOCBT>>"
  22. BOOL
  23. Office_Attach (
  24. IN HINSTANCE DllInstance
  25. )
  26. {
  27. return TRUE;
  28. }
  29. BOOL
  30. Office_Detach (
  31. IN HINSTANCE DllInstance
  32. )
  33. {
  34. return TRUE;
  35. }
  36. LONG
  37. Office_QueryVersion (
  38. IN PCSTR *ExeNamesBuf
  39. )
  40. {
  41. CHAR Path[MAX_PATH];
  42. PSTR p;
  43. if (GetWindowsDirectoryA (Path, MAX_PATH)) {
  44. p = AppendWackA (Path);
  45. StringCopyA (p, S_WINWORD6_INI);
  46. if (DoesFileExistA (Path)) {
  47. return ERROR_SUCCESS;
  48. }
  49. StringCopyA (p, S_WORD6_INI);
  50. if (DoesFileExistA (Path)) {
  51. return ERROR_SUCCESS;
  52. }
  53. StringCopyA (p, S_EXCEL5_INI);
  54. if (DoesFileExistA (Path)) {
  55. return ERROR_SUCCESS;
  56. }
  57. }
  58. return ERROR_NOT_INSTALLED;
  59. }
  60. LONG
  61. Office_Initialize9x (
  62. IN PCSTR WorkingDirectory,
  63. IN PCSTR SourceDirectories
  64. )
  65. {
  66. return ERROR_SUCCESS;
  67. }
  68. LONG
  69. Office_MigrateUser9x (
  70. IN HWND ParentWnd,
  71. IN PCSTR UnattendFile,
  72. IN HKEY UserRegKey,
  73. IN PCSTR UserName
  74. )
  75. {
  76. return ERROR_SUCCESS;
  77. }
  78. LONG
  79. Office_MigrateSystem9x (
  80. IN HWND ParentWnd,
  81. IN PCSTR UnattendFile
  82. )
  83. {
  84. PCSTR Msg;
  85. PCSTR Group;
  86. CHAR Path[MAX_PATH];
  87. PSTR p;
  88. //
  89. // Write a message to the report
  90. //
  91. Group = GetStringResource (MSG_PROGRAM_NOTES);
  92. Msg = GetStringResource (MSG_OFFICE_MESSAGE);
  93. WritePrivateProfileStringA (
  94. S_INCOMPATIBLE_MSGS,
  95. Group,
  96. Msg,
  97. g_MigrateInfPath
  98. );
  99. if (!GetWindowsDirectoryA (Path, MAX_PATH)) {
  100. return GetLastError ();
  101. }
  102. p = AppendWackA (Path);
  103. StringCopyA (p, S_WINWORD6_INI);
  104. if (DoesFileExistA (Path)) {
  105. WritePrivateProfileStringA (
  106. Group,
  107. Path,
  108. "FILE",
  109. g_MigrateInfPath
  110. );
  111. }
  112. StringCopyA (p, S_WORD6_INI);
  113. if (DoesFileExistA (Path)) {
  114. WritePrivateProfileStringA (
  115. Group,
  116. Path,
  117. "FILE",
  118. g_MigrateInfPath
  119. );
  120. }
  121. StringCopyA (p, S_EXCEL5_INI);
  122. if (DoesFileExistA (Path)) {
  123. WritePrivateProfileStringA (
  124. Group,
  125. Path,
  126. "FILE",
  127. g_MigrateInfPath
  128. );
  129. }
  130. FreeStringResource (Msg);
  131. FreeStringResource (Group);
  132. return ERROR_SUCCESS;
  133. }
  134. LONG
  135. Office_InitializeNT (
  136. IN PCWSTR WorkingDirectory,
  137. IN PCWSTR SourceDirectories
  138. )
  139. {
  140. return ERROR_SUCCESS;
  141. }
  142. LONG
  143. Office_MigrateUserNT (
  144. IN HINF UnattendFile,
  145. IN HKEY UserRegKey,
  146. IN PCWSTR UserName
  147. )
  148. {
  149. return ERROR_SUCCESS;
  150. }
  151. LONG
  152. Office_MigrateSystemNT (
  153. IN HINF UnattendFile
  154. )
  155. {
  156. CHAR Path[MAX_PATH];
  157. PSTR p;
  158. if (!GetWindowsDirectoryA (Path, MAX_PATH)) {
  159. return GetLastError ();
  160. }
  161. p = AppendWackA (Path);
  162. StringCopyA (p, S_WORD6_INI);
  163. if (DoesFileExistA (Path)) {
  164. WritePrivateProfileStringA (S_WINWORD6_SECTION, S_WINWORD6_KEY, S_NO_CBT, Path);
  165. }
  166. StringCopyA (p, S_WINWORD6_INI);
  167. if (DoesFileExistA (Path)) {
  168. WritePrivateProfileStringA (S_WINWORD6_SECTION, S_WINWORD6_KEY, S_NO_CBT, Path);
  169. }
  170. StringCopyA (p, S_EXCEL5_INI);
  171. if (DoesFileExistA (Path)) {
  172. WritePrivateProfileStringA (S_EXCEL5_SECTION, S_EXCEL5_KEY, S_NO_CBT, Path);
  173. }
  174. return ERROR_SUCCESS;
  175. }