Getting around launch as Admin for mergers

Actually I think I might have gotten it to work. Unfortunately you can't launch a user's web browser though, at least not cleanly, so it's not worth it. But it compiles and installed for me correctly with the abort function. My problem is I have no way to test it to see if it actually fails correctly for a user that does not have BtS 3.19, since my copy is 3.19, and I no longer have a way to install the game (my DVD drive is dead :( , I suppose I could try to torrent a burned copy and emulate with daemon to install, but at this point that's not worth it). I'll try to see if I can get some help from the main forums.

Edit:
I have checked it by switching the logic from != to ==, and when I did I got the correct behavior as if I had a BtS version below 3.19. So I think it works good.

@davidallen
I'm uploading the scrip. Same caveats from previous posts apply. I think though this will work perfectly.
 
You can check for the registry key for 3.19
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword\3.19

Damn, thought I had it working, but was using the wrong variable. I can't get that registry check to work. No matter how I try to use it, it never returns anything. Are you sure that's a valid registry check? If so, how am I supposed to use it in an if statement?
 
That's the registry key that you need to check for--it's not NSIS code. I just copied it out of my registry using regedt32.exe.

I believe the BUG installer checks some registry entries, but it's been a while since I poked around in NSIS, and I only learned what I needed to get BUG's installer to work. I promptly purged my memory when I finished. :p I'll check the script when I get home tonight or this weekend.
 
It's acting like it doesn't exist on my machine :dunno:

Basically if I use the regkey without the 3.19, with the "if file exists operation" I get a result that indicates it does from the installer's behavior. The minute I tack on that 3.19 on the end, my installer fails, and the "if file exists operation" becomes useless.

As an example:
Code:
	# standard Civ4:BTS
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${FIRAXIS_REG_KEY}\Sid Meier's Civilization 4 - Beyond the Sword" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $INSTDIR1 $0
		ReadRegStr $0 ${LONG_HKLM} "${FIRAXIS_REG_KEY}\Sid Meier's Civilization 4 - Beyond the Sword" 'INSTALLDIR'
		Goto RegKeyFound
	${EndIf}
...
  RegKeyFound:
	${If} ${FileExists} $0
		Goto done
	${Else}
		StrCpy $OldVersion "True"
	${EndIf}
Passes the test when I call the variable $OldVersion, it doesn't return "True" (yeah, I know I'm using a string here, instead of a real boolean true/false, but I don't know how to set up a boolean in NSIS). However if I use:
Code:
	# standard Civ4:BTS
	ReadRegStr $0 ${FIRAXIS_REG_ROOT} "${FIRAXIS_REG_KEY}\Sid Meier's Civilization 4 - Beyond the Sword" 'INSTALLDIR'
	${If} ${FileExists} $0
		StrCpy $INSTDIR1 $0
		ReadRegStr $0 ${LONG_HKLM} "${FIRAXIS_REG_KEY}\Sid Meier's Civilization 4 - Beyond the Sword\[B][U]3.19[/U][/B]" 'INSTALLDIR'
		Goto RegKeyFound
	${EndIf}
...
  RegKeyFound:
	${If} ${FileExists} $0
		Goto done
	${Else}
		StrCpy $OldVersion "True"
	${EndIf}
Fails, when I call $OldVersion it returns "True".

:dunno:
 
I just stumbled on this thread...

My problem is that LoR's art guy PMed me stating his computer was fried, and he didn't have money to get another one. That was on Nov12th, and he hasn't logged into civfanatics since. So I don't really know what I should do for my next update to LoR. http://forums.civfanatics.com/showthread.php?t=325642

OT: AchillizesZero's gone? Ouch, that sucks. Civ4 needs more artists as it is...

I figure if the user has installed their copy of BtS in a way that has ruined the registry check, they know enough about computers to patch BtS themselves.

You mean like how I got lazy, and just copy-n-pasted by Civ4 folders, to my new computer? ;)


Okay, quick question. What if we created a shortcut that linked to our mod that also made BTS load as administrator? Then tell users to use the shortcut to load the mod. Wouldn't that be simpler?
 
What if we created a shortcut that linked to our mod that also made BTS load as administrator? Then tell users to use the shortcut to load the mod. Wouldn't that be simpler?

I highly doubt an installer can create a shortcut which allows the application to run as adminstrator. Wouldn't that be a security problem? Also, it seems that phungus has already solved that part of the problem by creating the UserSettings directory. We are just temporarily stuck on finding the registry key to auto-detect an old civ version.
 
