1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
' VBScript source code '=============================================================================== ' ' 将佢掉到文明4的目录下双击就得了。 ' 自动取得路径,检查有冇相关文件夹,关联相关文件。 ' ' 写入版本说明 ' Civ4(1.00.0000,1.61,1.74),Warlords(1.00.0000,2.13),BTS(3.01,3.13,3.19) ' ' 含BTS的反安装信息,但要BTS成功注册才会写入 ' 3.13版的反安装为3.01版的,方便升/降级 ' 3.19版的直接就是3.19版的 ' ' ' by ztjal ' 09.06.18 '=============================================================================== On Error Resume Next '------------------------------------------------------------------------------------------ Public fso Public Civ4Folder Set fso = CreateObject("Scripting.FileSystemObject") Civ4Folder = fso.GetParentFoldername(WScript.ScriptFullName) Public Const HKEY_LOCAL_MACHINE = &H80000002 Public Const HKEY_CLASSES_ROOT = &H80000000 Public strComputer Public StdOut Public Civ4Reg strComputer = "." Set StdOut = WScript.StdOut Set Civ4Reg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") Public doCiv4Reg Public doCiv4WarlordReg Public WarlordsJ Public doCiv4BTSReg Public RegCiv4Ok Public RegCiv4BTSOk Public RegCiv4WarlordOk Public RegBts319 '------------------------------------------------------------------------------------------ Sub testValue() strFirstMsg = "---> 看 清 楚 ! <---" & chr(13) & chr (10) & "是否要同时恢复至 3.19 版 ?" & chr(13) & chr (10) & "点 ""是/Yes"" 恢复至 3.19" _ & chr(13) & chr (10) & "点 ""否/No"" 恢复至 3.13" & chr(13) & chr (10) & "点 ""取消/Cancel"" 什么事都没发生" iMBValue = Msgbox(strFirstMsg, VbYesNoCancel+VbQuestion+vbDefaultButton3, "文明4注册表恢复VBS") If iMBValue = vbYes Then RegBts319 = 1 else If iMBValue = vbNo Then RegBts319 = 0 else If iMBValue = vbCancel Then wscript.quit end if end if End If If fso.FileExists(Civ4Folder & "\Civilization4.exe") = True Then doCiv4Reg = 1 End If If fso.FolderExists(Civ4Folder & "\Warlords(J)") = True Then doCiv4WarlordReg = 1 WarlordsJ = 2 Else If fso.FolderExists(Civ4Folder & "\Warlords") = True Then doCiv4WarlordReg = 1 WarlordsJ = 1 End If End If If fso.FolderExists(Civ4Folder & "\Beyond the Sword") = True Then doCiv4BTSReg = 1 End If End Sub Sub RegCiv4() Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games" Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4", "INSTALLDIR", Civ4Folder Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4", "DEFAULT_LANGUAGE", 9 Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4\1.00.0000" Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4\1.61" Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4\1.74" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civilization4.exe" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civilization4.exe\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civilization4.exe\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civilization4.exe\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Applications\Civilization4.exe\shell\open\command", , """" & Civ4Folder & "\Civilization4.exe"" /FXSLOAD=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".Civ4Replay" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".Civ4Replay", , "Civ4Replay" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".Civ4SavedGame" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".Civ4SavedGame", , "Civ4SavedGame" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".Civ4WorldBuilderSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".Civ4WorldBuilderSave", , "Civ4WorldBuilderSave" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4Replay" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4Replay", , "Replay" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4Replay\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4Replay\DefaultIcon", , Civ4Folder & "\Civilization4.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4Replay\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4Replay\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4Replay\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4Replay\shell\open\command", , """" & Civ4Folder & "\Civilization4.exe"" /FXSLOAD=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4SavedGame" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4SavedGame", , "Saved Game" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4SavedGame\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4SavedGame\DefaultIcon", , Civ4Folder & "\Civilization4.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4SavedGame\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4SavedGame\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4SavedGame\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4SavedGame\shell\open\command", , """" & Civ4Folder & "\Civilization4.exe"" /FXSLOAD=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave", , "WorldBuilder Save" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave\DefaultIcon", , Civ4Folder & "\Civilization4.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Civ4WorldBuilderSave\shell\open\command", , """" & Civ4Folder & "\Civilization4.exe"" /FXSLOAD=""%1""" If Err > 0 Then RegCiv4Ok = 0 else RegCiv4Ok = 1 end if End Sub Sub RegCiv4BTS() Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword", "INSTALLDIR", Civ4Folder & "\Beyond the Sword" Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword", "DEFAULT_LANGUAGE", 9 Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword\3.01" Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword\3.13" if RegBts319 = 1 then Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword\3.19" end if Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".CivBeyondSwordReplay" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".CivBeyondSwordReplay", , "CivBeyondSwordReplay" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".CivBeyondSwordSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".CivBeyondSwordSave", , "CivBeyondSwordSave" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".CivBeyondSwordWBSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".CivBeyondSwordWBSave", , "CivBeyondSwordWBSave" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4BeyondSword.exe" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4BeyondSword.exe\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4BeyondSword.exe\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4BeyondSword.exe\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Applications\Civ4BeyondSword.exe\shell\open\command", , """" & Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe"" /fxsload=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordReplay" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordReplay", , "Replay" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordReplay\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordReplay\DefaultIcon", , Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordReplay\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordReplay\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordReplay\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordReplay\shell\open\command", , """" & Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe"" /fxsload=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordSave", , "Save Game" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordSave\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordSave\DefaultIcon", , Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordSave\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordSave\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordSave\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordSave\shell\open\command", , """" & Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe"" /fxsload=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave", , "WordBuilder Save" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave\DefaultIcon", , Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivBeyondSwordWBSave\shell\open\command", , """" & Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe"" /fxsload=""%1""" If Err > 0 Then RegCiv4BTSOk = 0 else RegCiv4BTSOk = 1 end if End Sub Sub RegCiv4Warlord() Dim WarlordDir If WarlordsJ = 2 Then WarlordDir = "\Warlords(J)" ElseIf WarlordsJ = 1 Then WarlordDir = "\Warlords" Else Exit Sub End If Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Warlords" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Warlords", "INSTALLDIR", Civ4Folder & WarlordDir Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Warlords", "DEFAULT_LANGUAGE", 9 Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Warlords\1.00.0000" Civ4Reg.CreateKey HKEY_LOCAL_MACHINE, "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Warlords\2.13" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".CivWarlordsReplay" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".CivWarlordsReplay", , "CivWarlordsReplay" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".CivWarlordsSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".CivWarlordsSave", , "CivWarlordsSave" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, ".CivWarlordsWBSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, ".CivWarlordsWBSave", , "CivWarlordsWBSave" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4Warlords.exe" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4Warlords.exe\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4Warlords.exe\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "Applications\Civ4Warlords.exe\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "Applications\Civ4Warlords.exe\shell\open\command", , """" & Civ4Folder & WarlordDir & "\Civ4Warlords.exe"" /fxsload=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsReplay" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsReplay", , "Replay" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsReplay\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsReplay\DefaultIcon", , Civ4Folder & WarlordDir & "\Civ4Warlords.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsReplay\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsReplay\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsReplay\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsReplay\shell\open\command", , """" & Civ4Folder & WarlordDir & "\Civ4Warlords.exe"" /fxsload=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsSave", , "Saved Game" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsSave\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsSave\DefaultIcon", , Civ4Folder & WarlordDir & "\Civ4Warlords.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsSave\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsSave\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsSave\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsSave\shell\open\command", , """" & Civ4Folder & WarlordDir & "\Civ4Warlords.exe"" /fxsload=""%1""" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsWBSave" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsWBSave", , "WorldBuilder Save" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsWBSave\DefaultIcon" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsWBSave\DefaultIcon", , Civ4Folder & WarlordDir & "\Civ4Warlords.exe,1" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsWBSave\shell" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsWBSave\shell\open" Civ4Reg.CreateKey HKEY_CLASSES_ROOT, "CivWarlordsWBSave\shell\open\command" Civ4Reg.SetStringValue HKEY_CLASSES_ROOT, "CivWarlordsWBSave\shell\open\command", , """" & Civ4Folder & WarlordDir & "\Civ4Warlords.exe"" /fxsload=""%1""" If Err > 0 Then RegCiv4WarlordOk = 0 else RegCiv4WarlordOk = 1 end if End Sub Sub UNinstallBTSReg() strUNinstall = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{32E4F0D2-C135-475E-A841-1D59A0D22989}" Civ4Reg.CreateKey HKEY_LOCAL_MACHINE,strUNinstall Set WshShell = Wscript.CreateObject("Wscript.Shell") Set WshSysEnv = WshShell.Environment("Process") winBoot = WshSysEnv("SYSTEMDRIVE") Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "UninstallString", winBoot & "\Program Files\InstallShield Installation Information\{32E4F0D2-C135-475E-A841-1D59A0D22989}\setup.exe -runfromtemp -l0x0009 -removeonly" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "LogFile", winBoot & "\Program Files\InstallShield Installation Information\{32E4F0D2-C135-475E-A841-1D59A0D22989}\setup.ilg" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "InstallLocation", Civ4Folder & "\Beyond the Sword" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "ProductGuid", "{32E4F0D2-C135-475E-A841-1D59A0D22989}" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "InstallSource", "H:\" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "DisplayName", "Sid Meier's Civilization 4 - Beyond the Sword" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "Publisher", "Firaxis Games" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "URLInfoAbout", "http://www.2kgames.com/civ4" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "HelpLink", "http://www.2kgames.com/civ4/support.htm" Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "Readme", Civ4Folder & "\Beyond the Sword\Readme.htm" dim temRegValue Civ4Reg.GetStringValue HKEY_LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", temRegValue Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "RegCompany", temRegValue Civ4Reg.GetStringValue HKEY_LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOwner", temRegValue Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "RegOwner", temRegValue Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "DisplayIcon", Civ4Folder & "\Beyond the Sword\Civ4BeyondSword.exe" Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "NoModify", 1 Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "NoRemove", 0 Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "NoRepair", 1 Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "InstallDate", Year(now) & right("0" & Month(now),2) & right("0" & Day(now),2) Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "Language", 9 DisplayVer = "3.01" if RegBts319 = 1 then DisplayVer = "3.19" end if Civ4Reg.SetStringValue HKEY_LOCAL_MACHINE, strUNinstall, "DisplayVersion", DisplayVer VerHex = 03000000 if RegBts319 = 1 then VerHex = 03130000 end if Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "Version", HEX_to_DEC(VerHex) Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "MajorVersion", 3 MinVerHex = 0 if RegBts319 = 1 then MinVerHex = HEX_to_DEC(13) end if Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "MinorVersion", MinVerHex Civ4Reg.SetDWORDValue HKEY_LOCAL_MACHINE, strUNinstall, "LogMode", 1 End Sub Function HEX_to_DEC(byval Hex) Hex = UCase(Hex) For i = 1 To Len(Hex) Select Case Mid(Hex, Len(Hex) - i + 1, 1) Case "0": B = B + 16 ^ (i - 1) * 0 Case "1": B = B + 16 ^ (i - 1) * 1 Case "2": B = B + 16 ^ (i - 1) * 2 Case "3": B = B + 16 ^ (i - 1) * 3 Case "4": B = B + 16 ^ (i - 1) * 4 Case "5": B = B + 16 ^ (i - 1) * 5 Case "6": B = B + 16 ^ (i - 1) * 6 Case "7": B = B + 16 ^ (i - 1) * 7 Case "8": B = B + 16 ^ (i - 1) * 8 Case "9": B = B + 16 ^ (i - 1) * 9 Case "A": B = B + 16 ^ (i - 1) * 10 Case "B": B = B + 16 ^ (i - 1) * 11 Case "C": B = B + 16 ^ (i - 1) * 12 Case "D": B = B + 16 ^ (i - 1) * 13 Case "E": B = B + 16 ^ (i - 1) * 14 Case "F": B = B + 16 ^ (i - 1) * 15 End Select Next HEX_to_DEC = B End Function Sub main() Call testValue() If doCiv4Reg = 1 Then Call RegCiv4() If doCiv4BTSReg = 1 Then Call RegCiv4BTS() If RegCiv4BTSOk = 1 then Call UNinstallBTSReg() end if End If If doCiv4WarlordReg = 1 Then Call RegCiv4Warlord() End If End If End Sub '----------------------------- Call Sub ---------------------------------------------------------------- Call main() '----------------------------- End Message ------------------------------------------------------------- If Err > 0 Then errmsg = MsgBox("代号:"& Err, vbOKOnly+VbExclamation,"过程执行出错") Err.Clear End If If doCiv4Reg <> 1 Then nofind = MsgBox("冇揾到 Civilization4.exe", vbOKOnly+VbExclamation,"放错目录?") wscript.quit End If dim showtext If RegCiv4Ok = 1 and doCiv4Reg = 1 Then showtext = showtext & "文明4恢复" & chr(13) & chr (10) else if RegCiv4Ok <> 1 and doCiv4Reg = 1 then showtext = showtext & "文明4恢复出错" & chr(13) & chr (10) end if End If If RegCiv4BTSOk = 1 and doCiv4BTSReg = 1 Then showtext = showtext & "BTS恢复" & chr(13) & chr (10) else if RegCiv4BTSOk <> 1 and doCiv4BTSReg = 1 then showtext = showtext & "BTS恢复出错" & chr(13) & chr (10) end if End If If RegCiv4WarlordOk = 1 and doCiv4WarlordReg = 1 Then if WarlordsJ = 1 then showtext = showtext & "Warlord恢复" & chr(13) & chr (10) else if WarlordsJ = 2 then showtext = showtext & "Warlord(J)恢复" & chr(13) & chr (10) end if end if else if RegCiv4WarlordOk <> 1 and doCiv4WarlordReg = 1 then showtext = showtext & "Warlord恢复出错" & chr(13) & chr (10) end if End If endmsg1 = MsgBox(showtext, vbOKOnly+VbInformation, "结果") |
用vbs修复文明4的注册表
这是一段VBS代码,用于修复文明4和各个资料片的注册表,包括版本Civ4 1.74,Warlords 2.13,BTS 3.13,3.19,自动判断是否装了汉化包。
《用vbs修复文明4的注册表》有0个评分
★★★★★
★★★★
★★★
★★
★