-
August 18th, 2018, 16:57 #1
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Registry entry for application data
FG has the ability to redirect the data folder away from windows default appdata. What registry entry should I look in to find that location? I'm trying to write a tool that works external to FG but needs access to data folder.
-
August 18th, 2018, 17:53 #2
- Join Date
- May 2007
- Posts
- 84
HKEY_CURRENT_USER\Software\Fantasy Grounds\2.0\DataDir
-
August 19th, 2018, 01:54 #3
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Thanks
-
August 19th, 2018, 05:34 #4
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
I am a Mac guy, and I'm getting an error in my C# program that attempts to start Fantasy Grounds. This is my code line giving the error:
Process.Start(@"C:\Program Files x86\Fantasy Grounds II\FantasyGrounds.exe");
This gives me the following Fantasy Grounds error:
FG Error.png
I do not get an error of any kind when I start FG from the windows start menu.
I went to file explorer to see if there was some kind of command that should be included in the exe line, but the properties of the start menu item did not show any such thing.
Dulux, or some windows guru, can you tell me please what I am doing wrong?
-
August 19th, 2018, 05:49 #5
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
My first guess would be that it's running the executable in the wrong directory.
-
August 19th, 2018, 13:00 #6
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
That's what I'm thinking, too, Andraax, but I'm a Windows retard, and I can't figure out what else I need to do before that .Start call to get things set up correctly. (Pretty sure it is using my program's path as some kind of default directory).
-
August 19th, 2018, 13:25 #7
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
Find what the "default directory" is for the entry in the start directory (probably something like "C:\Program Files x86\Fantasy Grounds II") and change to that directory before running it.
I'm not a C# programmer, but I found this sample online using a specified working directory with Process.Start:
ProcessStartInfo _processStartInfo = new ProcessStartInfo();
_processStartInfo.WorkingDirectory = @"%ProgramFiles%";
_processStartInfo.FileName = @"Notepad.exe";
_processStartInfo.Arguments = "test.txt";
_processStartInfo.CreateNoWindow = true;
Process myProcess = Process.Start(_processStartInfo);
-
August 19th, 2018, 15:15 #8
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
I found that directory using the registry entry that gamerhawaii located (and now I know how to use RegEdit to go look in that file). Thanks for the tip on creating the process instance. I was going to try SetCurrentDirectory, but I think what you have is actually the ticket. I will let you know how it goes. Thanks, Andraax.
-
August 19th, 2018, 22:34 #9
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Well, that didn't work either. Here is my code:
Code:ProcessStartInfo fgRunner = new ProcessStartInfo(); fgRunner.WorkingDirectory = @"c:\Users\AppData\Roaming\Fantasy Grounds II"; fgRunner.FileName = myFile; fgRunner.UseShellExecute = false; try { Process myProcess = Process.Start(fgRunner); } catch (Exception er) { MessageBox.Show("Unable to start Fantasy Grounds." + "\r\t(" + er.GetType().ToString() + er.Data + ": " + er.Message + ")", "Error", MessageBoxButtons.OK); return false; }
-
August 19th, 2018, 23:10 #10
- Join Date
- Jun 2013
- Location
- Isanti, MN
- Posts
- 2,922
I doubt that "c:\Users\AppData\Roaming\Fantasy Grounds II" is the directory where your executable is installed. More than likely it's "C:\Program Files x86\Fantasy Grounds II".
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks