mirror of https://github.com/tongzx/nt5src
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.
290 lines
9.0 KiB
290 lines
9.0 KiB
@Echo Off
|
|
|
|
Rem
|
|
Rem 注意: CACLS 指令只能在 NTFS 格式的磁碟分割中執行。
|
|
Rem
|
|
|
|
Rem #########################################################################
|
|
Rem
|
|
Rem
|
|
|
|
Call "%SystemRoot%\Application Compatibility Scripts\ChkRoot.Cmd"
|
|
If "%_CHKROOT%" == "FAIL" Goto Done
|
|
Call "%SystemRoot%\Application Compatibility Scripts\SetPaths.Cmd"
|
|
If "%_SETPATHS%" == "FAIL" Goto Done
|
|
|
|
Rem #########################################################################
|
|
|
|
Rem
|
|
Rem 從登錄中取得 Visual Studio 6.0 安裝位置。
|
|
Rem 如果找不到,就假設 Visual Studio 6.0 並未安裝並顯示錯誤訊息。
|
|
Rem
|
|
|
|
..\ACRegL %Temp%\0VC98.Cmd 0VC98 "HKLM\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++" "ProductDir" ""
|
|
If Not ErrorLevel 1 Goto Cont0
|
|
|
|
Echo.
|
|
Echo 無法從登錄中抓取 Visual Studio 6.0 的安裝位置。
|
|
Echo 請確認 Visual Studio 6.0 是否已安裝,然後重新
|
|
Echo 執行這個指令檔。
|
|
Echo.
|
|
Pause
|
|
Goto Done
|
|
:Cont0
|
|
Call %Temp%\0VC98.Cmd
|
|
Del %Temp%\0VC98.Cmd >Nul: 2>&1
|
|
|
|
Rem #########################################################################
|
|
Rem
|
|
Rem 變更登錄機碼,將路徑指到使用者指定目錄。
|
|
Rem
|
|
Rem 如果目前不是安裝模式,就變更成安裝模式。
|
|
Set __OrigMode=Install
|
|
ChgUsr /query > Nul:
|
|
if Not ErrorLevel 101 Goto Begin
|
|
Set __OrigMode=Exec
|
|
Change User /Install > Nul:
|
|
:Begin
|
|
..\acsr "#ROOTDRIVE#" "%RootDrive%" Template\msvs6.Key %temp%\msvs6.tmp
|
|
..\acsr "#MY_DOCUMENTS#" "%MY_DOCUMENTS%" %temp%\msvs6.tmp %temp%\msvs6.tmp2
|
|
..\acsr "#APP_DATA#" "%APP_DATA%" %temp%\msvs6.tmp2 msvs6.key
|
|
Del %temp%\msvs6.tmp >Nul: 2>&1
|
|
Del %temp%\msvs6.tmp2 >Nul: 2>&1
|
|
regini msvs6.key > Nul:
|
|
|
|
Rem 如果原來是執行模式,就就變回執行模式。
|
|
If "%__OrigMode%" == "Exec" Change User /Execute > Nul:
|
|
Set __OrigMode=
|
|
|
|
|
|
Rem #########################################################################
|
|
Rem Create the user logon file for Visual Studio app
|
|
|
|
Echo Rem >..\logon\VS6USR.Cmd
|
|
|
|
Rem #########################################################################
|
|
Rem 為每個使用者建立 Visual Studio 專案目錄。
|
|
|
|
Echo Rem >>..\logon\VS6USR.Cmd
|
|
Echo Rem Create per user Visual Studio projects directory>>..\logon\VS6USR.Cmd
|
|
Echo call TsMkUDir "%RootDrive%\%MY_DOCUMENTS%\Visual Studio Projects">>..\logon\VS6USR.Cmd
|
|
Echo Rem >>..\logon\VS6USR.Cmd
|
|
|
|
|
|
Rem #########################################################################
|
|
|
|
Rem
|
|
Rem 從登錄中取得 Visual Studio 6.0 Entreprise Edition Tools 安裝位置。
|
|
Rem 如果找不到,就假設 Visual Studio 6.0 並未安裝並顯示錯誤訊息。
|
|
Rem 如果找到 US 版本,它會包含 <VStudioPath>\Common\Tools
|
|
Rem
|
|
|
|
..\ACRegL %Temp%\VSEET.Cmd VSEET "HKLM\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft VSEE Client" "ProductDir" ""
|
|
If Not ErrorLevel 1 Goto VSEET0
|
|
|
|
Goto VSEETDone
|
|
:VSEET0
|
|
Call %Temp%\VSEET.Cmd
|
|
Del %Temp%\VSEET.Cmd >Nul: 2>&1
|
|
|
|
If Not Exist "%VSEET%\APE\AEMANAGR.INI" Goto VSEETDone
|
|
..\acsr "=AE.LOG" "=%RootDrive%\AE.LOG" "%VSEET%\APE\AEMANAGR.INI" "%VSEET%\APE\AEMANAGR.TMP"
|
|
If Exist "%VSEET%\APE\AEMANAGRINI.SAV" Del /F /Q "%VSEET%\APE\AEMANAGRINI.SAV"
|
|
ren "%VSEET%\APE\AEMANAGR.INI" "AEMANAGRINI.SAV"
|
|
ren "%VSEET%\APE\AEMANAGR.TMP" "AEMANAGR.INI"
|
|
|
|
Echo Rem Copy APE ini file to the user windows directory >>..\logon\VS6USR.Cmd
|
|
Echo Rem >>..\logon\VS6USR.Cmd
|
|
Echo If Exist "%RootDrive%\Windows\AEMANAGR.INI" Goto UVSEET0 >>..\logon\VS6USR.Cmd
|
|
Echo If Exist "%VSEET%\APE\AEMANAGR.INI" Copy "%VSEET%\APE\AEMANAGR.INI" "%RootDrive%\Windows\AEMANAGR.INI" >Nul: 2>&1 >>..\logon\VS6USR.Cmd
|
|
Echo Rem >>..\logon\VS6USR.Cmd
|
|
Echo :UVSEET0>>..\logon\VS6USR.Cmd
|
|
|
|
Echo Rem Copy Visual Modeler ini file to the user windows directory >>..\logon\VS6USR.Cmd
|
|
Echo Rem >>..\logon\VS6USR.Cmd
|
|
Echo If Exist "%RootDrive%\Windows\ROSE.INI" Goto UVSEET1 >>..\logon\VS6USR.Cmd
|
|
Echo If Exist "%VSEET%\VS-Ent98\Vmodeler\ROSE.INI" Copy "%VSEET%\VS-Ent98\Vmodeler\ROSE.INI" "%RootDrive%\Windows\ROSE.INI" >Nul: 2>&1 >>..\logon\VS6USR.Cmd
|
|
Echo Rem >>..\logon\VS6USR.Cmd
|
|
Echo :UVSEET1>>..\logon\VS6USR.Cmd
|
|
|
|
:VSEETDone
|
|
|
|
|
|
Rem #########################################################################
|
|
|
|
Rem
|
|
Rem 將 VS6USR.Cmd 加入 UsrLogn2.Cmd 指令檔。
|
|
Rem
|
|
|
|
FindStr /I VS6USR %SystemRoot%\System32\UsrLogn2.Cmd >Nul: 2>&1
|
|
If Not ErrorLevel 1 Goto Skip1
|
|
Echo Call VS6USR.Cmd >> %SystemRoot%\System32\UsrLogn2.Cmd
|
|
:Skip1
|
|
|
|
|
|
Rem #########################################################################
|
|
Rem 取得 Visual foxPro 產品安裝目錄
|
|
|
|
..\ACRegL %Temp%\VFP98TMP.Cmd VFP98DIR "HKLM\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual FoxPro" "ProductDir" ""
|
|
|
|
Rem 如果 Visual FoxPro 並未安裝,就跳過用來清除的程式碼。
|
|
If ErrorLevel 1 goto Skip2
|
|
|
|
Rem #########################################################################
|
|
|
|
Rem
|
|
Rem 從登錄中取得自訂目錄機碼。
|
|
Rem
|
|
|
|
Set __SharedTools=Shared Tools
|
|
If Not "%PROCESSOR_ARCHITECTURE%"=="ALPHA" goto VFP98L2
|
|
If Not Exist "%ProgramFiles(x86)%" goto VFP98L2
|
|
Set __SharedTools=Shared Tools (x86)
|
|
:VFP98L2
|
|
|
|
|
|
..\ACRegL %Temp%\VFP98TMP.Cmd VFP98DIC "HKLM\Software\Microsoft\%__SharedTools%\Proofing Tools\Custom Dictionaries" "1" ""
|
|
If Not ErrorLevel 1 Goto VFP98L3
|
|
|
|
Echo.
|
|
Rem 無法從登錄抓取值就建立它。
|
|
Echo.
|
|
|
|
Rem 建立 VFP98TMP.key 檔案。
|
|
|
|
Echo HKEY_LOCAL_MACHINE\Software\Microsoft\%__SharedTools%\Proofing Tools\Custom Dictionaries> %Temp%\VFP98TMP.key
|
|
Echo 1 = REG_SZ "%RootDrive%\%MY_DOCUMENTS%\Custom.Dic">> %Temp%\VFP98TMP.key
|
|
|
|
Rem 建立值
|
|
regini %Temp%\VFP98TMP.key > Nul:
|
|
|
|
Del %Temp%\VFP98TMP.key >Nul: 2>&1
|
|
|
|
Echo set VFP98DIC=%RootDrive%\%MY_DOCUMENTS%\Custom.Dic>%Temp%\VFP98TMP.Cmd
|
|
:VFP98L3
|
|
|
|
Call %Temp%\VFP98TMP.Cmd
|
|
Del %Temp%\VFP98TMP.Cmd >Nul: 2>&1
|
|
|
|
|
|
Rem #########################################################################
|
|
Rem 建立 Visual FoxPro app 的使用者登入檔案
|
|
|
|
Echo Rem >..\logon\VFP98USR.Cmd
|
|
|
|
Rem #########################################################################
|
|
Rem Create per user Visual FoxPro directories
|
|
|
|
Echo Rem >>..\logon\VFP98USR.Cmd
|
|
Echo Rem Create a per user Visual FoxPro directory (VFP98)>>..\logon\VFP98USR.Cmd
|
|
Echo call TsMkUDir %RootDrive%\VFP98>>..\logon\VFP98USR.Cmd
|
|
Echo Rem >>..\logon\VFP98USR.Cmd
|
|
|
|
Echo Rem Create a per user Visual FoxPro distrib directory >>..\logon\VFP98USR.Cmd
|
|
Echo call TsMkUDir %RootDrive%\VFP98\DISTRIB>>..\logon\VFP98USR.Cmd
|
|
Echo Rem >>..\logon\VFP98USR.Cmd
|
|
|
|
Echo Rem #########################################################################>>..\logon\VFP98USR.Cmd
|
|
Echo Rem Create the custom dictionary if it doesn't exist.>>..\logon\VFP98USR.Cmd
|
|
Echo Rem >>..\logon\VFP98USR.Cmd
|
|
|
|
Echo If Exist "%VFP98DIC%" Goto VFP98L2 >>..\logon\VFP98USR.Cmd
|
|
Echo Copy Nul: "%VFP98DIC%" >Nul: 2>&1 >>..\logon\VFP98USR.Cmd
|
|
|
|
Echo :VFP98L2 >>..\logon\VFP98USR.Cmd
|
|
|
|
Rem #########################################################################
|
|
Rem Get the Visual foxPro product install directory
|
|
|
|
..\ACRegL %Temp%\VFP98TMP.Cmd VFP98DIR "HKLM\Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual FoxPro" "ProductDir" ""
|
|
If Not ErrorLevel 1 Goto VFP98L4
|
|
|
|
Del ..\logon\VFP98USR.Cmd >Nul: 2>&1
|
|
|
|
Echo.
|
|
Echo 無法從登錄中抓取 Visual Studio 6.0 的安裝位置。
|
|
Echo 請確認 Visual Studio 6.0 是否已安裝,然後重新
|
|
Echo 執行這個指令檔。
|
|
Echo.
|
|
Pause
|
|
Goto Skip2
|
|
|
|
:VFP98L4
|
|
Call "%Temp%\VFP98TMP.Cmd"
|
|
Del "%Temp%\VFP98TMP.Cmd"
|
|
|
|
Rem #########################################################################
|
|
Rem 在 WZSETUP.INI 檔案中設定下列機碼。
|
|
Rem
|
|
If Exist "%VFP98DIR%\WZSETUP.INI" Goto VFP98L5
|
|
Echo [Preferences] >"%VFP98DIR%\WZSETUP.INI"
|
|
Echo DistributionDirectory=%RootDrive%\VFP98\DISTRIB >>"%VFP98DIR%\WZSETUP.INI"
|
|
|
|
:VFP98L5
|
|
|
|
|
|
Rem #########################################################################
|
|
Rem
|
|
Rem Change Registry Keys to make paths point to user specific
|
|
Rem directories.
|
|
Rem
|
|
|
|
|
|
Rem First Create VFP98TMP.key file
|
|
|
|
Echo HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\6.0\Options> %Temp%\VFP98TMP.key
|
|
Echo DEFAULT = REG_SZ "%RootDrive%\VFP98">> %Temp%\VFP98TMP.key
|
|
Echo SetDefault = REG_SZ "1">> %Temp%\VFP98TMP.key
|
|
Echo ResourceTo = REG_SZ "%RootDrive%\VFP98\FOXUSER.DBF">> %Temp%\VFP98TMP.key
|
|
Echo ResourceOn = REG_SZ "1">> %Temp%\VFP98TMP.key
|
|
|
|
Rem 如果目前不是安裝模式,就變更成安裝模式。
|
|
Set __OrigMode=Install
|
|
ChgUsr /query > Nul:
|
|
if Not ErrorLevel 101 Goto VFP98L6
|
|
Set __OrigMode=Exec
|
|
Change User /Install > Nul:
|
|
:VFP98L6
|
|
|
|
regini %Temp%\VFP98TMP.key > Nul:
|
|
|
|
Rem 如果原來是執行模式,就就變回執行模式。
|
|
If "%__OrigMode%" == "Exec" Change User /Execute > Nul:
|
|
Set __OrigMode=
|
|
|
|
Del %Temp%\VFP98TMP.key >Nul: 2>&1
|
|
|
|
|
|
Rem #########################################################################
|
|
|
|
Rem
|
|
Rem 將 VFP98USR.Cmd 加入 UsrLogn2.Cmd 指令檔
|
|
Rem
|
|
|
|
FindStr /I VFP98USR %SystemRoot%\System32\UsrLogn2.Cmd >Nul: 2>&1
|
|
If Not ErrorLevel 1 Goto Skip2
|
|
Echo Call VFP98USR.Cmd >> %SystemRoot%\System32\UsrLogn2.Cmd
|
|
:Skip2
|
|
|
|
If Exist "%Temp%\VFP98TMP.Cmd" Del "%Temp%\VFP98TMP.Cmd"
|
|
|
|
Rem #########################################################################
|
|
|
|
Rem
|
|
Rem 授與 TS 使用者權限來變更 repostry 目錄,
|
|
Rem 以便使用 Visual Component Manager。
|
|
Rem
|
|
|
|
If Exist "%SystemRoot%\msapps\repostry" cacls "%SystemRoot%\msapps\repostry" /E /G "Terminal Server User":C >NUL: 2>&1
|
|
|
|
|
|
Rem #########################################################################
|
|
Echo.
|
|
Echo 為了能讓 Visual Studio 6.0 正確操作,目前已
|
|
Echo 登入的使用者必須先登出,再重新登入,才能執行
|
|
Echo Visual Studio 6.0 應用程式。
|
|
Echo.
|
|
Echo Microsoft Visual Studio 6.0 多使用者應用程式調整處理完成
|
|
Pause
|
|
|
|
:done
|