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.

257 lines
8.7 KiB

  1. @Echo Off
  2. Rem #########################################################################
  3. Rem
  4. Rem Verify that the CMD Extensions are enabled
  5. Rem
  6. if "A%cmdextversion%A" == "AA" (
  7. call cmd /e:on /c netcom40.cmd %*
  8. ) else (
  9. goto ExtOK
  10. )
  11. goto Done
  12. :ExtOK
  13. Rem #########################################################################
  14. Rem
  15. Rem Verify that %RootDrive% has been configured and set it for this script.
  16. Rem
  17. Call "%SystemRoot%\Application Compatibility Scripts\ChkRoot.Cmd"
  18. If "%_CHKROOT%" == "FAIL" Goto Done
  19. Call "%SystemRoot%\Application Compatibility Scripts\SetPaths.Cmd"
  20. If "%_SETPATHS%" == "FAIL" Goto Done
  21. Rem #########################################################################
  22. REM
  23. REM Handle new command line option "/u" which means, do un-install cleanup.
  24. REM Since we are creating a folder for the installer, allow an optional "/u" command line option to this script that
  25. REM will do cleanup after an uninstall.
  26. REM
  27. set p1=%1
  28. if DEFINED p1 goto cont0_0
  29. goto cont0_install
  30. :cont0_0
  31. if /I %1 equ /u goto cont0_uninstall
  32. :cont0_install
  33. Rem #########################################################################
  34. Rem
  35. Rem Get the version of NetScape (4.5x is done differently 4.0x)
  36. Rem
  37. ..\ACRegL "%Temp%\NS4VER.Cmd" NS4VER "HKLM\Software\Netscape\Netscape Navigator" "CurrentVersion" "STRIPCHAR(1"
  38. If Not ErrorLevel 1 Goto Cont0
  39. Echo.
  40. Echo Unable to retrieve Netscape Communicator 4 version from
  41. Echo the registry. Verify that Communicator has already been installed
  42. Echo and run this script again.
  43. Echo.
  44. Pause
  45. Goto Done
  46. :Cont0
  47. Call "%Temp%\NS4VER.Cmd"
  48. Del "%Temp%\NS4VER.Cmd" >Nul: 2>&1
  49. Rem #########################################################################
  50. REM Do not show the "User Profile manager" to regular users, so remove it from the all users folder,
  51. REM but since we do want the admin to have access to it, move it to the current user's start menu.
  52. REM It is reasonable to assume that the user that does the installation, is the user who may want to use it.
  53. If Not Exist "%COMMON_PROGRAMS%\Netscape Communicator\Utilities\User Profile Manager.Lnk" Goto Cont0A
  54. mkdir "%USER_PROGRAMS%\Netscape Communicator\Utilities"
  55. copy "%COMMON_PROGRAMS%\Netscape Communicator\Utilities\User Profile Manager.Lnk" "%USER_PROGRAMS%\Netscape Communicator\Utilities\User Profile Manager.Lnk"
  56. del /q "%COMMON_PROGRAMS%\Netscape Communicator\Utilities\User Profile Manager.Lnk"
  57. :Cont0A
  58. If Not Exist "%COMMON_PROGRAMS%\Netscape Communicator Professional Edition\Utilities\User Profile Manager.Lnk" Goto Cont0B
  59. mkdir "%USER_PROGRAMS%\Netscape Communicator Professional Edition\Utilities"
  60. copy "%COMMON_PROGRAMS%\Netscape Communicator Professional Edition\Utilities\User Profile Manager.Lnk" "%USER_PROGRAMS%\Netscape Communicator Professional Edition\Utilities\User Profile Manager.Lnk"
  61. del /q "%COMMON_PROGRAMS%\Netscape Communicator Professional Edition\Utilities\User Profile Manager.Lnk"
  62. :Cont0B
  63. if /i "%NS4VER%" LSS "4.5 " goto NS40x
  64. Rem #########################################################################
  65. Rem Netscape 4.5x
  66. Rem
  67. Rem Get the installation location of Netscape Communicator 4.5 from the
  68. Rem registry. If not found, assume Communicator isn't installed and
  69. Rem display an error message.
  70. Rem
  71. ..\ACRegL "%Temp%\NS45.Cmd" NS40INST "HKCU\Software\Netscape\Netscape Navigator\Main" "Install Directory" "Stripchar\1"
  72. If Not ErrorLevel 1 Goto Cont1
  73. Echo.
  74. Echo Unable to retrieve Netscape Communicator 4.5 installation location from
  75. Echo the registry. Verify that Communicator has already been installed
  76. Echo and run this script again.
  77. Echo.
  78. Pause
  79. Goto Done
  80. :Cont1
  81. Call "%Temp%\NS45.Cmd"
  82. Del "%Temp%\NS45.Cmd" >Nul: 2>&1
  83. Rem #########################################################################
  84. Rem
  85. Rem Update Com40Usr.Cmd to reflect the default NetScape Users directory and
  86. Rem add it to the UsrLogn2.Cmd script
  87. Rem
  88. ..\acsr "#NSUSERDIR#" "%ProgramFiles%\Netscape\Users" ..\Logon\Template\Com40Usr.Cmd ..\Logon\Com40Usr.tmp
  89. ..\acsr "#NS40INST#" "%NS40INST%" ..\Logon\Com40Usr.tmp ..\Logon\Com40Usr.tm2
  90. ..\acsr "#NS4VER#" "4.5x" ..\Logon\Com40Usr.tm2 ..\Logon\Com40Usr.Cmd
  91. Rem #########################################################################
  92. Rem
  93. Rem Copy the "quick launch" icons to the netscape install directory so we can
  94. Rem copy them to each user's profile directory
  95. Rem
  96. If Exist "%UserProfile%\%App_Data%\Microsoft\Internet Explorer\Quick Launch\Netscape Composer.lnk" copy "%UserProfile%\%App_Data%\Microsoft\Internet Explorer\Quick Launch\Netscape Composer.lnk" "%NS40INST%"
  97. If Exist "%UserProfile%\%App_Data%\Microsoft\Internet Explorer\Quick Launch\Netscape Messenger.lnk" copy "%UserProfile%\%App_Data%\Microsoft\Internet Explorer\Quick Launch\Netscape Messenger.lnk" "%NS40INST%"
  98. If Exist "%UserProfile%\%App_Data%\Microsoft\Internet Explorer\Quick Launch\Netscape Navigator.lnk" copy "%UserProfile%\%App_Data%\Microsoft\Internet Explorer\Quick Launch\Netscape Navigator.lnk" "%NS40INST%"
  99. goto DoUsrLogn
  100. :NS40x
  101. Rem #########################################################################
  102. Rem Netscape 4.0x
  103. Rem
  104. Rem Get the installation location of Netscape Communicator 4 from the
  105. Rem registry. If not found, assume Communicator isn't installed and
  106. Rem display an error message.
  107. Rem
  108. ..\ACRegL "%Temp%\NS40.Cmd" NS40INST "HKCU\Software\Netscape\Netscape Navigator\Main" "Install Directory" ""
  109. If Not ErrorLevel 1 Goto Cont2
  110. Echo.
  111. Echo Unable to retrieve Netscape Communicator 4 installation location from
  112. Echo the registry. Verify that Communicator has already been installed
  113. Echo and run this script again.
  114. Echo.
  115. Pause
  116. Goto Done
  117. :Cont2
  118. Call "%Temp%\NS40.Cmd"
  119. Del "%Temp%\NS40.Cmd" >Nul: 2>&1
  120. Rem #########################################################################
  121. Rem
  122. Rem Copy the default profile from the administrator's home directory to
  123. Rem a known location. This profile will be copied to each user's directory
  124. Rem during logon. If the global default already exists, don't overwrite
  125. Rem it. Otherwise, an Admin could run this script much later and have all
  126. Rem his personal information moved to the global default.
  127. Rem
  128. If Exist %RootDrive%\NS40 Goto Cont3
  129. Echo.
  130. Echo Default profile not found in %RootDrive%\NS40. Please run the
  131. Echo User Profile Manager and create a single profile named "Default".
  132. Echo When prompted for the Profile Path, use the path shown above. Leave
  133. Echo all name and email name entries blank. If any other profiles exist,
  134. Echo delete them. After you have completed these steps, run this script
  135. Echo again.
  136. Echo.
  137. Pause
  138. Goto Done
  139. :Cont3
  140. If Exist "%NS40INST%\DfltProf" Goto Cont4
  141. Xcopy "%RootDrive%\NS40" "%NS40INST%\DfltProf" /E /I /K >NUL: 2>&1
  142. :Cont4
  143. Rem #########################################################################
  144. Rem
  145. Rem Update Com40Usr.Cmd to reflect actual installation directory and
  146. Rem add it to the UsrLogn2.Cmd script
  147. Rem
  148. ..\acsr "#PROFDIR#" "%NS40INST%\DfltProf" ..\Logon\Template\Com40Usr.Cmd ..\Logon\Com40Usr.tmp
  149. ..\acsr "#NS4VER#" "4.0x" ..\Logon\Com40Usr.tmp ..\Logon\Com40Usr.Cmd
  150. :DoUsrLogn
  151. del ..\Logon\Com40Usr.tmp >Nul: 2>&1
  152. del ..\Logon\Com40Usr.tm2 >Nul: 2>&1
  153. FindStr /I Com40Usr %SystemRoot%\System32\UsrLogn2.Cmd >Nul: 2>&1
  154. If Not ErrorLevel 1 Goto Skip1
  155. Echo Call Com40Usr.Cmd >> %SystemRoot%\System32\UsrLogn2.Cmd
  156. :Skip1
  157. Echo.
  158. Echo To insure proper operation of Netscape Communicator, users who are
  159. Echo currently logged on must log off and log on again before
  160. Echo running any application.
  161. Echo.
  162. Echo Netscape Communicator 4 Multi-user Application Tuning Complete
  163. Rem
  164. Rem Get the permission compatibility mode from the registry.
  165. Rem If TSUserEnabled is 0 we need to warn user to change mode.
  166. Rem
  167. ..\ACRegL "%Temp%\tsuser.Cmd" TSUSERENABLED "HKLM\System\CurrentControlSet\Control\Terminal Server" "TSUserEnabled" ""
  168. If Exist "%Temp%\tsuser.Cmd" (
  169. Call "%Temp%\tsuser.Cmd"
  170. Del "%Temp%\tsuser.Cmd" >Nul: 2>&1
  171. )
  172. If NOT %TSUSERENABLED%==0 goto SkipWarning
  173. Echo.
  174. Echo IMPORTANT!
  175. Echo Terminal Server is currently running in Default Security mode.
  176. Echo This application requires the system to run in Relaxed Security mode
  177. Echo (permissions compatible with Terminal Server 4.0).
  178. Echo Use Terminal Services Configuration to view and change the Terminal
  179. Echo Server security mode.
  180. Echo.
  181. :SkipWarning
  182. Pause
  183. goto done
  184. Rem #########################################################################
  185. REM
  186. REM The below block of code is to do cleanup after un-installation
  187. REM
  188. :cont0_uninstall
  189. if Exist "%USER_PROGRAMS%\Netscape Communicator Professional Edition\Utilities" (
  190. rd /s /q "%USER_PROGRAMS%\Netscape Communicator Professional Edition"
  191. )
  192. :done