Fun with installers

phungus420

Deity
Joined
Mar 1, 2003
Messages
6,296
So for Steam Users I know the installer is borked. I can't figure out why. If you're a steam user, and willing to do some work figuring things out and scrounging through your Registry, please post in this thread:

http://forums.civfanatics.com/showthread.php?t=340727

Let us know you have BtS installed, you know it's patched to version 3.19, and you're willing to do a little work to help fix the installer. Emperor Fool, who has more experience with this sort of thing then I do, will then give directions and help us devise some sort of test using a Steam registry to get the installer to recognize that a Steam copy of the game has been updated.

Other non steam users have also reported the installer did not work. This one has been figured out, and should be fixed. I need it tested though to make sure. So if LoR, or Dune Wars did not install correctly, please download this and see if it will install. Also, for future reference if someone on the internet asks you to download and run an executable file of this size, it's generally not a good idea to do so, that's a common way to get a virus. Me though, I've been around on civfanatics for a while, and it's obvious I'm trying to fix my install script, you can look at my post count and history on these boards and reasonably determine that I just need help with this (plus if I wanted to upload malicious software I'd just do it in the main mod's install). So again if you're having issues with the installer, please try this, and see if it works, and let me know. After it installs, just uninstall it, all it is is an icon and a couple text files for me to test that the installer is functionally working. Steam users are welcome to try this too, but I haven't gotten a conclusive result for Steam registry keys for BtS, so I'm not assuming this logic will fix the installer for Steam users (if it does though, great).

I'm uploading the test installer in a zip format, so that I can just attach it to the post. You will need to extract the installer first before running it. Again please let me know if it works or not, and any other useful info you can think of (like if your copy of BtS is steam, or CD complete or whatever).
 
this script installer works fine for me
i have non-steam version on win7
i'm a person who complained that it didn't work it the 9.8 discussion thread
really looking forward to playing 9.8
keep up the good work!!!
 
I have the Steam version of BtS, which is 3.19.
The Script Tester Setup 1.0 fails. It detects that BtS is present but detects it as being not 3.19.

What method do you currently use to detect the version of BtS installed?
If you check a hash of the EXE file, that will fail since Steam versions of games always have patched EXE files, that check for Steam authentication before launching.
 
The method is a registry check, This is the code in the testing install script:

