星际争霸全版本转换器(切换器) Build 2009.04.27 完整代码

; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!ifdef MINI_VERSION
!define PRODUCT_NAME "SCV Selector (Mini Version)"
!define SCV_INI "SCV.mini.ini"
!else
!define PRODUCT_NAME "SCV Selector (Full Version)"
!define SCV_INI "SCV.ini"
!endif
!define PRODUCT_VERSION "Build 2007.11.02"
!define PRODUCT_PUBLISHER "Rainux"
!define PRODUCT_WEB_SITE "http://www.rainux.org"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ICON "BW.ico"
; 版本选择页面
Page custom ShowVerSelect LeaveVerSelect
; Directory page
!define MUI_PAGE_CUSTOMFUNCTION_PRE ExpressMode
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
!ifndef MINI_VERSION
OutFile "SCV.Selector.Full.exe"
!else
OutFile "SCV.Selector.Mini.exe"
!endif
!ifndef DEBUG
InstallDirRegKey HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "InstallPath"
!else
InstallDir "$PROGRAMFILES\Starcraft"
!endif
ShowInstDetails show
Caption "${PRODUCT_NAME} ${PRODUCT_VERSION}"
BrandingText "${PRODUCT_NAME} ${PRODUCT_VERSION}"
!include "LogicLib.nsh"
;--------------------------------
;Reserve Files
;These files should be inserted before other files in the data block
;Keep these lines before any File command
;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
ReserveFile ${SCV_INI}
ReserveFile "SC.ico"
ReserveFile "${NSISDIR}\Plugins\InstallOptionsEx.dll"
;--------------------------------
;Variables
Var NoCD
Var Started
;--------------------------------
;Installer Sections
Section "SCVS"
SetOutPath "$INSTDIR"
SetOverwrite off
DetailPrint "Removing old files"
KillProcDLL::KillProc "BNUpdate.exe"
KillProcDLL::KillProc "starcraft.exe"
KillProcDLL::KillProc "staredit.exe"
Call Cleanup
; NoCD or Original
!insertmacro MUI_INSTALLOPTIONS_READ $NoCD ${SCV_INI} "Field 4" "State"
System::Call "winmm::timeGetTime() i .R8 ?r"
; If "Other" selected, use DropList
!insertmacro MUI_INSTALLOPTIONS_READ $R0 ${SCV_INI} "Field 21" "State"
${If} $R0 = 1
 !insertmacro MUI_INSTALLOPTIONS_READ $R1 ${SCV_INI} "Field 22" "State"
${Else}
 ; $R9 is the selected radio ID
 !insertmacro MUI_INSTALLOPTIONS_READ $R1 ${SCV_INI} "Field $R9" "Text"
${EndIf}
; Try from the highest version, this makes script more effective
!ifndef MINI_VERSION
DetailPrint "Installing $R1"
StrCmp $R1 "Brood War v1.15.1" 0 +4
 Call BW1151
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.15.0" 0 +4
 Call BW1150
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.14" 0 +4
 Call BW114
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.13f" 0 +4
 Call BW113f
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.13e" 0 +4
 Call BW113e
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.13d" 0 +4
 Call BW113d
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.13c" 0 +4
 Call BW113c
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.13b" 0 +4
 Call BW113b
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.13" 0 +4
 Call BW113
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.12b" 0 +4
 Call BW112b
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.12" 0 +4
 Call BW112
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.11b" 0 +4
 Call BW111b
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.11" 0 +4
 Call BW111
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.10" 0 +4
 Call BW110
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.09b" 0 +4
 Call BW109b
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.09" 0 +4
 Call BW109
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.08b" 0 +4
 Call BW108b
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.08" 0 +4
 Call BW108
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.07" 0 +4
 Call BW107
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.06" 0 +4
 Call BW106
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.05" 0 +4
 Call BW105
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.04" 0 +4
 Call BW104
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "StarCraft v1.04" 0 +4
 Call SC104
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "StarCraft v1.03" 0 +4
 Call SC103
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "StarCraft v1.02" 0 +4
 Call SC102
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "StarCraft v1.01" 0 +4
 Call SC101
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "StarCraft v1.00" 0 +3
 Call SC100
 Goto +2
