ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Creating a One-Click-Installer LAN version of Yuri's Revenge

From ModEnc
Revision as of 17:37, 31 May 2012 by Gordon-creAtive (talk | contribs) (First draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This tutorial describes the necessary steps to create a One-Click-Installer version of Yuri's Revenge which is intended for LAN play on modern computers running e.g. Windows 7 and lacking IPX support therefore. This document assumes you're using the english version of the game. This is a fist working draft, but it can be improved on several points. feel free to contribute.

Putting together the original game files

  • Insert your Red Alert 2 disk an install the game. The serial entered during the installation will not be distributed with the final package, so you can safely use your original one. Only install the game itself, uncheck all other options like Westwood Shared Internet Components.
  • Install the last official patch (1.006). It can be found here.
  • Copy the following files from the root of the Allied dics to the directory, where gamemd.exe is located: MAPS01.MIX, MULTI.MIX, THEME.MIX, WDT.MIX and MOVIES01.MIX.
  • Copy the following files from the root of the Soviet dics to the directory, where gamemd.exe is located: MAPS02.MIX and MOVIES02.MIX.
  • Continue by installing the Yuri's Revenge add-on. The same rules apply.
  • Apply the latest patch (1.001) which can be found here.
  • Copy the following files from the root of your Yuri's revenge disc to the directory, where gamemd.exe is located: MAPS03MD.MIX, MULTIMD.MIX, THEMEMD.MIX and MOVMD03.MIX.

Applying community patches

  • Install LaunchBase.
  • Run LaunchBase, click on "Check for Updates/New Mods" in the MenuBar. Install the so-called "YR 1.002 Unofficial Mini-Patch". Start this mod from LaunchBase. Alt-Tab out of the game and kill LaunchBase from the Task'Manager. Never run it again after that! Remove it's folder.
  • Include this DLL in the gamemd.exe directory. It will emulate the IPX protocol ontop UDP and enable LAN play on modern systems.
  • Apply cracks to both games.
  • Apply this patch which optimizes the rendering routines.
  • Get Smurf utilities. Only copy westwood.bik to your gamemd.exe folder. Duplicate the file and anme it ea_wwlogo.bik.

Optional steps

  • Download and install the official mappacks to the directory where gamemd.exe is located.
  • Install the assault mappacks found here and here.
  • Include this resolution fixer in the root directory.
  • Include the "Menu Fix" executable downloadable here in the root folder, so people using Intel graphics and encountering problems can use this tool to fix them.

Creating the installer

  • Download and install NSIS.
  • Create a plain .nis file in the directory above your Red Alert directory.
  • Paste the following code in the file:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Generate a random number using the RtlGenRandom api
;; P1 :out: Random number
;; P2 :in:  Minimum value
;; P3 :in:  Maximum value
;; min/max P2 and P3 values = -2 147 483 647 / 2 147 483 647
;; max range = 2 147 483 647 (31-bit)
;; (Taken from http://nsis.sourceforge.net/Rnd,_Rnd64)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!define Rnd "!insertmacro _Rnd"
!macro _Rnd _RetVal_ _Min_ _Max_
  Push "${_Max_}"
  Push "${_Min_}"
  Call Rnd
  Pop ${_RetVal_}
!macroend
Function Rnd
  Exch $0  ;; Min / return value
  Exch
  Exch $1  ;; Max / random value
  Push "$3"  ;; Max - Min range
  Push "$4"  ;; random value buffer

  IntOp $3 $1 - $0 ;; calculate range
  IntOp $3 $3 + 1
  System::Call '*(l) i .r4'
  System::Call 'advapi32::SystemFunction036(i r4, i 4)'  ;; RtlGenRandom
  System::Call '*$4(l .r1)'
  System::Free $4
  ;; fit value within range
  System::Int64Op $1 * $3
  Pop $3
  System::Int64Op $3 / 0xFFFFFFFF
  Pop $3
  IntOp $0 $3 + $0  ;; index with minimum value

  Pop $4
  Pop $3
  Pop $1
  Exch $0
 FunctionEnd

 Section "Installer Section"
	SetOutPath $INSTDIR
	File /r RA2YR ;The name of your YR folder
	${Rnd} $0 10000 99999
	StrCpy $1 "$0"
	${Rnd} $0 10000 99999
	StrCpy $1 "$1$0"
	${Rnd} $0 10000 99999
	StrCpy $1 "$1$0"
	${Rnd} $0 10000 99999
 	StrCpy $1 "$1$0"
	${Rnd} $0 10 99
	StrCpy $1 "$1$0"
	WriteRegStr HKLM "Software\Westwood\Red Alert 2" "Serial" "$1"
	WriteRegStr HKLM "Software\Westwood\Yuri's Revenge" "Serial" "$1"
SectionEnd
Page directory
Page instfiles
OutFile RA2YR2.exe ;Filename of the installer
  • Customize the script, see comments for help.
  • Compile. You're done.