
But, I think there's also a way to extract the htti tool from the hitiles installer.
Moderators: Lone Wolf, Snake Man
Htti.exe does not need an existing F4 registry key or install. Might even work without an AF regkey, as it actually defaults to the ol' falcon 4 registry path if run without switches. It works just like SPTinstall does, ie, the same switches work and they work the same way. Htti.exe seems to be nothing more than a Lp modded version of SPTinstall for a AF regkey path but they seemed to integrate some sort of Lx normals fix.Snake Man wrote:
So does anyone know for a fact that htti.exe wont need anything on the registry? Yet I still think we need to make just brand new util, one which replaces SPTInstall.exe and LxNormalFix.exe utils...
Your installer is broken for AF users without F4 installed.Snake Man wrote:I have always hated installers for GAME ADDONS that fuck up your registry, am I now becoming one of these loosers who do such installers?
I dont think so!
SPTinstall = Needs F4 paths (baseDir / theaterdir) in registrySnake Man wrote:
So again to recap one more time, without SPTInstall there is or isn't any problem with the not having Falcon 4.0 installed but just AF? Ie if we get a new util, the NSIS installer works ok or not?
Ok. So, we know what the "new" installer subdir is going to be, so we just check if that directory already exists, and if it is there, we prompt to either delete the subdir or cancel the installation?Snake Man wrote:The goal is to not have older versions installed.
That's what testing is for.The installer could ask the user if he wants to delete the older installs and if user chooses yes, it would nuke all the specified dirs (three known hardcoded locations now). But I hope this is safe so it wont delete anything else except the specified dirs.
LMAOSnake Man wrote:Its a pain but... well damn, if I wanted a easy life I would be a looser in frugals with big signature bitching about everything. Go figure.
Code: Select all
RMDir "$0\Theaters\${TNAME}\objects\F4AF"
This is one of the quirks of NSIS.Snake Man wrote:Well it aint, dunno whats wrong, I dont see anything wrong in that cmd line so hum, any ideas?Code: Select all
RMDir "$0\Theaters\${TNAME}\objects\F4AF"
Code: Select all
RMDir "$0\Theaters\${TNAME}\objects\F4AF"
Code: Select all
RMDir "$0\Theaters\${TNAME}\objects\F4AF\*.*"
Code: Select all
RMDir /r "$0\Theaters\${TNAME}\objects\F4AF"
Code: Select all
; unpack the theater files
; this is the subdir in the developer's PC that has the files for AF
File /r "Theater_src_${TNAME}\*.*"
Code: Select all
; unpack the theater files
; this is the subdir in the developer's PC that has the files for AF
File /r "Theater_src_${TNAME}\*.*"
; database copy
StrCmp $7 "OF" DataBaseOF
StrCmp $7 "RV" DataBaseRV
; database AF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\AF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy
DataBaseOF:
; database OF
;CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\OF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy
DataBaseRV:
; database RV
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\RV\*.*" "$0\Theaters\${TNAME}\objects\"
EndOfDataBaseCopy:
RMDir /r "$0\Theaters\${TNAME}\objects\F4AF\"
RMDir /r "$0\Theaters\${TNAME}\objects\RV\"
RMDir /r "$0\Theaters\${TNAME}\objects\OF\"
Code: Select all
; unpack the theater files
; this is the subdir in the developer's PC that has the files for AF
File /r "Theater_src_${TNAME}\*.*"
Code: Select all
; unpack the theater files
; this is the subdir in the developer's PC that has the files for AF
File /r "Theater_src_${TNAME}\*.*"
Code: Select all
; database copy
StrCmp $7 "OF" DataBaseOF
StrCmp $7 "RV" DataBaseRV
; database AF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\AF\*.*" "$0\Theaters\${TNAME}\objects"
goto EndOfDataBaseCopy
Code: Select all
DataBaseOF:
; database OF
;CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\OF\*.*" "$0\Theaters\${TNAME}\objects"
goto EndOfDataBaseCopy
Code: Select all
DataBaseRV:
; database RV
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\RV\*.*" "$0\Theaters\${TNAME}\objects"
EndOfDataBaseCopy:
RMDir /r "$0\Theaters\${TNAME}\objects\F4AF"
RMDir /r "$0\Theaters\${TNAME}\objects\RV"
RMDir /r "$0\Theaters\${TNAME}\objects\OF"
Code: Select all
; database objects (same dir for all versions)
CopyFiles /filesonly "$0\terrdata\objects\*.*" "$0\Theaters\${TNAME}\objects\"
heheheSnake Man wrote:I'm having a little bit problems when implementing the delete previous theater dirs thingy. Dunno if its your example or my trying ot use it, but it said checkprevious and $errcode variable was not used.
Code: Select all
!define TNAME "DesertStorm"
!define FRIENDLYNAME "PMC Operation Desert Storm Theater Installer"
!define APP "DesertStormInstaller"
;for some reason, this has to be #.#.#.# but I usually change the name after I build the exe
!define VER "0.0.0.6"
; these establish some things about the installer the most important one to me is the outfile
Name "${FRIENDLYNAME}"
; outfile is the name of the installer. Unless otherwise set, it will be the same directory as where the script is
OutFile "PMC_${TNAME}_Theater_v${VER}.exe"
Caption "${FRIENDLYNAME}"
; these VI definitions are what is displayed if you hover the mouse over the icon
VIProductVersion "${VER}"
VIAddVersionKey ProductName "${FRIENDLYNAME}"
VIAddVersionKey Comments "Installs the Operation Desert Storm theater."
VIAddVersionKey LegalCopyright "PMC Tactical"
VIAddVersionKey FileDescription "${FRIENDLYNAME}"
VIAddVersionKey FileVersion "${VER}"
VIAddVersionKey ProductVersion "${VER}"
VIAddVersionKey InternalName "${FRIENDLYNAME}"
;=== Runtime Switches
; the CRC check is something I use on bigger installers to make sure everything checks out.
CRCCheck On
; this makes it more efficient
AutoCloseWindow True
; this is something I use to make sure it uses the LZMA compression, which I believe is the best
SetCompressor lzma
; branding text is just something that's displayed at the bottom of the installer
BrandingText "http://www.pmctactical.org"
;=== Includes - this will include the necessary dlls and functions that I use in the installer
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "Registry.nsh"
!include "WinMessages.nsh"
!include "TextFunc.nsh"
!include "Sections.nsh"
; MUI Settings - the MUI is the Modern UI for NSIS, this section defines its parameters (there are alot more that I don't use)
!define MUI_ABORTWARNING
!define MUI_INSTALLCOLORS /windows
; Welcome page - this is the first page of the installer (I also have a snippet for a splashscreen, but we'll keep this simple)
;!define MUI_WELCOMEFINISHPAGE_BITMAP "@@:\FF4Installers\leftgraphic.bmp"
; using the variables means we don't have to remember to change all these when we use the template for another theater
!define MUI_WELCOMEPAGE_TITLE "${FRIENDLYNAME} ${VER} Setup Wizard"
!define MUI_WELCOMEPAGE_TEXT "Setup will install ${FRIENDLYNAME} ${VER} into your Falcon installation."
!insertmacro MUI_PAGE_WELCOME
!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "Theater_src_${TNAME}\Theaters\${TNAME}\EULA.txt"
; Instfiles page
!define MUI_FINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_PAGE_INSTFILES
; Finish page - this is the last page people see
!define MUI_FINISHPAGE_TITLE "${FRIENDLYNAME} ${VER} Installation completed."
!define MUI_FINISHPAGE_TEXT "Click 'Finish' to close this wizard."
!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
; now we're ready for the actual installer!
Section "Installer" SEC01
; F4registry check - if no F4 registry, it kicks to the end - the $0 is a variable that holds the -1 (not found) or 0 (found)
; we can also start to determine which install we have
${registry::KeyExists} "HKLM\Software\MicroProse\Falcon\4.0" $0
${registry::KeyExists} "HKLM\Software\Lead Pursuit\Battlefield Operations\Falcon" $1
; IntCmp compares the integer in $0 with our number (0) and if it is =, it goes to label "F4Exists"
IntCmp $0 0 F4Exists
IntCmp $1 0 AFInstall
; this copies the string to $9 - I'm using that as an error label
StrCpy $9 "No appropriate registry found."
Goto Error
F4Exists:
; this determines if there's an AF reg entry, and if so, it only advances 1 line, if not, it goes to F4Install
IntCmp $1 0 0 F4Version
; at this point, we need to determine if the person wants to install over "original" F4 or RV
Messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "" "Select where you want the theater installed." "OF/RV" "AF" IDCANCEL
; this places the response 1, 2, or 3, into $0
Pop $0
IntCmp $0 3 Finish
IntCmp $0 2 AFInstall
F4Version:
; now we know they want OF/RV so we need to differentiate - I'm only going to look for RV, if it isn't RV, I'm going to assume OF for now
; this will also validate the install a bit
; this reads the specified registry value into $0
ReadRegStr $0 HKLM "Software\MicroProse\Falcon\4.0" "basedir"
; if the file exists, go to next line (don't skip a line) if it doesn't, go to label "NoFileFound"
IfFileExists $0\theater.lst 0 NoFileFound
IfFileExists $0\terrdata\objects\KoreaObj.Dxl RVFound
IfFileExists $0\terrdata\objects\KoreaObj.lod OFFound NoFileFound
NoFileFound:
StrCpy $9 "No F4 install found."
Goto Error
; I want to set up a variable to differentiate OF and RV
RVFound:
; we'll use this for the lstupdate variable
StrCpy $8 "F4"
StrCpy $7 "RV"
Goto F4Install
OFFound:
StrCpy $8 "F4"
StrCpy $7 "OF"
Goto F4Install
AFInstall:
; get the AF base directory into a variable
ReadRegStr $0 HKLM "Software\Lead Pursuit\Battlefield Operations\Falcon" "basedir"
; sets the right campaign directory
StrCpy $1 "$0\campaign\korea" ; campaing\save string
StrCpy $2 "$0\Utilities\LxNormalFix.exe $$LP @${TNAME} @$0\Theaters\${TNAME}\terrdata" ; lxnormalfix string
StrCpy $8 "AF"
Goto CreateDirs
F4Install:
ReadRegStr $0 HKLM "Software\MicroProse\Falcon\4.0" "basedir"
StrCpy $1 "$0\campaign\save"
StrCpy $2 "$0\Utilities\LxNormalFix.exe @${TNAME} @$0\Theaters\${TNAME}\terrdata"
CreateDirs:
SetOutPath $0
CreateDirectory "$0\Theaters\${TNAME}\campaign\DesertStorm1"
CreateDirectory "$0\Theaters\${TNAME}\campaign\DesertStorm2"
CreateDirectory "$0\Theaters\${TNAME}\campaign\DesertStorm3"
CreateDirectory "$0\Theaters\${TNAME}\art\DesertStorm2\art\resource"
CreateDirectory "$0\Theaters\${TNAME}\art\DesertStorm3\art\resource"
CreateDirectory "$0\Theaters\${TNAME}\terrdata\weather\"
; new intelligent campaing copy files list
CopyFiles /filesonly "$1\*.pri" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.txt" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.b" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.db" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.ia" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dfs" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dat" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.gbd" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.lst" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.idx" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.wch" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\atc.ini" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.aii" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.rt" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.tt" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\validac.*" "$0\Theaters\${TNAME}\campaign\DesertStorm1\"
; then copy it to the two another campaign dirs
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$0\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$0\Theaters\${TNAME}\campaign\DesertStorm3\"
CopyFiles "$0\terrdata\korea\weather\*.*" "$0\Theaters\${TNAME}\terrdata\weather\"
; unpack the theater files
; this is the subdir in the developer's PC that has the files for AF
File /r "Theater_src_${TNAME}\*.*"
; snake try to make campmap and campaign files included only once
;campmap
CopyFiles /filesonly "$0\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$0\Theaters\${TNAME}\art\DesertStorm2\art\resource\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$0\Theaters\${TNAME}\art\DesertStorm3\art\resource\"
;campaign files
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$0\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$0\Theaters\${TNAME}\campaign\DesertStorm3\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$0\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$0\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$0\Theaters\${TNAME}\campaign\DesertStorm3\"
; database copy
StrCmp $7 "OF" DataBaseOF
StrCmp $7 "RV" DataBaseRV
; database AF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\AF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy
DataBaseOF:
; database OF
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\OF\*.*" "$0\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy
DataBaseRV:
; database RV
CopyFiles /filesonly "$0\Theaters\${TNAME}\objects\RV\*.*" "$0\Theaters\${TNAME}\objects\"
EndOfDataBaseCopy:
RMDir /r "$0\Theaters\${TNAME}\objects\F4AF\"
RMDir /r "$0\Theaters\${TNAME}\objects\RV\"
RMDir /r "$0\Theaters\${TNAME}\objects\OF\"
StrCmp $8 "F4" F4curTheater TheaterAdmin
StrCpy $9 "Unknown error before curTheater: $8."
Goto Error
F4curTheater:
; set current theater to new theater
; this reads the specified registry value into $2 for use later
ReadRegStr $3 HKLM "Software\MicroProse\Falcon\4.0" "curTheater"
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "Operation Desert Storm" "REG_SZ" $R0
; if it is an OF install, skip straight to theater admin otherwise, do RV stuff
StrCmp $7 "OF" TheaterAdmin
; this will be the area where we do stuff that it doesn't really matter which install it is
TheaterAdmin:
SetOutPath $0
; plus additional two lstupdate entries
ExecWait "$0\Utilities\lstupdate.exe $8 +Theaters\${TNAME}\${TNAME}1.tdf"
ExecWait "$0\Utilities\lstupdate.exe $8 +Theaters\${TNAME}\${TNAME}2.tdf"
ExecWait "$0\Utilities\lstupdate.exe $8 +Theaters\${TNAME}\${TNAME}3.tdf"
ExecWait '$0\Utilities\SPTinstall.exe -auto "$0\Theaters\${TNAME}\terrdata"'
ExecWait "$0\Utilities\LxNormalFix.exe $2"
; just compress textures if F4 then finish
StrCmp $8 "AF" Finish
ExecWait "$0\Utilities\SeasonSwitcher.exe -0"
MessageBox MB_YESNO "Do you want to make the new theater the current one?" IDYES Finish IDNO OldReg
OldReg:
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "$3" "REG_SZ" $R0
Goto Finish
Error:
Messagebox MB_OK $9
Finish:
SectionEnd
Code: Select all
!define TNAME "DesertStorm"
!define FRIENDLYNAME "PMC Operation Desert Storm Theater Installer"
!define APP "DesertStormInstaller"
;for some reason, this has to be #.#.#.# but I usually change the name after I build the exe
!define VER "0.0.0.6"
; define other variables to free up generic ones
var F4root
var ErrCode
var F4ver
var F4subver
; these establish some things about the installer the most important one to me is the outfile
Name "${FRIENDLYNAME}"
; outfile is the name of the installer. Unless otherwise set, it will be the same directory as where the script is
OutFile "PMC_${TNAME}_Theater_v${VER}.exe"
Caption "${FRIENDLYNAME}"
; these VI definitions are what is displayed if you hover the mouse over the icon
VIProductVersion "${VER}"
VIAddVersionKey ProductName "${FRIENDLYNAME}"
VIAddVersionKey Comments "Installs the Operation Desert Storm theater."
VIAddVersionKey LegalCopyright "PMC Tactical"
VIAddVersionKey FileDescription "${FRIENDLYNAME}"
VIAddVersionKey FileVersion "${VER}"
VIAddVersionKey ProductVersion "${VER}"
VIAddVersionKey InternalName "${FRIENDLYNAME}"
;=== Runtime Switches
; the CRC check is something I use on bigger installers to make sure everything checks out.
CRCCheck On
; this makes it more efficient
AutoCloseWindow True
; this is something I use to make sure it uses the LZMA compression, which I believe is the best
SetCompressor lzma
; branding text is just something that's displayed at the bottom of the installer
BrandingText "http://www.pmctactical.org"
;=== Includes - this will include the necessary dlls and functions that I use in the installer
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "Registry.nsh"
!include "WinMessages.nsh"
!include "TextFunc.nsh"
!include "Sections.nsh"
; MUI Settings - the MUI is the Modern UI for NSIS, this section defines its parameters (there are alot more that I don't use)
!define MUI_ABORTWARNING
!define MUI_INSTALLCOLORS /windows
; Welcome page - this is the first page of the installer (I also have a snippet for a splashscreen, but we'll keep this simple)
;!define MUI_WELCOMEFINISHPAGE_BITMAP "@@:\FF4Installers\leftgraphic.bmp"
; using the variables means we don't have to remember to change all these when we use the template for another theater
!define MUI_WELCOMEPAGE_TITLE "${FRIENDLYNAME} ${VER} Setup Wizard"
!define MUI_WELCOMEPAGE_TEXT "Setup will install ${FRIENDLYNAME} ${VER} into your Falcon installation."
!insertmacro MUI_PAGE_WELCOME
!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "Theater_src_${TNAME}\Theaters\${TNAME}\EULA.txt"
; Instfiles page
!define MUI_FINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_PAGE_INSTFILES
; Finish page - this is the last page people see
!define MUI_FINISHPAGE_TITLE "${FRIENDLYNAME} ${VER} Installation completed."
!define MUI_FINISHPAGE_TEXT "Click 'Finish' to close this wizard."
!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
; now we're ready for the actual installer!
Section "Installer" SEC01
; F4registry check - if no F4 registry, it kicks to the end - the $0 is a variable that holds the -1 (not found) or 0 (found)
; we can also start to determine which install we have
${registry::KeyExists} "HKLM\Software\MicroProse\Falcon\4.0" $0
${registry::KeyExists} "HKLM\Software\Lead Pursuit\Battlefield Operations\Falcon" $1
; IntCmp compares the integer in $0 with our number (0) and if it is =, it goes to label "F4Exists"
IntCmp $0 0 F4Exists
IntCmp $1 0 AFInstall
; this copies the string to $ErrCode - I'm using that as an error label
StrCpy $ErrCode "No appropriate registry found."
Goto Error
F4Exists:
; this determines if there's an AF reg entry, and if so, it only advances 1 line, if not, it goes to F4Install
IntCmp $1 0 0 F4Version
; at this point, we need to determine if the person wants to install over "original" F4 or RV
Messagebox::show MB_DEFBUTTON3|MB_TOPMOST "" "" "Select where you want the theater installed." "OF/RV" "AF" IDCANCEL
; this places the response 1, 2, or 3, into $0
Pop $0
IntCmp $0 3 Finish
IntCmp $0 2 AFInstall
F4Version:
; now we know they want OF/RV so we need to differentiate - I'm only going to look for RV, if it isn't RV, I'm going to assume OF for now
; this will also validate the install a bit
; this reads the specified registry value into $0
ReadRegStr $F4root HKLM "Software\MicroProse\Falcon\4.0" "basedir"
; if the file exists, go to next line (don't skip a line) if it doesn't, go to label "NoFileFound"
IfFileExists $F4root\theater.lst 0 NoFileFound
IfFileExists $F4root\terrdata\objects\KoreaObj.Dxl RVFound
IfFileExists $F4root\terrdata\objects\KoreaObj.lod OFFound NoFileFound
NoFileFound:
StrCpy $ErrCode "No F4 install found."
Goto Error
; I want to set up a variable to differentiate OF and RV
RVFound:
StrCpy $F4ver "F4"
StrCpy $F4subver "RV"
Goto F4Install
OFFound:
StrCpy $F4ver "F4"
StrCpy $F4subver "OF"
Goto F4Install
AFInstall:
; get the AF base directory into a variable
ReadRegStr $F4Root HKLM "Software\Lead Pursuit\Battlefield Operations\Falcon" "basedir"
; sets the right campaign directory
StrCpy $1 "$F4Root\campaign\korea" ; campaing\save string
StrCpy $2 "$F4Root\Utilities\LxNormalFix.exe $$LP @${TNAME} @$F4Root\Theaters\${TNAME}\terrdata" ; lxnormalfix string
StrCpy $F4Ver "AF"
Goto CreateDirs
F4Install:
ReadRegStr $F4Root HKLM "Software\MicroProse\Falcon\4.0" "basedir"
StrCpy $1 "$F4Root\campaign\save"
StrCpy $2 "$F4Root\Utilities\LxNormalFix.exe @${TNAME} @$F4Root\Theaters\${TNAME}\terrdata"
CreateDirs:
SetOutPath $F4Root
CreateDirectory "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1"
CreateDirectory "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2"
CreateDirectory "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3"
CreateDirectory "$F4Root\Theaters\${TNAME}\art\DesertStorm2\art\resource"
CreateDirectory "$F4Root\Theaters\${TNAME}\art\DesertStorm3\art\resource"
CreateDirectory "$F4Root\Theaters\${TNAME}\terrdata\weather\"
SetOutPath "$F4root\Theaters\${TNAME}"
; new intelligent campaing copy files list
CopyFiles /filesonly "$1\*.pri" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.txt" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.b" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.db" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.ia" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dfs" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.dat" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.gbd" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.lst" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.idx" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\*.wch" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\atc.ini" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.aii" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.rt" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\falcon4.tt" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
CopyFiles /filesonly "$1\validac.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\"
; then copy it to the two another campaign dirs
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\*.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3\"
CopyFiles "$F4Root\terrdata\korea\weather\*.*" "$F4Root\Theaters\${TNAME}\terrdata\weather\"
; unpack the theater files
; this is the subdir in the developer's PC that has the files for AF
File /r "Theater_src_${TNAME}\*.*"
; snake try to make campmap and campaign files included only once
;campmap
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$F4Root\Theaters\${TNAME}\art\DesertStorm2\art\resource\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\art\DesertStorm1\art\resource\campmap.*" "$F4Root\Theaters\${TNAME}\art\DesertStorm3\art\resource\"
;campaign files
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\desertstorm.*" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm2\"
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\campaign\DesertStorm1\kneemap.gif" "$F4Root\Theaters\${TNAME}\campaign\DesertStorm3\"
; database copy
StrCmp $F4subver "OF" DataBaseOF
StrCmp $F4subver "RV" DataBaseRV
; database AF
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\objects\AF\*.*" "$F4Root\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy
DataBaseOF:
; database OF
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\objects\OF\*.*" "$F4Root\Theaters\${TNAME}\objects\"
goto EndOfDataBaseCopy
DataBaseRV:
; database RV
CopyFiles /filesonly "$F4Root\Theaters\${TNAME}\objects\RV\*.*" "$F4Root\Theaters\${TNAME}\objects\"
EndOfDataBaseCopy:
RMDir /r "$F4Root\Theaters\${TNAME}\objects\F4AF\"
RMDir /r "$F4Root\Theaters\${TNAME}\objects\RV\"
RMDir /r "$F4Root\Theaters\${TNAME}\objects\OF\"
StrCmp $F4ver "F4" F4curTheater TheaterAdmin
StrCpy $ErrCode "Unknown error before curTheater: $F4ver."
Goto Error
F4curTheater:
; set current theater to new theater
; this reads the specified registry value into $3 for use later
ReadRegStr $3 HKLM "Software\MicroProse\Falcon\4.0" "curTheater"
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "Operation Desert Storm" "REG_SZ" $R0
; if it is an OF install, skip straight to theater admin otherwise, do RV stuff
StrCmp $F4subver "OF" TheaterAdmin
; this will be the area where we do stuff that it doesn't really matter which install it is
TheaterAdmin:
SetOutPath "$F4Root\Utilities"
; plus additional two lstupdate entries
ExecWait "$F4Root\Utilities\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}1.tdf"
ExecWait "$F4Root\Utilities\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}2.tdf"
ExecWait "$F4Root\Utilities\lstupdate.exe $F4ver +Theaters\${TNAME}\${TNAME}3.tdf"
ExecWait '$F4Root\Utilities\SPTinstall.exe -auto "$F4Root\Theaters\${TNAME}\terrdata"'
ExecWait "$F4Root\Utilities\LxNormalFix.exe $2"
; just compress textures if F4 then finish
StrCmp $F4ver "AF" Finish
ExecWait "$F4Root\Utilities\SeasonSwitcher.exe -0"
MessageBox MB_YESNO "Do you want to make the new theater the current one?" IDYES Finish IDNO OldReg
OldReg:
${registry::Write} "hklm\SOFTWARE\MicroProse\Falcon\4.0" "curTheater" "$3" "REG_SZ" $R0
Goto Finish
Error:
Messagebox MB_OK $ErrCode
Finish:
SectionEnd
Hey NP Snake Man.... LOL.Snake Man wrote:I tested the htiles (htti* something) terrain rebuilder (SPTinstall) I got from Sherlock, it works fine now on AF-only computer. Thanks goes to Lamurt to do some testing and of course to Sherlock who sent me the terrain rebuilder.
But one fundamental question is, the hitiles are payware, is the htti terrain rebuilder... free for us to use or?
Yeh, the credit does need to go to Khronik, not to me. He was the one who originally suggested it in this thread early on. I just kept bringing it up because I have no life and, thus, more time on the forums!Khronik wrote:Hey NP Snake Man.... LOL.Snake Man wrote:I tested the htiles (htti* something) terrain rebuilder (SPTinstall) I got from Sherlock, it works fine now on AF-only computer. Thanks goes to Lamurt to do some testing and of course to Sherlock who sent me the terrain rebuilder.
But one fundamental question is, the hitiles are payware, is the htti terrain rebuilder... free for us to use or?
Let me know if I can help.Snake Man wrote:I think now as we have all those old theater releases, we should have the installer check for them and prompt for their deletion, T Rex already did this script part for NSIS and now I should implement it somehow. It was just bit complicated to cipher through all the stuff when I last time tried it out.