DetailPrint "Internal error"
!endif
!ifdef MINI_VERSION
DetailPrint "Installing $R1"
StrCmp $R1 "Brood War v1.15.1" 0 +4
 Call BW1151
 IntOp $Started 1 +
 Goto +2
StrCmp $R1 "Brood War v1.08b" 0 +4
 Call BW108b
 Goto +2
DetailPrint "Internal error"
!endif
; Apply NoCD patch
Call NoCDPatch
!ifndef DEBUG
Call RegFix
!endif
System::Call "winmm::timeGetTime() i .R9 ?r"
IntOp $R9 $R9 - $R8
DetailPrint "$R9 ms used."
System::Free 0
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT ${SCV_INI}
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "SC.ico"
!insertmacro MUI_INSTALLOPTIONS_WRITE ${SCV_INI} "Field 1" "Text" "$PLUGINSDIR\SC.ico"
FunctionEnd
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "StarCraft Version Select"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Please select the version of StarCraft you want to use."
Function ShowVerSelect
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
Push $R0
InstallOptionsEx::dialog $PLUGINSDIR\${SCV_INI}
Pop $R0
FunctionEnd
Function LeaveVerSelect
; $R0 is the button ID, $R1 is the DropList
!insertmacro MUI_INSTALLOPTIONS_READ $R0 ${SCV_INI} "Settings" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $R1 ${SCV_INI} "Field 22" "HWND"
; 如果添加新版本,需要修改此数字 ID
${If} $R0 >= 7
${AndIf} $R0 <= 20
 EnableWindow $R1 0
 ; $R9 is the selected radio ID
 IntOp $R9 $R0 +
 Abort
${ElseIf} $R0 = 21
 EnableWindow $R1 1
 Abort
${EndIf}
FunctionEnd
Function ExpressMode
!insertmacro MUI_INSTALLOPTIONS_READ $R0 ${SCV_INI} "Field 3" "State"
${If} $R0 = 1
 SetAutoClose true
 SetDetailsPrint none
 SetDetailsView hide
 ${If} $INSTDIR != ""
 Abort
 ${EndIf}
${EndIf}
${If} $INSTDIR == ""
 StrCpy $INSTDIR $EXEDIR
${EndIf}
FunctionEnd
Function NoCDPatch
${If} $NoCD = 1
 File "storm.NoCD\Install.exe"
 File "storm.NoCD\NoCD.pat"
 DetailPrint "VPatching storm.dll to NoCD version"
 VPatch::vpatchfile "NoCD.pat" "storm.dll" "storm.NoCD.dll"
 Delete "$INSTDIR\NoCD.pat"
 Delete "$INSTDIR\storm.dll"
 Rename "storm.NoCD.dll" "storm.dll"
${EndIf}
FunctionEnd
Function RegFix
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "InstallPath" "$INSTDIR\"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "Program" "$INSTDIR\Starcraft.exe"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "StarEdit" "$INSTDIR\"
${If} $NoCD = 1
 WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "StarCD" "$INSTDIR\"
${Else}
 DeleteRegValue HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "StarCD"