Code:
  Function findINSTDIR1

	Push $0
	#Search for a valid BtS registry key, and get the Install Folder
	
	#look for standard Civ4:BTS
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $INSTDIR1 $0
		!insertmacro IfKeyExists "${LONG_HKLM}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
		Pop $R0
		${If} $R0 == "1"
			StrCpy $CurrentVersion $R0
			Goto done
		${Else}
			!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
			Pop $R0
			${If} $R0 == "1"
				StrCpy $CurrentVersion $R0
				Goto done
			${Else}
				SetShellVarContext all
				!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
				Pop $R0
				${If} $R0 == "1"
					StrCpy $CurrentVersion $R0
					Goto done
				${Else}
					SetShellVarContext current
					!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
					Pop $R0
					StrCpy $CurrentVersion $R0
					Goto done
				${EndIf}
			${EndIf}
		${EndIf}
	${EndIf}

	
	# Civ4 Complete
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${FIRAXIS_REG_KEY}\${COMPLETE_REG}" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $0 "$0\${BTS}"
		${If} ${FileExists} $0
			StrCpy $INSTDIR1 $0
			!insertmacro IfKeyExists "${LONG_HKLM}" "${FIRAXIS_REG_KEY}" "${BTSREG_STANDARD}"
			Pop $R0
			${If} $R0 == "1"
				!insertmacro IfKeyExists "${LONG_HKLM}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
				Pop $R0
				${If} $R0 == "1"
					StrCpy $CurrentVersion $R0
					Goto done
				${Else}
					!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
					Pop $R0
					${If} $R0 == "1"
						StrCpy $CurrentVersion $R0
						Goto done
					${Else}
						SetShellVarContext all
						!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
						Pop $R0
						${If} $R0 == "1"
							StrCpy $CurrentVersion $R0
							Goto done
						${Else}
							SetShellVarContext current
							!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
							Pop $R0
							StrCpy $CurrentVersion $R0
							Goto done
						${EndIf}
					${EndIf}
				${EndIf}
			${Else}
				StrCpy $CurrentVersion "Unknown"
				Goto done
			${EndIf}
		${EndIf}
	${EndIf}
	
	# Civ4 Gold
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${FIRAXIS_REG_KEY}\${GOLD_REG}" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $0 "$0\${BTS}"
		${If} ${FileExists} $0
			StrCpy $INSTDIR1 $0
			!insertmacro IfKeyExists "${LONG_HKLM}" "${FIRAXIS_REG_KEY}" "${BTSREG_STANDARD}"
			Pop $R0
			${If} $R0 == "1"
				!insertmacro IfKeyExists "${LONG_HKLM}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
				Pop $R0
				${If} $R0 == "1"
					StrCpy $CurrentVersion $R0
					Goto done
				${Else}
					!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
					Pop $R0
					${If} $R0 == "1"
						StrCpy $CurrentVersion $R0
						Goto done
					${Else}
						SetShellVarContext all
						!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
						Pop $R0
						${If} $R0 == "1"
							StrCpy $CurrentVersion $R0
							Goto done
						${Else}
							SetShellVarContext current
							!insertmacro IfKeyExists "${LONG_HKCU}" "${FIRAXIS_REG_KEY}\${BTSREG_STANDARD}" "${BTS_VERSION}"
							Pop $R0
							StrCpy $CurrentVersion $R0
							Goto done
						${EndIf}
					${EndIf}
				${EndIf}
			${Else}
				StrCpy $CurrentVersion "Unknown"
				Goto done
			${EndIf}
		${EndIf}
	${EndIf}
	
  ;No BtS registry found, give CurrentVersion a non 1,0 value
  StrCpy $CurrentVersion "null"
  Goto done

  done:
	Pop $0

  FunctionEnd

The variable CurrentVersion is later checked a few times in the script; if it returns a value of 1, that's considered normal. Unknown and null will let the user install, but the user is given a bunch of warnings things might not be right. Only a value of 0 will cause the isntaller to auto abort. The macro !insertmacro IfKeyExists returns $R0 as 1 if it detects the key and 0 if it does not. Please see this thread if you'd like to help out:

http://forums.civfanatics.com/showthread.php?t=340727
 
OK, got to check out Deliverinator's registry, and I have written some steam checks into the install script. Steam sucks though, it doesn't sign a version key to it's installation of BtS. I put in a check for the Application number that had signed itself as BtS in his registry, this may be Steam's version of signing a registry key (though why they'd use App 8800 instead of 3.19 is anyone's guess), however it may also just be some randomly picked user specific number. If your copy of BtS is a Steam version, and the Legends of Revolution/Dune Wars installer did not work, please test out this testing installer. I think I may have it working. Also please let me know what messages you get; I mainly want to know this because of the App 8800 succedes I can use that and remove the rest of the Steam checks, if it doesn't do anything (and thus is user specific for Deliveranator's computer), I can remove that check. Also please uninstall as well, I need to know that it removes the shortcuts correctly, as some of the registry checks require that I set the shellContext of the computer between "all" and "currentuser" in some cases (ie it can't find the normal registry keys), and I need to know that the uninstaller still removes everything correctly in these cases. Attached is the testing installer:
 
This latest installer works fine with my Steam install, but I guess you need other testers...
 
This latest installer works fine with my Steam install, but I guess you need other testers...

Yeah, I know for a fact it'll work on your computer, as I used your comp's registry to base the version checks on.

Also from other users that test this I need to know more then just "it works" (though that is good to know). If it works I need to know if
1)The uninstaller works (all components removed, shortcuts, start menu stuff)
2)The message you get on the "welcome page" and the "choose your install directory" page. Just a basic overview, ie did it say something like "everything looks good, simply click next to begin installation", or does it say something like "something may be wrong here, please make sure you're updated to 3.19". I need to know this to know where in the registry check it's catching, and that'll lead me to maybe trim some unnessary logic from the code.
 
1)The uninstaller works (all components removed, shortcuts, start menu stuff)
Yes
2)The message you get on the "welcome page" and the "choose your install directory" page. Just a basic overview, ie did it say something like "everything looks good, simply click next to begin installation", or does it say something like "something may be wrong here, please make sure you're updated to 3.19".
Click next to continue.
Choose components to install
Autodetection successfully located BtS registry that has been updated to 3.19
Your BtS folder ... (correct)
Click next to begin installation

Run script tester -> BtS starting (is it all?)
I started a Play now! game and I quit.
 
Thanks for the information. I was pretty sure it would install correctly for your computer, and am releived the uninstaller works correctly as well (this was my main concern for users like yourself that have the registry in the "current user" registry instead of the "local machine" registry).
Run script tester -> BtS starting (is it all?)
I started a Play now! game and I quit.
It's not a real mod, all it has are some text files for me to check it installs correctly in the right spot. Just uninstall it.


Now hopefully a couple people with steam versions can test this, it works for them, and then I can update the current version of LoR with the new install logic.
 
Installer ran fine, I checked all the components during install and loaded the mod in game. I was the one who originally posted the problem with the Steam install.
 
Does the uninstaller work correctly, ie does it remove all components (shortcuts, and desktop shortcut folder)?

What message does the installer give you, ie does it seem to imply everything is peachy while installing, or does it keep warning you about needing to be updated to 3.19?
 
Why are no steam users letting me know if the new test installer:

1) Works in general
2) The uninstaller works, and removes all components installed (start menu shortcuts, etc)
3) The message given on the welcome page on install directory (assuming it works). Ie is it warning you about 3.19 and telling you you have a steam version of the game, or is it acting like everything is all good?


This is somewhat frustrating because I can't test this myself, as I don't have a steam copy. This is the only thing holding up release of an update, and I know the current version that's up wol't install for steam users. And all that's required for me to fix this is for a couple of steam users to download the attachment above (script tester 1.2), extract it, and run it, then tell me the answer to the above 3 questions.
 
Phungus,

I am no Steam user, so I can´t help here but I still have 2 suggestions:

  • The title of this thread is "Fun with installers", wouldn´t something like "Need help from Steam users!" be better?
  • Maybe a request in the main CIV4 BTS forum page would also reach more steam users.
 
Ok, I have a Steam version of the game. (sorry I didn't post earlier, I've had finals to take and a senior thesis to write). Just installed the tester:

1)It does work
2)Uninstaller removed all the shortcuts and the folder in the mod directory
3)On the install directory page, it says that it successfully found BtS updated to 3.19

The only problem I've noticed is in the shortcut for the mod. In the target section it ends with mod=\Testing. When trying the shortcut, my computer spits our the error: "Mods\Testing \ is an invalid mod directory, ignoring." This is also what happens when installing LoR as well.

It's not that big a deal because I can manually change the target to:
mod="Testing"
and it works fine. (or entering mod="LoR" for the mod itself)
 
Thanks integer for the response. Actually completely changed the logic for this. Got a new script that isn't nearly as complex, also I will change the shortcut target then; I didn't know it screwd up for some users (works fine on my computer, and worked fine on my friend's computer that has Vista). I'll upload the new script in a couple of minutes if you can check it.
 
OK, here's the new script. I'm sure it will work on all valid installs of BtS. But I just want to make sure the shortcuts work for you. I have changed them to mod="MOD_NAME" as you said worked on your computer, which also works fine on mine.
 
This does not work for me, Dune Wars refuses to install even after I run this. Can you tell me what I can do to help you fix it?
 
The posts and thread itself clearly state that the script is not a fix, I was using it to test if the new install script logic will work. I believe the testing phase is done though, at least I am releasing the 0.9.8b update with the new installer logic shortly, and am currently uploading it to Strategy Informer.
 
Top Bottom