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.

217 lines
6.0 KiB

  1. @Echo Off
  2. Rem
  3. Rem NOTE: The CACLS commands in this script are only effective
  4. Rem on NTFS formatted partitions.
  5. Rem
  6. Rem #########################################################################
  7. Rem
  8. Rem Verify that %RootDrive% has been configured and set it for this script.
  9. Rem
  10. Call "%SystemRoot%\Application Compatibility Scripts\ChkRoot.Cmd"
  11. If "%_CHKROOT%" == "FAIL" Goto Done
  12. Call "%SystemRoot%\Application Compatibility Scripts\SetPaths.Cmd"
  13. If "%_SETPATHS%" == "FAIL" Goto Done
  14. Rem #########################################################################
  15. Rem #########################################################################
  16. Rem
  17. Rem Delete Corel Office 7 directory from user's profile.
  18. Rem First, force the user back to execute mode to guarantee the folder
  19. Rem us copied to the All Users Profile.
  20. Rem
  21. Rem If not currently in Execute Mode, change to Install Mode.
  22. ChgUsr /query > Nul:
  23. if ErrorLevel 101 Goto Begin1
  24. Set __OrigMode=Install
  25. Change User /Execute > Nul:
  26. :Begin1
  27. Rem Effectively remove the directory
  28. Rmdir "%USER_START_MENU%\Corel Office 7" /Q >Nul: 2>&1
  29. Rem If original mode was install, change back to Install Mode.
  30. If "%__OrigMode%" == "Install" Change User /Install > Nul:
  31. Set __OrigMode=
  32. Rem #########################################################################
  33. Rem
  34. Rem Modify logon script to copy iBase database from install location.
  35. Rem
  36. ..\ACRegL %Temp%\COffice7.Cmd COffice7Loc "HKLM\Software\PerfectOffice\Products\InfoCentral\7" "ExeLocation" "StripChar\2"
  37. If ErrorLevel 1 Goto InstallError
  38. Call %Temp%\COffice7.Cmd
  39. Del %Temp%\COffice7.Cmd >Nul: 2>&1
  40. ..\ACIniUpd /e "%COffice7Loc%\ICWin7\Local\Wpic.ini" Preferences Last_IBase "%RootDrive%\%MY_DOCUMENTS%\iBases\Personal\Personal"
  41. If ErrorLevel 1 Goto InstallError
  42. ..\acsr "#COFFICE7INST#" "%COffice7Loc%\\" ..\Logon\Template\cofc7usr.Cmd ..\Logon\cofc7usr.Cmd
  43. If ErrorLevel 1 Goto InstallError
  44. goto PostInstallError
  45. :InstallError
  46. Echo.
  47. Echo Unable to retrieve Corel Office 7 installation location from the registry.
  48. Echo Verify that Corel Office 7 has already been installed and run this script
  49. Echo again.
  50. Echo.
  51. Pause
  52. Goto Done
  53. :PostInstallError
  54. Rem #########################################################################
  55. Rem
  56. Rem Change WordPerfect templates to read-only.
  57. Rem This will force users to copy before changing.
  58. Rem An alternative approach would be to give each
  59. Rem user a private template directory.
  60. Rem
  61. attrib +r %COffice7Loc%\Template\*wpt /s >Nul: 2>&1
  62. Rem If not currently in Install Mode, change to Install Mode.
  63. Set __OrigMode=Install
  64. ChgUsr /query > Nul:
  65. if Not ErrorLevel 101 Goto Begin2
  66. Set __OrigMode=Exec
  67. Change User /Install > Nul:
  68. :Begin2
  69. Rem ##############################################################
  70. Rem
  71. Rem Set QuattroPro's Working Dir to %RootDrive%\My Documents
  72. Rem
  73. Rem ##############################################################
  74. Rem Nota: References to 'Personal' directory have been removed.
  75. Rem This folder was TS4's My Documents
  76. Rem Nota (2) : These lines replace the manual step needed to set Quattro Pro's working directory
  77. ..\ACIniUpd /e "QPW.INI" "Quattro Pro for Windows 7" "FileOptions" "%RootDrive%\%MY_DOCUMENTS%,Quattro.wb3,wb3,No,20,Yes,Yes,Yes,%COffice7Loc%\Template,20"
  78. ..\acsr "#ROOTDRIVE#" "%RootDrive%" Template\Coffice7.key Coffice7.Tmp
  79. Rem Great Deal of Fun here
  80. Rem Corel uses some paths coded in binary form in the registry
  81. Rem So to change one of them here, we have to code it binary
  82. Rem The problem is that we have to change %RootDrive% letter to an hex value
  83. Rem and put it in the .key file
  84. Set HEXVAL=77
  85. If "%RootDrive%" == "W:" Goto MissedIt
  86. Rem RootDrive is not W:, we have to work then.
  87. set CPT=0
  88. set RootNum=0
  89. Rem a loop that counts iterations and stops when we have the RootDrive letter
  90. for %%i IN (A: B: C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) DO (set /A CPT=CPT+1 & if %RootDrive% == %%i goto SetIt)
  91. Goto InstallError
  92. :SetIt
  93. Rem We got the letter
  94. Rem It is the RootNum-th letter after 'A'
  95. set /A RootNum=%CPT%-1
  96. Rem Set its ASCII value in CPT. 0x61 is 'A'
  97. Set /A CPT = 0x61 + %RootNum%
  98. Rem Turn this decimal value to hex
  99. Set /A HEXVAL= (%CPT% / 16)*10 + (%CPT% - (%CPT% / 16) *16 )
  100. Set RootNum=
  101. Set CPT=
  102. :MissedIt
  103. Rem We just have to put this value in the .key
  104. ..\acsr "#HEXROOT#" "%HexVal%" Coffice7.Tmp Coffice7.key
  105. regini COffice7.key > Nul:
  106. Set HEXVAL=
  107. Del COffice7.Tmp >Nul: 2>&1
  108. Rem If original mode was execute, change back to Execute Mode.
  109. If "%__OrigMode%" == "Exec" Change User /Execute > Nul:
  110. Set __OrigMode=
  111. Rem ########################################################################
  112. Rem
  113. Rem Add COfc7Usr.Cmd to the UsrLogn2.Cmd script
  114. Rem
  115. FindStr /I COfc7Usr %SystemRoot%\System32\UsrLogn2.Cmd >Nul: 2>&1
  116. If Not ErrorLevel 1 Goto Skip1
  117. Echo Call COfc7Usr.Cmd >> %SystemRoot%\System32\UsrLogn2.Cmd
  118. :Skip1
  119. Echo.
  120. Echo To insure proper operation of Corel Office 7, users who are
  121. Echo currently logged on must log off and log on again before
  122. Echo running any application.
  123. Echo.
  124. Echo Corel Office 7 Multi-user Application Tuning Complete
  125. Rem
  126. Rem Get the permission compatibility mode from the registry.
  127. Rem If TSUserEnabled is 0 we need to warn user to change mode.
  128. Rem
  129. ..\ACRegL "%Temp%\tsuser.Cmd" TSUSERENABLED "HKLM\System\CurrentControlSet\Control\Terminal Server" "TSUserEnabled" ""
  130. If Exist "%Temp%\tsuser.Cmd" (
  131. Call "%Temp%\tsuser.Cmd"
  132. Del "%Temp%\tsuser.Cmd" >Nul: 2>&1
  133. )
  134. If NOT %TSUSERENABLED%==0 goto SkipWarning
  135. Echo.
  136. Echo IMPORTANT!
  137. Echo Terminal Server is currently running in Default Security mode.
  138. Echo This application requires the system to run in Relaxed Security mode
  139. Echo (permissions compatible with Terminal Server 4.0).
  140. Echo Use Terminal Services Configuration to view and change the Terminal
  141. Echo Server security mode.
  142. Echo.
  143. :SkipWarning
  144. Pause
  145. :Done