Civ3 File Explorer

Puppeteer

Emperor
Joined
Oct 4, 2003
Messages
1,687
Location
Silverdale, WA, USA
This utility is an HTA application that detects installed Civ3 folder locations on the local computer and provides links for you to browse there. It is essentially a web page that can find your Civ3 install and launch Windows Explorer when you click the links.

The first use is so you can find and browse your VirtualStore folders to troubleshoot problems with ini, save and mod files.

I may extend it in the future to point directly to save/mod folders and perhaps compare the original files to VirtualStore-stored files.

Download link: Civ3 Explorer

After downloading, to enable the links to your folder locations you'll need to click the unblock button in the file properties. See the attached screenshots, right-click the file, choose properties, then click the unblock button and apply. If you don't do this, it will still display information but it won't open Windows Explorer for you when you click the links.
 

Attachments

  • right-click-file-properties.GIF
    right-click-file-properties.GIF
    44.6 KB · Views: 358
  • unblock-apply.GIF
    unblock-apply.GIF
    27.6 KB · Views: 279
Screenshots of utility attached.

  1. Screenshot of app
  2. Comparing C3C install folder on left and VirtualStore C3C folder on right. Note that the VirtualStore Conquests.ini and other files will override the files on the left when launching the game
  3. Comparing original save folder on left and VirtualStore save folder on right. Note that new saves are going to the VirtualStore location.
 

Attachments

  • civ3-explorer-rev2.GIF
    civ3-explorer-rev2.GIF
    42.9 KB · Views: 214
  • civ3-explorer-vscompare1.GIF
    civ3-explorer-vscompare1.GIF
    100.6 KB · Views: 225
  • civ3-explorer-vscompare2.GIF
    civ3-explorer-vscompare2.GIF
    81.4 KB · Views: 195
Code for the app. It is simply an HTML file renamed to .hta, and Windows will handle these differently and allow them access to the registry and filesystem.

Notes:
- After being downloaded, the file must be unblocked before the path links work
- I've seen hta's that elevate themselves; can I make this one unblock itself?
- The .hta seems to be launching in a 32-bit environment on 64-bit systems. This isn't really a problem.
- Note to self: while pasting this I noticed I have unused vars dim'ed in launchlink function; they are artifacts of how I built the link before I decided it was easier to concatenate the html myself. Need to clean that up and perhaps comment things better. Also should probably add the hta:application tags in the head, but it seems to work fine without them so far.