${EndIf}
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "Retail" "y"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "Brood War" "y"
DeleteRegValue HKCU "SOFTWARE\Blizzard Entertainment\Starcraft" "Game Speed"
DeleteRegValue HKCU "SOFTWARE\Blizzard Entertainment\Starcraft" "music"
DeleteRegValue HKCU "SOFTWARE\Blizzard Entertainment\Starcraft" "trigtext"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "Game Speed" "Fastest"
WriteRegDWORD HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "music" 0x00000032
WriteRegDWORD HKLM "SOFTWARE\Blizzard Entertainment\Starcraft" "trigtext" 0x00000400
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt0" "Path0" "$INSTDIR\characters"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt0" "File0" "spc"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt0" "Path1" "$INSTDIR\characters"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt0" "File1" "mpc"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "Path0" "$INSTDIR\save"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "File0" "sng"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "Path1" "$INSTDIR\maps\save"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "File1" "mlt"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "Path2" "$INSTDIR\save"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "File2" "snx"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "Path3" "$INSTDIR\maps\save"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "File3" "mlx"
WriteRegStr HKLM "SOFTWARE\Blizzard Entertainment\Starcraft\DelOpt1" "Game Subtype" "4 vs 4"
FunctionEnd
Function Cleanup
!ifndef MINI_VERSION
Delete "$INSTDIR\BNUpdate.exe"
Delete "$INSTDIR\bnupdate.log"
Delete "$INSTDIR\BroodUnits.doc"
Delete "$INSTDIR\EditLocal.dll"
Delete "$INSTDIR\InstCC.exe"
Delete "$INSTDIR\License.txt"
Delete "$INSTDIR\noboot.dat"
Delete "$INSTDIR\patch.txt"
Delete "$INSTDIR\Readme.cnt"
Delete "$INSTDIR\Readme.hlp"
Delete "$INSTDIR\Riched20.dll"
Delete "$INSTDIR\SEditDEU.loc"
Delete "$INSTDIR\SEditENU.loc"
Delete "$INSTDIR\SEditESP.loc"
Delete "$INSTDIR\SEditFRA.loc"
Delete "$INSTDIR\SEditITA.loc"
Delete "$INSTDIR\SEditPTB.loc"
Delete "$INSTDIR\SEditPTG.loc"
Delete "$INSTDIR\StarEdit.cnt"
Delete "$INSTDIR\staredit.exe"
Delete "$INSTDIR\StarEdit.hlp"
!endif
Delete "$INSTDIR\battle.snp"
Delete "$INSTDIR\Local.dll"
Delete "$INSTDIR\Patch_rt.mpq"
Delete "$INSTDIR\Smackw32.dll"
Delete "$INSTDIR\standard.snp"
Delete "$INSTDIR\starcraft.exe"
Delete "$INSTDIR\storm.dll"
FunctionEnd
!ifndef MINI_VERSION
Function SC100
File "SC.v1.00\*.*"
FunctionEnd
Function SC101
File "SC.v1.01\*.*"
FunctionEnd
Function SC102
File /x "Patch*.*" "SC.v1.02\*.*"
${If} $Started = 0
 File "SC.v1.02\Patch*.*"
${EndIf}
FunctionEnd
Function SC103
File /x "Patch*.*" "SC.v1.03\*.*"
${If} $Started = 0
 File "SC.v1.03\Patch*.*"
${EndIf}
FunctionEnd
Function SC104
File /x "Patch*.*" /x "SEditPTG.loc" "SC.v1.04\*.*"
${If} $Started = 0
 File "SC.v1.04\Patch*.*"
 File "SC.v1.04\SEditPTG.loc"
${EndIf}
FunctionEnd
Function BW104
File /x "SEditPTG.loc" "BW.v1.04\*.*"
${If} $Started = 0
 File "BW.v1.04\SEditPTG.loc"
