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.

308 lines
10 KiB

  1. @Echo Off
  2. Rem #########################################################################
  3. Rem
  4. Rem Verify that %RootDrive% has been configured and set it for this script.
  5. Rem
  6. Call "%SystemRoot%\Application Compatibility Scripts\ChkRoot.Cmd"
  7. If "%_CHKROOT%" == "FAIL" Goto Done
  8. Call "%SystemRoot%\Application Compatibility Scripts\SetPaths.Cmd"
  9. If "%_SETPATHS%" == "FAIL" Goto Done
  10. Set __SharedTools=Shared Tools
  11. If Not "%PROCESSOR_ARCHITECTURE%"=="ALPHA" goto Start0
  12. If Not Exist "%ProgramFiles(x86)%" goto Start0
  13. Set __SharedTools=Shared Tools (x86)
  14. :Start0
  15. Rem #########################################################################
  16. Rem Set the app VendorName
  17. SET VendorName=Microsoft
  18. Rem #########################################################################
  19. Rem Set the proofing tools path to the one that MS Office 2000 uses
  20. SET ProofingPath=Proof
  21. Rem #########################################################################
  22. Rem Set the registry key and value under which the app stores its install root
  23. SET AppRegKey=HKLM\Software\Microsoft\Office\8.0\Common\InstallRoot
  24. SET AppRegValue=OfficeBin
  25. Rem #########################################################################
  26. Rem Set the registry key and value under which the app stores its templates path
  27. SET AppTemplatesRegKey=HKCU\Software\Microsoft\Office\8.0\Common\FileNew\LocalTemplates
  28. SET AppTemplatesRegValue=
  29. Rem #########################################################################
  30. Rem Set the registry key and value under which the apps store the custom dictionary path and name
  31. SET AppCustomDicRegKey=HKLM\Software\Microsoft\%__SharedTools%\Proofing Tools\Custom Dictionaries
  32. SET AppCustomDicRegValue=1
  33. Rem #########################################################################
  34. Rem Set some specific relative app file names and path names
  35. SET CustomDicFile=Custom.Dic
  36. SET AppPathName=Microsoft Project
  37. SET AppWebPathName=Microsoft Project Web
  38. Rem #########################################################################
  39. Rem Set Default Paths to those used by MS Office 2000
  40. SET AppData=%RootDrive%\%APP_DATA%
  41. SET UserTemplatesPath=%AppData%\%VendorName%\%TEMPLATES%
  42. SET UserCustomDicPath=%AppData%\%VendorName%\%ProofingPath%
  43. Rem #########################################################################
  44. Rem Get the installation location of Project 98 from the registry. If
  45. Rem not found, assume Project isn't installed and display an error message.
  46. Rem
  47. ..\ACRegL %Temp%\Proj98.Cmd PROJINST "%AppRegKey%" "%AppRegValue%" ""
  48. If Not ErrorLevel 1 Goto Cont0
  49. Echo.
  50. Echo Unable to retrieve Project 98 installation location from the registry.
  51. Echo Verify that Project 98 has already been installed and run this script
  52. Echo again.
  53. Echo.
  54. Pause
  55. Goto Done
  56. :Cont0
  57. Call %Temp%\Proj98.Cmd
  58. Del %Temp%\Proj98.Cmd >Nul: 2>&1
  59. ..\ACRegL %Temp%\Proj98.Cmd PROJROOT "%AppRegKey%" "%AppRegValue%" "STRIPCHAR\1"
  60. If Not ErrorLevel 1 Goto Cont01
  61. Echo.
  62. Echo Unable to retrieve Project 98 installation location from the registry.
  63. Echo Verify that Project 98 has already been installed and run this script
  64. Echo again.
  65. Echo.
  66. Pause
  67. Goto Done
  68. :Cont01
  69. Call %Temp%\Proj98.Cmd
  70. Del %Temp%\Proj98.Cmd >Nul: 2>&1
  71. Rem #########################################################################
  72. Rem Get the Templates path name from the registry
  73. Rem
  74. ..\ACRegL %Temp%\Proj98.Cmd TemplatesPathName "%AppTemplatesRegKey%" "%AppTemplatesRegValue%" "STRIPPATH"
  75. If Not ErrorLevel 1 Goto Cont02
  76. SET TemplatesPathName=%TEMPLATES%
  77. Goto Cont03
  78. :Cont02
  79. Call %Temp%\Proj98.Cmd
  80. Del %Temp%\Proj98.Cmd >Nul: 2>&1
  81. :Cont03
  82. Rem #########################################################################
  83. Rem If MS Office 97 is not installed, use default paths
  84. If Not Exist "%RootDrive%\Office97" Goto SetPathNames
  85. Rem #########################################################################
  86. Rem If Office 97 is already installed, use MS Office 97 paths.
  87. Rem #########################################################################
  88. Rem Get the custom dic path name from the registry
  89. Rem
  90. ..\ACRegL %Temp%\Proj98.Cmd AppData "%AppCustomDicRegKey%" "%AppCustomDicRegValue%" "STRIPCHAR\1"
  91. If Not ErrorLevel 1 Goto Cont04
  92. SET AppData=%RootDrive%\Office97
  93. Goto Cont05
  94. :Cont04
  95. Call %Temp%\Proj98.Cmd
  96. Del %Temp%\Proj98.Cmd >Nul: 2>&1
  97. :Cont05
  98. Rem #########################################################################
  99. Rem Get the Templates path name from the registry
  100. Rem
  101. ..\ACRegL %Temp%\Proj98.Cmd UserTemplatesPath "%AppTemplatesRegKey%" "%AppTemplatesRegValue%" ""
  102. If Not ErrorLevel 1 Goto Cont06
  103. SET UserTemplatesPath=%AppData%\%TemplatesPathName%
  104. Goto Cont07
  105. :Cont06
  106. Call %Temp%\Proj98.Cmd
  107. Del %Temp%\Proj98.Cmd >Nul: 2>&1
  108. :Cont07
  109. SET UserCustomDicPath=%AppData%
  110. :SetPathNames
  111. Rem #########################################################################
  112. Rem Set user and common path names here
  113. SET CommonCustomDicPath=%PROJINST%
  114. SET CommonTemplatesPath=%PROJROOT%\%TemplatesPathName%
  115. SET UserCustomDicFileName=%UserCustomDicPath%\%CustomDicFile%
  116. SET UserAppTemplatesPath=%UserTemplatesPath%\%AppPathName%
  117. SET UserAppWebTemplatesPath=%UserTemplatesPath%\%AppWebPAthName%
  118. SET CommonAppTemplatesPath=%CommonTemplatesPath%\%AppPathName%
  119. SET CommonAppWebTemplatesPath=%CommonTemplatesPath%\%AppWebPAthName%
  120. Rem #########################################################################
  121. Rem
  122. Rem If Office 97 is installed the Project 98 install script
  123. Rem moved the templates to the current user's directory.
  124. Rem Put them in a global place. Proj98Usr.cmd will move them back.
  125. Rem
  126. If NOT Exist "%UserAppTemplatesPath%" goto skip10
  127. If Exist "%CommonAppTemplatesPath%" goto skip10
  128. xcopy "%UserAppTemplatesPath%" "%CommonAppTemplatesPath%" /E /I /K > Nul: 2>&1
  129. :skip10
  130. If NOT Exist "%UserAppWebTemplatesPath%" goto skip11
  131. If Exist "%CommonAppWebTemplatesPath%" goto skip11
  132. xcopy "%UserAppWebTemplatesPath%" "%CommonAppWebTemplatesPath%" /E /I /K > Nul: 2>&1
  133. :skip11
  134. Rem #########################################################################
  135. Rem
  136. Rem Make Global.mpt file read-only.
  137. Rem Otherwise the first user to launch Project will change the ACLs
  138. Rem
  139. if Exist "%PROJINST%\Global.mpt" attrib +r "%PROJINST%\Global.mpt"
  140. Rem #########################################################################
  141. Rem
  142. Rem Allow read access for everybody on a system DLL that is
  143. Rem updated by Office 97.
  144. Rem
  145. If Exist %SystemRoot%\System32\OleAut32.Dll cacls %SystemRoot%\System32\OleAut32.Dll /E /T /G "Authenticated Users":R > NUL: 2>&1
  146. Rem #########################################################################
  147. Rem
  148. Rem Create the MsForms.Twd file which is needed for
  149. Rem Powerpoint and Excel Add-ins (File/Save as HTML, etc). When either
  150. Rem program is run, they will replace the appropriate file with one
  151. Rem containing the necessary data.
  152. Rem
  153. If Exist %systemroot%\system32\MsForms.Twd Goto Cont2
  154. Copy Nul: %systemroot%\system32\MsForms.Twd >Nul:
  155. Cacls %systemroot%\system32\MsForms.Twd /E /P "Authenticated Users":F > Nul: 2>&1
  156. :Cont2
  157. Rem #########################################################################
  158. Rem
  159. Rem Remove Find Fast from the Startup menu for all users.
  160. Rem Find Fast is resource intensive and will impact system
  161. Rem performance.
  162. Rem
  163. If Exist "%COMMON_STARTUP%\Microsoft Find Fast.lnk" Del "%COMMON_STARTUP%\Microsoft Find Fast.lnk"
  164. Rem #########################################################################
  165. Rem
  166. Rem Change Registry Keys to make paths point to user specific
  167. Rem directories.
  168. Rem
  169. Rem If not currently in Install Mode, change to Install Mode.
  170. Set __OrigMode=Install
  171. ChgUsr /query > Nul:
  172. if Not ErrorLevel 101 Goto Begin
  173. Set __OrigMode=Exec
  174. Change User /Install > Nul:
  175. :Begin
  176. ..\acsr "#ROOTDRIVE#" "%RootDrive%" Template\msproj98.Key msproj98.tm1
  177. ..\acsr "#__SharedTools#" "%__SharedTools%" msproj98.tm1 msproj98.tm2
  178. Del msproj98.tm1 >Nul: 2>&1
  179. ..\acsr "#USERCUSTOMDICFILE#" "%UserCustomDicFileName%" msproj98.tm2 msproj98.Key
  180. Del msproj98.tm2 >Nul: 2>&1
  181. regini msproj98.key > Nul:
  182. Rem If original mode was execute, change back to Execute Mode.
  183. If "%__OrigMode%" == "Exec" Change User /Execute > Nul:
  184. Set __OrigMode=
  185. Rem #########################################################################
  186. Rem
  187. Rem Update proj97Usr.Cmd to reflect actual directories and
  188. Rem add it to the UsrLogn2.Cmd script
  189. Rem
  190. ..\acsr "#USERTEMPLATESPATH#" "%UserTemplatesPath%" ..\Logon\Template\prj98Usr.Cmd prj98Usr.tm1
  191. ..\acsr "#USERCUSTOMDICPATH#" "%UserCustomDicPath%" prj98Usr.tm1 prj98Usr.tm2
  192. Del prj98Usr.tm1 >Nul: 2>&1
  193. ..\acsr "#COMMONTEMPLATESPATH#" "%CommonTemplatesPath%" prj98Usr.tm2 prj98Usr.tm1
  194. Del prj98Usr.tm2 >Nul: 2>&1
  195. ..\acsr "#COMMONCUSTOMDICPATH#" "%CommonCustomDicPath%" prj98Usr.tm1 prj98Usr.tm2
  196. Del prj98Usr.tm1 >Nul: 2>&1
  197. ..\acsr "#CUSTOMDICNAME#" "%CustomDicFile%" prj98Usr.tm2 prj98Usr.tm1
  198. Del prj98Usr.tm2 >Nul: 2>&1
  199. ..\acsr "#APPPATHNAME#" "%AppPathName%" prj98Usr.tm1 prj98Usr.tm2
  200. Del prj98Usr.tm1 >Nul: 2>&1
  201. ..\acsr "#APPWEBPATHNAME#" "%AppWebPathName%" prj98Usr.tm2 ..\Logon\prj98Usr.Cmd
  202. Del prj98Usr.tm2 >Nul: 2>&1
  203. FindStr /I prj98Usr %SystemRoot%\System32\UsrLogn2.Cmd >Nul: 2>&1
  204. If Not ErrorLevel 1 Goto Skip1
  205. Echo Call prj98Usr.Cmd >> %SystemRoot%\System32\UsrLogn2.Cmd
  206. :Skip1
  207. Rem #########################################################################
  208. Echo.
  209. Echo To insure proper operation of Project 98, users who are
  210. Echo currently logged on must log off and log on again before
  211. Echo running any application.
  212. Echo.
  213. Echo Microsoft Project 98 Multi-user Application Tuning Complete
  214. Rem
  215. Rem Get the permission compatibility mode from the registry.
  216. Rem If TSUserEnabled is 0 we need to warn user to change mode.
  217. Rem
  218. ..\ACRegL "%Temp%\tsuser.Cmd" TSUSERENABLED "HKLM\System\CurrentControlSet\Control\Terminal Server" "TSUserEnabled" ""
  219. If Exist "%Temp%\tsuser.Cmd" (
  220. Call "%Temp%\tsuser.Cmd"
  221. Del "%Temp%\tsuser.Cmd" >Nul: 2>&1
  222. )
  223. If NOT %TSUSERENABLED%==0 goto SkipWarning
  224. Echo.
  225. Echo IMPORTANT!
  226. Echo Terminal Server is currently running in Default Security mode.
  227. Echo This application requires the system to run in Relaxed Security mode
  228. Echo (permissions compatible with Terminal Server 4.0).
  229. Echo Use Terminal Services Configuration to view and change the Terminal
  230. Echo Server security mode.
  231. Echo.
  232. :SkipWarning
  233. Pause
  234. :done