Leaked source code of windows server 2003
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.

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