BtS Mod Install Script

Something I just noticed when uploading these was the optional add on script has 72 downloads itself, but I have yet to see a mod use it (Does anyone even use this script?). Overall these 4 scripts have around 200 downloads, yet I doubt more then a dozen mods use these scritps. So who exactly is doing the majority of the downloads, and why? Not that I mind, I like seeing my work used, but I'm just curious, because the download volume just doesn't make sense.
 
NAME and MOD_LOC are two different things. This is so the text works out, especially in the patching script. There are three references to the mod. MOD_LOC is the name of the folder the mod is in. NAME is the full name of your mod. SHORT_NAME is the shorthand/nick name of your mod. This is so that the text in in the installer pages sounds correctly. For functionalitie's sake, all you need to have be right is MOD_LOC, as it's the only constant used in the script functions. NAME and SHORT_NAME are only referenced in the text of the script itself. I commented the begining of the script pretty thouroughly, it should be clear:

Code:
;--------------------------------
  ;Constants
  ;These are the variables you need to define for your mod

  !define NAME "MY_MOD_NAME" ;Full Name of Mod
  !define VERSION "X.X.X" ;Mod Version Number

  !define MOD_LOC "MOD_FOLDER" ;Name of Mod Folder
  !define SHORT_NAME "MOD_NICK" ;Shorthand/nick of your mod

  !define MYBTSDIR "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword" ;Path where your Beyond the Sword .exe is
  !define MYCLSDIR "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\${MOD_LOC}" ;Path where your mod is (Leave ${MOD_LOC} on the end of the path)
  
  !define RAW_ICON "someicon.ico"	;place your icon in your mod folder change someicon to the icon's name
 
  ;You should not need to change anything below this line
  
  !define ICON "${MYCLSDIR}\${RAW_ICON}" 
  !define MUI_ICON "${ICON}"
  
  !define FIRAXIS_REG_ROOT "HKLM"
  !define FIRAXIS_REG_KEY "Software\Firaxis Games"
  !define BTSREGKEY "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword"

;--------------------------------

If you're in serious doubt though, or are wondering how to improve things, just browse through the script, three are comments all through it, every section is clearly labeled with a comment saying what it does.
 
Something I just noticed when uploading these was the optional add on script has 72 downloads itself, but I have yet to see a mod use it (Does anyone even use this script?). Overall these 4 scripts have around 200 downloads, yet I doubt more then a dozen mods use these scritps. So who exactly is doing the majority of the downloads, and why? Not that I mind, I like seeing my work used, but I'm just curious, because the download volume just doesn't make sense.
Lots of possible reasons.
-Single users can contribute to the count several times by downloading several times IIUC.
-Downloading one of the scripts, you could very well download the others. They are small downloads after all. I downloaded the one with addons before I realised it was the simpler one I should have downloaded.
-Some people download it and then can't get it to work? It does require using NSIS.
 
Well I guess the lack of comments means the new scripts are working perfectly :)

What mods use installers now anyway?

I know Legends of Revolution, Mars Now, History of the Three Kingdoms, ACO, and BUG and FFH2 do (though BUG and FFH2 don't use these scripts). Anyone else have their mods set up with an easy to use installer? I'm kind of interested in compiling a list of easy to install mods.
 
Yeah, Icon use for shortcuts has been fixed. In the old version it only worked for users that had the same install path as the person that compiled the script. The new version also has 4 seperate checks for the BtS registry so thta it works for complete and gold, you might want to take a look at the new scripts. Also it fixes the start menu shortcut creation, so that users can pick and choose where tehy want the start menu shortcut to be placed.
 
If I wanted to adopt one of these installers for a Civilization IV Colonization mod, what would I need to do? Or can I do it in the first place?
 
You would need to change the registry check, and install directory, and the check for the BtS exe. It would be pretty straightforward, but you'd need some knowledge of coding to do it. The script is well commented though, so it would be relatively simple and obvious how to do it if you have a little coding knowledge.
 
Hi phungus,

is it possible to enable user to choose language for the installer? I want to make one installer that has both English and Chinese.
 
Yeah, it's definatly possible. I didn't set up multiple languages in it, but NSIS is designed to support others, all it would take is a little copy and pasting, and adding the !include for language support. I'm not positive Chinese is supported by NSIS, but I'd assume so, almost as many people speak Mandarin on the planet as speak english. I'm not entirely sure how to set that up though, I'd ask in the BUG forums because they include mulitple languages there, and since you'd be the one translating, all they need to do is point you toward the macros you insert to do it. You can also check in the NSIS forums, I'm sure there is an example code section for languages (there are for everything else). I'd really like to set up this script with mulitple language support, and if you set up the format I'll definatly add a Spanish section to the general script. Unfortunately right now I'm stopping work on any projects here, so I wol't be able to code it in myself. I'm sure though the BUG team can show you how to do it with this script (and you might be able to figure it out yourself browsing through the NSIS example code website).
 
I think I changed everything to convert to Col. I'm assuming the registry keys are found in the Software\[Program Files Path]? So Colonization, which has a default directory of 2K Games\Firaxis Games, would be Software\2K Games\Firaxis Games?

Code:
  !define FIRAXIS_REG_ROOT "HKLM"
  !define FIRAXIS_REG_KEY "Software\2K Games\Firaxis Games"
  !define BTSREGKEY "SOFTWARE\2K Games\Firaxis Games\Firaxis Games\Sid Meier's Civilization 4 Colonization"

I changed all the "Civ4BeyondSword.exe" to "Colonization.exe", and then altered the "find INSTDIR1" function to look like this:

Code:
  Function findINSTDIR1

	Push $0
	
	#Quick BTS registry Check
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${BTSREGKEY}" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $INSTDIR1 $0
		Goto done
	${EndIf}
	
	#If fails look for other possible Registry Keys to Find the BtS folder
	# standard Civ4:BTS
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${FIRAXIS_REG_KEY}\Sid Meier's Civilization 4 Colonization" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $INSTDIR1 $0
		Goto done
	${EndIf}

	
	# Civ4 Complete
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${FIRAXIS_REG_KEY}\Sid Meier's Civilization 4 Complete" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $0 "$0\Colonization"
		${If} ${FileExists} $0
			StrCpy $INSTDIR1 $0
			Goto done
		${EndIf}
	${EndIf}
	
  done:
	Pop $0

I'm assuming this is correct? I'm not entirely sure of the Col registry stuff.
 
Assuming that is correct for Col's registry key, that should be it, yes, but I doubt the reg key is correct:
!define BTSREGKEY "SOFTWARE\2K Games\Firaxis Games\Firaxis Games\Sid Meier's Civilization 4 Colonization"
You should ask Dale or someone that knows what the registry key is for colonization, someone knows. Also if I were you, I'd change the name of the constant BTSREGKEY to COLREGKEY, so it's consistent, and doesn't confuse other users (or yourself).
 
@stmartin

Did you ever look into adding multiple language support? If you have I'd like to add it to the main script.
 
OK, well if you ever decide to tackle this let me know, and I'll definatly include it, might even try to work on it as well. Best bet is to ask in the BUG forums, as BUG uses the languages, and I'll jump in and do what I can to help make this work if you start to decide to work on this. I still think it'd be pretty easy, but I myself am not prepared to make the first steps, as it were.
 
Top Bottom