Code:
<html>
<head>
	<title>Civ3 File Explorer</title>
	
	<script type=text/vbs>
	Dim sVirtualStore, sArch, sWow6432Node, sPathCiv3, sPathPTW, sPathC3C, sVSCiv3, sVSPTW, sVSC3C  ' global variable
	
	function launchlink(sPath)
		Dim oAnchor, oFileSystem
		
		launchlink = "<a href=""" & "file:///" & sPath & """ class=""pathlink"">" & sPath & "</a>"
	end function ' launchlink

	Function pathexists(fldr)
	   Dim fso, msg
	   Set fso = CreateObject("Scripting.FileSystemObject")
	   if fldr <> "" then
		   If (fso.FolderExists(fldr)) Then
			  msg = "<span class=""exist"">Exists</span>"
		   Else
			  msg = "<span class=""noexist"">Does not exist</span>"
		   End If
		else
			' if fldr is empty, msg is empty, too
			msg = ""
		end if
	   pathexists = msg
	End Function

	' Onload, let's assign environment variables and call other functions if needed
	sub window_onload
		Dim oWSHShell
		' Create shell object to obtain environment variables
		set oWSHShell = CreateObject("WScript.Shell")
		
		Set oFileSystem = CreateObject("Scripting.FileSystemObject")
		
		' Assign global variables based on environment variables
		sVirtualStore = oWSHShell.expandenvironmentstrings("%LOCALAPPDATA%") & "\VirtualStore"
		
		' If architecture does not equal x86 assume 64-bit and use the Wow6432Node part of the registry
		sArch = oWSHShell.expandenvironmentstrings("%PROCESSOR_ARCHITECTURE%")
		if sArch = "x86" then
			sWow6432Node = ""
		else
			sWow6432Node = "Wow6432Node\"
		end if
		
		' Update the page now in case there are run-time errors while getting the other values
		updatehtml()

		' Read Civ3 installed paths from registry
		sPathCiv3 = oWSHShell.RegRead("HKLM\Software\" & sWow6432Node & "Infogrames Interactive\Civilization III\Install_Path")
		sPathPTW = oWSHShell.RegRead("HKLM\Software\" & sWow6432Node & "Infogrames\Civ3PTW\Install_Path")
		sPathC3C = oWSHShell.RegRead("HKLM\Software\" & sWow6432Node & "Infogrames\Conquests\Install_Path")

		sVSCiv3 = sVirtualStore & right(sPathCiv3, len(sPathCiv3)-2)
		sVSPTW = sVirtualStore & right(sPathPTW, len(sPathPTW)-2)
		sVSC3C = sVirtualStore & right(sPathC3C, len(sPathC3C)-2)
		
		updatehtml()
	end sub

	sub updatehtml()
		VirtualStore.InnerHTML = launchlink(sVirtualStore) & " " & pathexists(sVirtualStore)
		'Architecture.InnerHTML = sArch
		Civ3Path.InnerHTML = launchlink(sPathCiv3) & " " & pathexists(sPathCiv3)
		PTWPath.InnerHTML = launchlink(sPathPTW) & " " & pathexists(sPathPTW)
		C3CPath.InnerHTML = launchlink(sPathC3C) & " " & pathexists(sPathC3C)
		Civ3VSPath.InnerHTML = launchlink(sVSCiv3) & " " & pathexists(sVSCiv3)
		PTWVSPath.InnerHTML = launchlink(sVSPTW) & " " & pathexists(sVSPTW)
		C3CVSPath.InnerHTML = launchlink(sVSC3C) & " " & pathexists(sVSC3C)
	end sub
	
	</script>
<style>
/* I didn't like the IE/mshta default font */
body	{
	font-family: Verdana, sans-serif;
}
/* Increasing <li> line height to separate file link spacing */
ul li {
	line-height: 1.5em;
}
/* for the path does not exist indicator */
.noexist {
	color: green;
	font-weight: bold;
}
/* for the path exists indicator */
.exist {
}
/* for the file:///c/ links */
.pathlink {
	font-family: Tahoma, sans-serif;
	text-decoration: none;
}
a.pathlink:hover {
	color: orange;
}
</style>
	
</head>
<body>

<h1>Civ3 File Explorer</h1>

<h2>Your Civ3 Install and VirtualStore Info</h2>
<ul>
<li>Presumed VirtualStore Location: <span id="VirtualStore"></span></li>
<!-- <li>Environment Architecture: <span id="Architecture"></span></li> Commenting out because of likely confusion between reported arch and actual arch -->
<li>Civ3 Installed Path: <span id="Civ3Path"></span></li>
<li>Civ3 VirtualStore: <span id="Civ3VSPath"></span></li>
<li>PTW Installed Path: <span id="PTWPath"></span></li>
<li>PTW VirtualStore: <span id="PTWVSPath"></span></li>
<li>C3C Installed Path: <span id="C3CPath"></span></li>
<li>C3C VirtualStore: <span id="C3CVSPath"></span></li>
</ul>
<hr>
<h2>About</h2>
<p>I suspect quite a few problems reported with Civ3 on Vista/Win7/Win8 problems are due to VirtualStore. This will tell you where Civ3 is installed, where the VirtualStore folders are and give you links to them.</p>
<p>I will not suggest actions here. This tool is to help you explore and to give you information to ask others for help.</p>
<p>This program is provided for free with no warranty for purpose or usefulness. It is not associated with Infogrames Interactive, Atari or CivFanatics. There is a <a href="http://forums.civfanatics.com/showthread.php?t=509773">forum thread about this utility on CivFanatics.com</a>.</p>
<h3>Player/Modder Issues With VirtualStore Include:</h3>
<ul>
	<li>VirtualStore files may not go away after uninstall</li>
	<li>Mod files in protected location and VirtualStore may be out of sync</li>
	<li>Running Civ3 with different privileges (user, admin, compatibility) may cause different files to be used</li>
</ul>
<h3>Notes</h3>
	<ul>
<!-- Actually, I can compare VirtualStore and non-VirtualStore without admin access. Yay!		<li style="color: red;">If your Civ3 folders do have VirtualStore locations, the links to the original paths will be affected by VirtualStore. To get around this, this app would have to be launched with admin privileges, but that's not easy yet.</li> -->
		<li>You can highlight, copy and paste the above section into a post on a forum asking for help with your Civ3 save file or mod problems.</li>
		<li>If your game VirtualStore folders don't exist, that's a good thing and you have less to worry about.</li>
		<li>"Presumed VirtualStore" location may exist even if none of the game VirtualStore folders exist, and this would be for other applications.</li>
	</ul>
<h3>What This Is Doing</h3>
	<ol>
		<li>Presumes %LOCALAPPDATA%\VirtualStore is the VirtualStore location and checks if it exists</li>
		<li>Checks %PROCESSOR_ARCHITECTURE% because Civ3 registry location is different depending if this is x86 or not</li>
		<li>Reads installed location for Civ3, PTW and Conquests from the registry</li>
		<li>Guesses where VirtualStore folder for those locations would be</li>
		<li>Tells you if the VirtualStore folder location(s) exist for your Civ3 installs</li>
		<li>Provides links to each location displayed so you can browse these locations easily</li>
	</ol>
</body>
</html>
 
I tested my utility further by installing Civ3 on a Win7 PC with the default settings, starting a game and saving it.

Good news: It correctly finds the VirtualStore locations.

Even better news: It can help you browse the unaltered original locations and the VirtualStore files without administrator access.

Bad news: But you have to open the downloaded file's properties and click the unblock button before the path links work.

I'll update the previous posts with updated screenshots and info. I made some minor updates to the app. The download link is the same.

Changes:
Spoiler :
Removed the line about admin access needed
Changed some styles to make it easier to read
Changed "Does not exist" message from red to green because it's a good thing in this case
Added hover styles for path links
Added link back to this discussion thread
Added some disclaimers that I ain't Infogrames, Atari, CivFanatics or responsible
Changed title from "Civ3 VirtualStore Explorer" to "Civ3 File Explorer"
 
Sounds like an interesting utility, and potentially quite useful for those using Vista/7/8. Seems like every few weeks someone runs into trouble that's likely Virtual Store related; I already do link them to your Civ III on 7 video fairly often, and now this will be a must-recommend, too. If this had been around 6 years ago, I might not've ditched Vista, which was in part due to Civ III troubles that I now suspect were Virtual Store related. :thumbsup:

I ran it just now, but since I'm running XP, it doesn't find Virtual Store, of course. So I'm probably not the best tester.
 
Top Bottom