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.

513 lines
10 KiB

  1. //depot/Lab04_N/Termsrv/admtools/appcmpt/install/office97.cmd#3 - edit change 220 (text)
  2. @Echo Off
  3. Rem
  4. Rem NOTE: The CACLS commands in this script are only effective
  5. Rem on NTFS formatted partitions.
  6. Rem
  7. Rem #########################################################################
  8. Rem #########################################################################
  9. Rem
  10. Rem Verify that %RootDrive% has been configured and set it for this script.
  11. Rem
  12. Call "%SystemRoot%\Application Compatibility Scripts\ChkRoot.Cmd"
  13. If "%_CHKROOT%" == "FAIL" Goto Done
  14. Call "%SystemRoot%\Application Compatibility Scripts\SetPaths.Cmd"
  15. If "%_SETPATHS%" == "FAIL" Goto Done
  16. Rem #########################################################################
  17. Rem
  18. Rem copy files from the current user templates to the all users templates location
  19. Rem
  20. If Not Exist "%ALLUSERSPROFILE%\%TEMPLATES%\WINWORD8.DOC" copy "%UserProfile%\%TEMPLATES%\WINWORD8.DOC" "%ALLUSERSPROFILE%\%TEMPLATES%\" /Y >Nul: 2>&1
  21. If Not Exist "%ALLUSERSPROFILE%\%TEMPLATES%\EXCEL8.XLS" copy "%UserProfile%\%TEMPLATES%\EXCEL8.XLS" "%ALLUSERSPROFILE%\%TEMPLATES%\" /Y >Nul: 2>&1
  22. If Not Exist "%ALLUSERSPROFILE%\%TEMPLATES%\BINDER.OBD" copy "%UserProfile%\%TEMPLATES%\BINDER.OBD" "%ALLUSERSPROFILE%\%TEMPLATES%\" /Y >Nul: 2>&1
  23. Rem
  24. Rem Get the installation location of Office 97 from the registry. If
  25. Rem not found, assume Office isn't installed and display an error message.
  26. Rem
  27. ..\ACRegL %Temp%\O97.Cmd O97INST "HKLM\Software\Microsoft\Office\8.0\Common\InstallRoot" "" ""
  28. If Not ErrorLevel 1 Goto Cont0
  29. Echo.
  30. Echo Unable to retrieve Office 97 installation location from the registry.
  31. Echo Verify that Office 97 has already been installed and run this script
  32. Echo again.
  33. Echo.
  34. Pause
  35. Goto Done
  36. :Cont0
  37. Call %Temp%\O97.Cmd
  38. Del %Temp%\O97.Cmd >Nul: 2>&1
  39. Rem #########################################################################
  40. Rem
  41. Rem Change the Access 97 System Database to Read only. This lets
  42. Rem multiple people run the database simultaneously. However, it
  43. Rem disables the ability to update the System Database, which is
  44. Rem normally done through the Tools/Security menu option. If you
  45. Rem need to add users, first you must put write access back on the
  46. Rem system database.
  47. Rem
  48. #ifdef JAPAN
  49. If "%PROCESSOR_ARCHITECTURE%" == "ALPHA" Goto DoAlpha
  50. If Not Exist %SystemRoot%\System32\System.Mdw Goto Cont1
  51. cacls %SystemRoot%\System32\System.Mdw /E /P "Authenticated Users":R >NUL: 2>&1
  52. cacls %SystemRoot%\System32\System.Mdw /E /P "Power Users":R >NUL: 2>&1
  53. cacls %SystemRoot%\System32\System.Mdw /E /P Administrators:R >NUL: 2>&1
  54. Goto Cont1
  55. :DoAlpha
  56. If Not Exist %SystemRoot%\Sys32x86\System.Mdw Goto Cont1
  57. cacls %SystemRoot%\Sys32x86\System.Mdw /E /P "Authenticated Users":R >NUL: 2>&1
  58. cacls %SystemRoot%\Sys32x86\System.Mdw /E /P "Power Users":R >NUL: 2>&1
  59. cacls %SystemRoot%\Sys32x86\System.Mdw /E /P Administrators:R >NUL: 2>&1
  60. #else
  61. If Not Exist %SystemRoot%\System32\System.Mdw Goto Cont1
  62. cacls %SystemRoot%\System32\System.Mdw /E /P "Authenticated Users":R >NUL: 2>&1
  63. cacls %SystemRoot%\System32\System.Mdw /E /P "Power Users":R >NUL: 2>&1
  64. cacls %SystemRoot%\System32\System.Mdw /E /P Administrators:R >NUL: 2>&1
  65. #endif
  66. :Cont1
  67. Rem #########################################################################
  68. Rem
  69. Rem Allow change access for TS Users on the frmcache.dat file for outlook
  70. Rem
  71. If Exist %SystemRoot%\Forms\frmcache.dat cacls %SystemRoot%\forms\frmcache.dat /E /G "Terminal Server User":C >NUL: 2>&1
  72. Rem #########################################################################
  73. Rem
  74. Rem Change Powerpoint Wizards to Read Only to allow more than one
  75. Rem simultaneous invocation of the Wizard.
  76. Rem
  77. #ifdef JAPAN
  78. If Exist "%O97INST%\Template\Presentations\AutoContent Wizard.Pwz" Attrib +R "%O97INST%\Template\Presentations\AutoContent Wizard.Pwz" >Nul: 2>&1
  79. #else
  80. If Exist "%O97INST%\Templates\Presentations\AutoContent Wizard.Pwz" Attrib +R "%O97INST%\Templates\Presentations\AutoContent Wizard.Pwz" >Nul: 2>&1
  81. #endif
  82. If Exist "%O97INST%\Office\Ppt2html.ppa" Attrib +R "%O97INST%\Office\Ppt2html.ppa" >Nul: 2>&1
  83. If Exist "%O97INST%\Office\bshppt97.ppa" Attrib +R "%O97INST%\Office\bshppt97.ppa" >Nul: 2>&1
  84. If Exist "%O97INST%\Office\geniwiz.ppa" Attrib +R "%O97INST%\Office\geniwiz.ppa" >Nul: 2>&1
  85. If Exist "%O97INST%\Office\ppttools.ppa" Attrib +R "%O97INST%\Office\ppttools.ppa" >Nul: 2>&1
  86. If Exist "%O97INST%\Office\graphdrs.ppa" Attrib +R "%O97INST%\Office\graphdrs.ppa" >Nul: 2>&1
  87. Rem #########################################################################
  88. Rem
  89. Rem If you want non-admin users to be able to run the Access Wizards or Access
  90. Rem Add-Ins in Excel, you need to remove the "Rem" from the 3 following lines to
  91. Rem give users change access to the wizard files.
  92. Rem
  93. Rem
  94. Rem If Exist "%O97INST%\Office\WZLIB80.MDE" cacls "%O97INST%\Office\WZLIB80.MDE" /E /P "Authenticated Users":C >NUL: 2>&1
  95. Rem If Exist "%O97INST%\Office\WZMAIN80.MDE" cacls "%O97INST%\Office\WZMAIN80.MDE" /E /P "Authenticated Users":C >NUL: 2>&1
  96. Rem If Exist "%O97INST%\Office\WZTOOL80.MDE" cacls "%O97INST%\Office\WZTOOL80.MDE" /E /P "Authenticated Users":C >NUL: 2>&1
  97. Rem #########################################################################
  98. Rem
  99. Rem Create the MsForms.Twd and RefEdit.Twd files, which are needed for
  100. Rem Powerpoint and Excel Add-ins (File/Save as HTML, etc). When either
  101. Rem program is run, they will replace the appropriate file with one
  102. Rem containing the necessary data.
  103. Rem
  104. If Exist %systemroot%\system32\MsForms.Twd Goto Cont2
  105. Copy Nul: %systemroot%\system32\MsForms.Twd >Nul: 2>&1
  106. Cacls %systemroot%\system32\MsForms.Twd /E /P "Authenticated Users":F >Nul: 2>&1
  107. :Cont2
  108. If Exist %systemroot%\system32\RefEdit.Twd Goto Cont3
  109. Copy Nul: %systemroot%\system32\RefEdit.Twd >Nul: 2>&1
  110. Cacls %systemroot%\system32\RefEdit.Twd /E /P "Authenticated Users":F >Nul: 2>&1
  111. :Cont3
  112. Rem #########################################################################
  113. Rem
  114. Rem Create a msremote.sfs directory under SystemRoot. This allows users to
  115. Rem use the "Mail and Fax" icon in the control panel to create a profile.
  116. Rem
  117. md %systemroot%\msremote.sfs > Nul: 2>&1
  118. Rem #########################################################################
  119. Rem
  120. Rem Remove Find Fast from the Startup menu for all users.
  121. Rem Find Fast is resource intensive and will impact system
  122. Rem performance.
  123. Rem
  124. If Exist "%COMMON_STARTUP%\Microsoft Find Fast.lnk" Del "%COMMON_STARTUP%\Microsoft Find Fast.lnk" >Nul: 2>&1
  125. Rem #########################################################################
  126. Rem
  127. Rem Remove "Microsoft Office Shortcut Bar.lnk" file from the Startup menu for all users.
  128. Rem
  129. If Exist "%COMMON_STARTUP%\Microsoft Office Shortcut Bar.lnk" Del "%COMMON_STARTUP%\Microsoft Office Shortcut Bar.lnk" >Nul: 2>&1
  130. Rem #########################################################################
  131. Rem
  132. Rem Create a msfslog.txt file under SystemRoot and give the Terminal Server users
  133. Rem full permissions on this file.
  134. Rem
  135. If Exist %systemroot%\MSFSLOG.TXT Goto MsfsACLS
  136. Copy Nul: %systemroot%\MSFSLOG.TXT >Nul: 2>&1
  137. :MsfsACLS
  138. Cacls %systemroot%\MSFSLOG.TXT /E /P "Terminal Server User":F >Nul: 2>&1
  139. Rem #########################################################################
  140. Rem
  141. Rem Change Registry Keys to make paths point to user specific
  142. Rem directories.
  143. Rem
  144. Rem If not currently in Install Mode, change to Install Mode.
  145. Set __OrigMode=Install
  146. ChgUsr /query > Nul:
  147. if Not ErrorLevel 101 Goto Begin
  148. Set __OrigMode=Exec
  149. Change User /Install > Nul:
  150. :Begin
  151. Set __SharedTools=Shared Tools
  152. If Not "%PROCESSOR_ARCHITECTURE%"=="ALPHA" goto acsrCont1
  153. If Not Exist "%ProgramFiles(x86)%" goto acsrCont1
  154. Set __SharedTools=Shared Tools (x86)
  155. :acsrCont1
  156. ..\acsr "#ROOTDRIVE#" "%RootDrive%" Template\Office97.Key Office97.Tmp
  157. ..\acsr "#__SharedTools#" "%__SharedTools%" Office97.Tmp Office97.Tmp2
  158. ..\acsr "#INSTDIR#" "%O97INST%" Office97.Tmp2 Office97.Tmp3
  159. ..\acsr "#MY_DOCUMENTS#" "%MY_DOCUMENTS%" Office97.Tmp3 Office97.Key
  160. Del Office97.Tmp >Nul: 2>&1
  161. Del Office97.Tmp2 >Nul: 2>&1
  162. Del Office97.Tmp3 >Nul: 2>&1
  163. regini Office97.key > Nul:
  164. ..\acsr "#ROOTDRIVE#" "%RootDrive%" Template\ODBC.Key ODBC.Key
  165. regini ODBC.Key > Nul:
  166. Rem If original mode was execute, change back to Execute Mode.
  167. If "%__OrigMode%" == "Exec" Change User /Execute > Nul:
  168. Set __OrigMode=
  169. Rem #########################################################################
  170. Rem
  171. Rem Update Ofc97Usr.Cmd to reflect actual installation directory and
  172. Rem add it to the UsrLogn2.Cmd script
  173. Rem
  174. ..\acsr "#INSTDIR#" "%O97INST%" ..\Logon\Template\Ofc97Usr.Cmd ..\Logon\Ofc97Usr.Cmd
  175. FindStr /I Ofc97Usr %SystemRoot%\System32\UsrLogn2.Cmd >Nul: 2>&1
  176. If Not ErrorLevel 1 Goto Skip1
  177. Echo Call Ofc97Usr.Cmd >> %SystemRoot%\System32\UsrLogn2.Cmd
  178. :Skip1
  179. Echo.
  180. Echo To insure proper operation of Office 97, users who are
  181. Echo currently logged on must log off and log on again before
  182. Echo running any Office 97 application.
  183. Echo.
  184. Echo Microsoft Office 97 Multi-user Application Tuning Complete
  185. Rem
  186. Rem Get the permission compatibility mode from the registry.
  187. Rem If TSUserEnabled is 0 we need to warn user to change mode.
  188. Rem
  189. ..\ACRegL "%Temp%\tsuser.Cmd" TSUSERENABLED "HKLM\System\CurrentControlSet\Control\Terminal Server" "TSUserEnabled" ""
  190. If Exist "%Temp%\tsuser.Cmd" (
  191. Call "%Temp%\tsuser.Cmd"
  192. Del "%Temp%\tsuser.Cmd" >Nul: 2>&1
  193. )
  194. If NOT %TSUSERENABLED%==0 goto SkipWarning
  195. Echo.
  196. Echo IMPORTANT!
  197. Echo Terminal Server is currently running in Default Security mode.
  198. Echo This application requires the system to run in Relaxed Security mode
  199. Echo (permissions compatible with Terminal Server 4.0).
  200. Echo Use Terminal Services Configuration to view and change the Terminal
  201. Echo Server security mode.
  202. Echo.
  203. :SkipWarning
  204. Pause
  205. :done