Skip to content

Commit f558381

Browse files
committed
added working directory attribute, removed Hypercosm config
1 parent 7cf6493 commit f558381

File tree

6 files changed

+34
-54
lines changed

6 files changed

+34
-54
lines changed

FlashpointSecurePlayer/FlashpointSecurePlayer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,10 @@ await ActivateModificationsAsync(software, delegate (string text) {
485485
softwareProcessStartInfo.FileName = fullPath;
486486
softwareProcessStartInfo.Arguments = GetCommandLineArgumentRange(software, 1, -1);
487487
softwareProcessStartInfo.ErrorDialog = false;
488-
softwareProcessStartInfo.WorkingDirectory = Path.GetDirectoryName(fullPath);
488+
489+
if (String.IsNullOrEmpty(softwareProcessStartInfo.WorkingDirectory)) {
490+
softwareProcessStartInfo.WorkingDirectory = Path.GetDirectoryName(fullPath);
491+
}
489492

490493
Process process = Process.Start(softwareProcessStartInfo);
491494

FlashpointSecurePlayer/FlashpointSecurePlayerConfigs/hypercosm.config

Lines changed: 0 additions & 29 deletions
This file was deleted.

FlashpointSecurePlayer/ModeTemplates.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ public void Activate(string name, ref string server, ref string software, ref Pr
4040
softwareProcessStartInfo.ErrorDialog = false;
4141
}
4242

43+
if (!String.IsNullOrEmpty(modificationsElement.ModeTemplates.SoftwareModeTemplate.WorkingDirectory)) {
44+
if (softwareProcessStartInfo == null) {
45+
softwareProcessStartInfo = new ProcessStartInfo();
46+
}
47+
48+
softwareProcessStartInfo.WorkingDirectory = RemoveVariablesFromLengthenedValue(modificationsElement.ModeTemplates.SoftwareModeTemplate.WorkingDirectory) as string;
49+
}
50+
4351
ProgressManager.CurrentGoal.Start(modificationsElement.ModeTemplates.ServerModeTemplate.Regexes.Count + modificationsElement.ModeTemplates.SoftwareModeTemplate.Regexes.Count);
4452

4553
try {

FlashpointSecurePlayer/Program.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,17 @@ public bool HideWindow {
417417
base["hideWindow"] = value;
418418
}
419419
}
420+
421+
[ConfigurationProperty("workingDirectory", IsRequired = false)]
422+
public string WorkingDirectory {
423+
get {
424+
return base["workingDirectory"] as string;
425+
}
426+
427+
set {
428+
base["workingDirectory"] = value;
429+
}
430+
}
420431
}
421432

422433

@@ -1003,7 +1014,7 @@ private static Configuration GetEXEConfiguration(bool create, string name) {
10031014
public static async Task DownloadEXEConfiguration(string name) {
10041015
try {
10051016
// important to use this function particularly - GetEXEConfiguration is for internal use by GetModificationsElement only
1006-
GetModificationsElement(false, name);
1017+
GetFlashpointSecurePlayerSection(false, name);
10071018
} catch (ConfigurationErrorsException) {
10081019
try {
10091020
name = GetValidEXEConfigurationName(name);

FlashpointSecurePlayer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("1.0.8.0")]
37-
[assembly: AssemblyFileVersion("1.0.8.0")]
36+
[assembly: AssemblyVersion("1.0.9.0")]
37+
[assembly: AssemblyFileVersion("1.0.9.0")]
3838
[assembly: NeutralResourcesLanguage("en")]
3939

FlashpointSecurePlayer/README.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Flashpoint Secure Player 1.0.8
1+
# Flashpoint Secure Player 1.0.9
22
This player attempts to solve common compatibility or portability issues posed by browser plugins on Windows for the purpose of playback in BlueMaxima's Flashpoint.
33

44
It is compatible with Windows 7, Windows 8, Windows 8.1 and Windows 10, and requires .NET Framework 4.5. If you are on Windows 8.1 or Windows 10, or if you are on Windows 7/8 and have updates enabled, you already have .NET Framework 4.5. Otherwise, you may [download .NET Framework 4.5.](http://www.microsoft.com/en-us/download/details.aspx?id=30653)
@@ -150,9 +150,13 @@ With the "Miniclip" Modification Name specified, all URLs passed into Server Mod
150150

151151
`FlashpointSecurePlayer --name "Miniclip" --server "games/save-the-sheriff/en/"`
152152

153-
**Software Mode Template and hideWindow Attribute**
153+
**Software Mode Template, hideWindow and workingDirectory Attribute**
154154

155-
The Software Mode Template works identically to the Server Mode Template in that it provides the ability to replace the command line passed in with regexes. The Software Mode Template also has an additional attribute, `hideWindow`, which causes the window of the software to be hidden. This is ideal for hiding console windows for softwares that have them.
155+
The Software Mode Template works identically to the Server Mode Template in that it provides the ability to replace the command line passed in with regexes. The Software Mode Template also has additional attributes.
156+
157+
The first attribute is `hideWindow`, which causes the window of the software to be hidden. This is ideal for hiding console windows for softwares that have them.
158+
159+
The second attribute is `workingDirectory`, which sets the working directory for the process.
156160

157161
For example, a practical use of the Software Mode Template would be to create a `modification` element that always ensures the use of important Java options. Note that this example is simplified from the real Java configuration file for the purpose of demonstration.
158162

@@ -206,24 +210,7 @@ Set Via:
206210
- Command Line: `--download-before` (or `-dlb`)
207211
- Configuration File: `downloadsBefore` element
208212

209-
The Downloads Before Modification may be used to download files from the Flashpoint Server. This is useful for software that is only capable of loading files from the computer. The command line argument may be used more than once to download multiple files. For example, this command line, in combination with a Software Mode Template, may be used to download a file for Hypercosm, which can only load files from the computer. For more information, see the section about [Mode Template Modifications](#mode-templates) above.
210-
211-
`FlashpointSecurePlayer --download-before "http://hypercosm/fish.hcvm" --software "http://hypercosm/fish.hcvm"`
212-
213-
```
214-
<modification name="hypercosm">
215-
<modeTemplates>
216-
<softwareModeTemplate>
217-
<regexes>
218-
<regex name="^(\s*&quot;?)http://(.+)$" replace="$1..\..\..\Server\htdocs\$2" />
219-
<regex name="(.+)" replace="Hypercosm\components\Hypercosm3D5E449320.exe $1" />
220-
</regexes>
221-
</softwareModeTemplate>
222-
</modeTemplates>
223-
</modification>
224-
```
225-
226-
Here is a `modification` element that demonstrates the use of the Downloads Before Modification.
213+
The Downloads Before Modification may be used to download files from the Flashpoint Server. This is useful for software that is only capable of loading files from the computer. The command line argument may be used more than once to download multiple files. Here is a `modification` element that demonstrates the use of the Downloads Before Modification.
227214

228215
```
229216
<modification name="downloadsbeforeexample">

0 commit comments

Comments
 (0)