In related news, several users have reported problems when they install only a patch version of DW, without installing the main version. To do this, they must overlook the instructions in the download page and also overlook the instructions in the patch installer itself. Still, a check for this in the patch installer would be nice.

Is it possible to also insist that <BTSDIR>/mods/<modname>/<modname>.ini exists before letting the patch install run?
 
I highly doubt an installer can create a shortcut which allows the application to run as adminstrator. Wouldn't that be a security problem?

Windows is a security problem. :lol:

Anyway, YES, you can make a shortcut start a program as an admin. I just checked.

That's my solution anyway. ;)
 
Did you create the shortcut manually, or did you write an install script that created the shortcut? I would hope that setting/creating a shortcut to launch as admin requires entering the admin password.
 
Did you create the shortcut manually, or did you write an install script that created the shortcut? I would hope that setting/creating a shortcut to launch as admin requires entering the admin password.

I did it manually, but if it launches as Admin, and they're running Vista or Win7 with UAC, that stupid popup box will appear.
 
I did it manually, but if it launches as Admin, and they're running Vista or Win7 with UAC, that stupid popup box will appear.

As it should. The point of that popup is to keep non-admins from breaking stuff. When I want to change my firewall settings or install new software on my Ubuntu box at work, I have to enter the root password. This means that no trojan or virus can do these things. That's a Good Thing (tm)!

Granted, Microsoft went a little nuts I think with the UAC, but I haven't used Vista much yet. I am looking to upgrade to W7 though for DirectX 10.
 
As it should. The point of that popup is to keep non-admins from breaking stuff. When I want to change my firewall settings or install new software on my Ubuntu box at work, I have to enter the root password. This means that no trojan or virus can do these things. That's a Good Thing (tm)!

Yeah, but some things, like rm don't cause Ubuntu the slightest problems, or even ask for sudo, and Windows goes nuts over deleting files.

Okay, Okay, I'm splitting hairs at this point. But IHMO, just creating an admin shortcut is the easiest solution.

DX11 is awesome though.
 
Yeah, but some things, like rm don't cause Ubuntu the slightest problems, or even ask for sudo, and Windows goes nuts over deleting files.

As long as you have access to write those files, sure. If not, you need sudo. Vista took the easy path of assuming everything in Programs/ and Windows/ is admin-owned (my assumption). Given where they came from, I think that's a reasonable first step, but I haven't had to deal with that pain yet. ;)

Okay, Okay, I'm splitting hairs at this point. But IHMO, just creating an admin shortcut is the easiest solution.

Maybe, but putting the UserSettings folder in the right spot isn't that much harder and is the "right" thing to do.

DX11 is awesome though.

WTH? I am so behind the times on 9.0c. My new video card is amazing though. L4D2 looks so much more stunning! And I love being able to play at 1600x1200.
 
WTH? I am so behind the times on 9.0c. My new video card is amazing though. L4D2 looks so much more stunning! And I love being able to play at 1600x1200.

Crysis on HIGH settings looks good...breathtaking good...

Too bad I don't get enough frames to make it playable, in firefights, I go down to 20fps...
 
EF, the macro on this page, to check if a key exists:
http://nsis.sourceforge.net/Check_for_a_Registry_Key

Says this:
Code:
!insertmacro IfKeyExists "ROOT" "KeyToCheckIn" "KeyToCheck"
What's KeyToCheckIn and KeyToCheck?
I mean, the root is HKEY_LOCAL_MACHINE, and the registry key that we are checking for is SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword\3.19 (or some variation thereof for gold/complete), but why are their two registry key values the macro wants? What do I use for those two values?
 
I have the Crysis series. It wasn't all that great (I liked FarCry better), but it was pretty. I'll have to replay some of that.

For KeyToCheck use "3.19". Strip that from the full key path and use the remaining for KeyToCheckIn. I'm just guessing here.
 
I have the Crysis series. It wasn't all that great (I liked FarCry better), but it was pretty. I'll have to replay some of that.

This post is completely OT, sorry for derailing the thread Phungus, DavidAllen.

Crysis was a pretty good game. Not very re-playable though. I never played FarCry, but FarCry2 sucked. I wanted my $50 back. I never will buy a game based off IGN reviews ever again....

I just started playing Half-Life 2, that's good.
 
I tried searching NSIS, but didn't quite get it. This isn't a macro that's native to NSIS (compiler fails saying "The macro IfKeyExists does not exist"). How do I install the macro? Do I just cut and paste the code from the macro's page? If so where do I paste it into my install script, and which block of code from that page do I cut and paste into?
 
Back
Top Bottom