${EndIf}
FunctionEnd
Function BW105
File "BW.v1.05\*.*"
FunctionEnd
Function BW106
File "BW.v1.06\*.*"
FunctionEnd
Function BW107
File "BW.v1.07\*.*"
FunctionEnd
Function BW108
File "BW.v1.08\*.*"
FunctionEnd
Function BW108b
File "BW.v1.08b\*.*"
FunctionEnd
Function BW109
File "BW.v1.09\*.*"
FunctionEnd
Function BW109b
File "BW.v1.09b\*.*"
FunctionEnd
Function BW110
File "BW.v1.10\*.*"
FunctionEnd
Function BW111
File "BW.v1.11\*.*"
FunctionEnd
Function BW111b
File "BW.v1.11b\*.*"
FunctionEnd
Function BW112
File "BW.v1.12\*.*"
FunctionEnd
Function BW112b
File "BW.v1.12b\*.*"
FunctionEnd
Function BW113
File "BW.v1.13\*.*"
FunctionEnd
Function BW113b
File "BW.v1.13b\*.*"
FunctionEnd
Function BW113c
File "BW.v1.13c\*.*"
FunctionEnd
Function BW113d
File "BW.v1.13d\*.*"
FunctionEnd
Function BW113e
File "BW.v1.13e\*.*"
FunctionEnd
Function BW113f
File "BW.v1.13f\*.*"
FunctionEnd
Function BW114
File "BW.v1.14\*.*"
FunctionEnd
Function BW1150
File "BW.v1.15.0\*.*"
FunctionEnd
Function BW1151
File "BW.v1.15.1\*.*"
FunctionEnd
!endif
!ifdef MINI_VERSION
Function BW108b
File "SC.v1.00\Local.dll"
File "SC.v1.00\Smackw32.dll"
File "BW.v1.08\Patch_rt.mpq"
File "BW.v1.08\standard.snp"
File "BW.v1.08\storm.dll"
File "BW.v1.08b\patch.txt"
File "BW.v1.08b\starcraft.exe"
FunctionEnd
Function BW1151
File "BW.v1.15.1\patch.txt"
File "BW.v1.15.1\Patch_rt.mpq"
File "BW.v1.15.1\standard.snp"
File "BW.v1.15.1\StarCraft.exe"
File "BW.v1.15.1\storm.dll"
FunctionEnd
!endif
; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=24
[Field 1]
Type=Image
Left=0
Right=24
Top=4
Bottom=28
ToolTipTitle=StarCraft
ToolTipText=\r\n星际争霸,回到没有 Medic 没有 Lurker 没有 Dark Templar 的时代。
ToolTipFlags=NOALWAYSTIP|BALLOON
ToolTipIcon=INFORMATION
[Field 2]
Type=Image
Left=0
Right=24
Top=52
Bottom=76
ToolTipTitle=StarCraft: Brood War
ToolTipText=\r\n星际争霸: 母巢之战,还记得 1.04 的小狗变飞龙,1.07 的三基地刺蛇海么?
ToolTipFlags=NOALWAYSTIP|BALLOON
ToolTipIcon=INFORMATION
[Field 3]
Type=Checkbox
Text=Express Mode
State=1
Left=28
Right=92
Top=129
Bottom=137
ToolTipTitle=Express Mode
ToolTipText=\r\n选中: 直接安装到从注册表里探测到的星际争霸安装目录,完成后自动关闭。若注册表里没有星际争霸安装信息,则安装到当前目录。\r\n\r\n不选: 可以自己选择安装目录,默认是从注册表里探测到的星际争霸安装目录。
ToolTipFlags=NOALWAYSTIP|BALLOON
ToolTipIcon=INFORMATION
[Field 4]
Type=Checkbox
Text=NoCD
State=1
Left=96
Right=128
Top=129
Bottom=137
ToolTipTitle=NoCD
ToolTipText=\r\n选中: 应用最简单的免 CD 补丁(YaoYuan.com 论坛网友 keakon 提供的修改 storm.dll 的方式),使用这种免 CD 补丁将无法进行 Battle.net 模式的网络对战(当然,我们最常用的局域网对战模式是支持的)。\r\n\r\n不选: 不应用免 CD 补丁,需要其它免 CD 工具或星际争霸原版光盘(或光盘镜像)才能进行游戏。
ToolTipFlags=NOALWAYSTIP|BALLOON
ToolTipIcon=INFORMATION
[Field 5]
Type=Groupbox
Text=StarCraft
Left=28
Right=300
Top=0
Bottom=41
[Field 6]
Type=Groupbox
Text=StarCraft: Brood War
Left=28
Right=300
Top=48
Bottom=123
[Field 7]
Type=RadioButton
Text=StarCraft v1.00
Left=36
Right=116
Top=12
Bottom=20
Notify=ONCLICK
[Field 8]
Type=RadioButton
Text=StarCraft v1.01
Left=124
Right=204
Top=12
Bottom=20
Notify=ONCLICK
[Field 9]
Type=RadioButton
Text=StarCraft v1.02
Left=212
Right=292
Top=12
Bottom=20
Notify=ONCLICK
[Field 10]
Type=RadioButton
Text=StarCraft v1.03
Left=36
Right=116
Top=24
Bottom=32
Notify=ONCLICK
[Field 11]
Type=RadioButton
Text=StarCraft v1.04
Left=124
Right=204
Top=24
Bottom=32
Notify=ONCLICK
[Field 12]
Type=RadioButton
Text=Brood War v1.04
Left=36
Right=116
Top=60
Bottom=68
Notify=ONCLICK
[Field 13]
Type=RadioButton
Text=Brood War v1.05
Left=124
Right=204
Top=60
Bottom=68
Notify=ONCLICK
[Field 14]
Type=RadioButton
Text=Brood War v1.06
Left=212
Right=292
Top=60
Bottom=68
Notify=ONCLICK
[Field 15]
Type=RadioButton
Text=Brood War v1.07
Left=36
Right=116
Top=72
Bottom=80
Notify=ONCLICK
[Field 16]
Type=RadioButton
Text=Brood War v1.08b
Left=124
Right=204
Top=72
Bottom=80
Notify=ONCLICK
[Field 17]
Type=RadioButton
Text=Brood War v1.09b
Left=212
Right=292
Top=72
Bottom=80
Notify=ONCLICK
[Field 18]
Type=RadioButton
Text=Brood War v1.11b
Left=36
Right=116
Top=84
Bottom=92
Notify=ONCLICK
[Field 19]
Type=RadioButton
Text=Brood War v1.12b
Left=124
Right=204
Top=84
Bottom=92
Notify=ONCLICK
[Field 20]
Type=RadioButton
Text=Brood War v1.13f
Left=212
Right=292
Top=84
Bottom=92
Notify=ONCLICK
[Field 21]
Type=RadioButton
Text=Other, Select ->
State=1
Left=36
Right=116
Top=100
Bottom=108
Notify=ONCLICK
[Field 22]
Type=Droplist
ListItems=Brood War v1.04|Brood War v1.05|Brood War v1.06|Brood War v1.07|Brood War v1.08|Brood War v1.08b|Brood War v1.09|Brood War v1.09b|Brood War v1.10|Brood War v1.11|Brood War v1.11b|Brood War v1.12|Brood War v1.12b|Brood War v1.13|Brood War v1.13b|Brood War v1.13c|Brood War v1.13d|Brood War v1.13e|Brood War v1.13f|Brood War v1.14|Brood War v1.15.0|Brood War v1.15.1
Left=124
Right=204
Top=97
Bottom=110
State=Brood War v1.15.1
[Field 23]
Type=Link
Text=Made by Rainux
Left=140
Right=196
Top=129
Bottom=137
State=http://www.rainux.org
ToolTipTitle=Rainux
ToolTipText=\r\nA programmer, use Delphi/PHP/Ruby/bash, loves StarCraft for 9 years and will continue.
ToolTipFlags=NOALWAYSTIP|BALLOON
ToolTipIcon=INFORMATION
[Field 24]
Type=Link
Text=http://www.rainux.org
Left=204
Right=300
Top=129
Bottom=137
State=http://www.rainux.org/2006/04/03/130
ToolTipTitle=Rainux.Org
ToolTipText=\r\n访问 SCV Selector 发布页面。
ToolTipFlags=NOALWAYSTIP|BALLOON
ToolTipIcon=INFORMATION
© 版权声明
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容