Skip to content

Commit e14460d

Browse files
committed
small fix for error messages overflowing the message box
1 parent 438dabb commit e14460d

4 files changed

Lines changed: 39 additions & 46 deletions

File tree

FlashpointSecurePlayer/FlashpointSecurePlayer.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,20 @@ private async Task StartSecurePlayback() {
389389

390390
try {
391391
await ActivateModificationsAsync(null, delegate (string text) {
392-
ShowError(text);
392+
if (text.IndexOf("\n") == -1) {
393+
ShowError(text);
394+
} else {
395+
ShowError();
396+
MessageBox.Show(text, Properties.Resources.FlashpointSecurePlayer, MessageBoxButtons.OK, MessageBoxIcon.Error);
397+
}
398+
393399
throw new InvalidModificationException();
394400
}).ConfigureAwait(true);
395401
} catch (InvalidModificationException) {
396402
return;
397403
}
398404

399-
Server serverForm = new Server {
400-
WebBrowserURL = new Uri(Server)
401-
};
405+
Server serverForm = new Server(new Uri(Server));
402406

403407
registryBackupProgressBar.Value = 100;
404408
Hide();
@@ -411,7 +415,13 @@ await ActivateModificationsAsync(null, delegate (string text) {
411415

412416
try {
413417
await ActivateModificationsAsync(Software, delegate (string text) {
414-
ShowError(text);
418+
if (text.IndexOf("\n") == -1) {
419+
ShowError(text);
420+
} else {
421+
ShowError();
422+
MessageBox.Show(text, Properties.Resources.FlashpointSecurePlayer, MessageBoxButtons.OK, MessageBoxIcon.Error);
423+
}
424+
415425
throw new InvalidModificationException();
416426
}).ConfigureAwait(true);
417427
} catch (InvalidModificationException) {

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.0.0")]
37-
[assembly: AssemblyFileVersion("1.0.0.0")]
36+
[assembly: AssemblyVersion("1.0.1.0")]
37+
[assembly: AssemblyFileVersion("1.0.1.0")]
3838
[assembly: NeutralResourcesLanguage("en")]
3939

FlashpointSecurePlayer/README.md

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Flashpoint Secure Player 1.0.0
1+
# Flashpoint Secure Player 1.0.1
22
This application 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)
@@ -15,7 +15,7 @@ This application has bugs. Help me find them! See the [Known Issues](#known-issu
1515
The Mode determines what action Flashpoint Secure Player will perform after all of the Modifications are made. For example, the end goal may be to open a browser, or a specific software. The Mode to use is not optional. If it is not set, an error will occur. Modes are exclusive - there may only be one set at a time.
1616

1717
## <a name="activex-mode"></a>ActiveX Mode
18-
**Command Line:** --activex (or -ax)
18+
**Command Line:** `--activex` (or `-ax`)
1919

2020
*For curator use only.*
2121

@@ -34,7 +34,7 @@ Please note that you should NOT use the ActiveX Mode in your final curation. The
3434
This is a command you could use in your curation, remembering to include the Registry Backup in the curation. For more information about Registry Backups, see the section about [Registry Backup Modifications](#registry-backups) below.
3535

3636
## Server Mode
37-
**Command Line:** --server (or -sv)
37+
**Command Line:** `--server` (or `-sv`)
3838

3939
The Server Mode opens a URL in an Internet Explorer frame. The Flashpoint Proxy is used to access the URL, so Server Mode is Redirectorless.
4040

@@ -43,24 +43,28 @@ It is possible to modify the Server Mode's behaviour by using the Server Mode Te
4343
`FlashpointSecurePlayer --server "http://www.example.com"`
4444

4545
**Setting The Internet Explorer Version**
46-
4746
By default, the Internet Explorer version used in Server Mode is Internet Explorer 7. Changing the Internet Explorer version to use may be accomplished by means of HTTP headers or meta elements.
4847

4948
Here are some examples of meta elements that may be used to change the Internet Explorer version.
5049

5150
- Internet Explorer 8
51+
5252
`<meta http-equiv="X-UA-Compatible" content="IE=8" />`
5353
- Internet Explorer 9
54+
5455
`<meta http-equiv="X-UA-Compatible" content="IE=9" />`
5556
- Internet Explorer 10
57+
5658
`<meta http-equiv="X-UA-Compatible" content="IE=10" />`
5759
- Internet Explorer 11
60+
5861
`<meta http-equiv="X-UA-Compatible" content="IE=11" />`
5962
- The highest supported version of the browser (this may disable ActiveX Controls)
63+
6064
`<meta http-equiv="X-UA-Compatible" content="IE=edge" />`
6165

6266
## Software Mode
63-
**Command Line:** --software (or -sw)
67+
**Command Line:** `--software` (or `-sw`)
6468

6569
The Software Mode opens any software. The command line argument *must* be the last argument specified, as everything after the command line argument will be interpreted as the command line to be passed to the software.
6670

@@ -73,7 +77,7 @@ It is possible to modify the Software Mode's behaviour by using the Software Mod
7377
# Modifications
7478
The Modifications determine what temporary modifications will be made for the duration of time that the application is open. Modifications are optional, none are required to be set. Modifications are not exclusive - there may be multiple Modifications set at a time.
7579

76-
The Modifications Name is set via the --name (or -n) command line argument. The Modifications Name is case-insensitive. When this argument is passed, Flashpoint Secure Player will check for a configuration file in the FlashpointSecurePlayerConfigs folder with the same name (with any invalid pathname characters replaced with a period character.) If it fails to find a configuration file in this folder, it will look for the configuration file on the Flashpoint Server at http://flashpointsecureplayerconfig/ using the same pathname rules. If the configuration file is not found in either location, an error occurs.
80+
The Modifications Name is set via the `--name` (or `-n`) command line argument. The Modifications Name is case-insensitive. When this argument is passed, Flashpoint Secure Player will check for a configuration file in the FlashpointSecurePlayerConfigs folder with the same name (with any invalid pathname characters replaced with a period character.) If it fails to find a configuration file in this folder, it will look for the configuration file on the Flashpoint Server at http://flashpointsecureplayerconfig/ using the same pathname rules. If the configuration file is not found in either location, an error occurs.
7781

7882
Here is an example of a Modification that does not do anything, called "Example."
7983

@@ -92,8 +96,7 @@ Here is an example of a Modification that does not do anything, called "Example.
9296
<startup>
9397
9498
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
95-
</configuration>
96-
```
99+
</configuration>```
97100
98101
The important element here is the `modification` element, which in future examples is all that will be shown. The rest of the configuration file will be the same in every configuration file Flashpoint Secure Player uses.
99102
@@ -117,16 +120,14 @@ The command line below launches the Astro Avenger II ActiveX Control in Administ
117120
The `modification` element below also causes Administrator Mode to be used.
118121
119122
```
120-
<modification name="example" runAsAdministrator="true" />
121-
```
123+
<modification name="example" runAsAdministrator="true" />```
122124
## <a name="mode-templates"></a>Mode Templates
123125
Set Via:
124126
- Configuration File: `modeTemplates` element
125127

126128
The Mode Templates can modify the behaviour of the Server Mode and Software Mode such that a particular configuration file will cause these modes to be used. There is no ActiveX Mode Template.
127129

128130
**Server Mode Template**
129-
130131
The Server Mode Template provides the ability to apply a regex to the URL that was in the command line. For example, a `modification` element could be created which prefixes the URL with a specific domain.
131132

132133
```
@@ -138,15 +139,13 @@ The Server Mode Template provides the ability to apply a regex to the URL that w
138139
</regexes>
139140
</serverModeTemplate>
140141
</modeTemplates>
141-
</modification>
142-
```
142+
</modification>```
143143
144144
With the "Miniclip" Modification Name specified, all URLs passed into Server Mode will be modified, such that the command line below would cause the URL of http://www.miniclip.com/games/save-the-sheriff/en/ to open in the Internet Explorer frame.
145145
146146
`FlashpointSecurePlayer --name "Miniclip" --server "games/save-the-sheriff/en/"`
147147
148148
**Software Mode Template and hideWindow Attribute**
149-
150149
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.
151150
152151
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.
@@ -160,8 +159,7 @@ For example, a practical use of the Software Mode Template would be to create a
160159
</regexes>
161160
</softwareModeTemplate>
162161
</modeTemplates>
163-
</modification>
164-
```
162+
</modification>```
165163

166164
With the "Java" Modification Name specified, the URL is factored into the regex, such that only the URL needs to be given when specifying the Software Mode argument. The command line below could be interpreted as passing the URL to the software.
167165

@@ -180,21 +178,18 @@ Here is a modification `element` that sets the FP_UNITY_PATH variable to the loc
180178
<environmentVariables>
181179
<environmentVariable name="FP_UNITY_PATH" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d2.x\loader" />
182180
</environmentVariables>
183-
</modification>
184-
```
181+
</modification>```
185182
186183
**Compatibility Layers**
187184
188-
189185
It is possible to use the Environment Variables Modification to set compatibility layers by setting the __COMPAT_LAYERS environment variable to a [compatibility fix.](http://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/cc765984(v=ws.10)) Here is a `modification` element that starts the software in 640 x 480 resolution.
190186
191187
```
192188
<modification name="lowresolution">
193189
<environmentVariables>
194190
<environmentVariable name="__COMPAT_LAYERS" value="640x480" />
195191
</environmentVariables>
196-
</modification>
197-
```
192+
</modification>```
198193

199194
## Downloads Before
200195
Set Via:
@@ -215,8 +210,7 @@ The Downloads Before Modification may be used to download files from the Flashpo
215210
</regexes>
216211
</softwareModeTemplate>
217212
</modeTemplates>
218-
</modification>
219-
```
213+
</modification>```
220214
221215
Here is a `modification` element that demonstrates the use of the Downloads Before Modification.
222216
@@ -228,8 +222,7 @@ Here is a `modification` element that demonstrates the use of the Downloads Befo
228222
<downloadBefore name="http://www.example.com/example2.swf" />
229223
</downloadsBefore>
230224
</modeTemplates>
231-
</modification>
232-
```
225+
</modification>```
233226

234227
## <a name="registry-backups"></a>Registry Backups
235228
Set Via:
@@ -246,23 +239,19 @@ Here is a `modifications` element which temporarily changes the Unity directory.
246239
valueName="un.Directory" value="%FLASHPOINTSECUREPLAYERSTARTUPPATH%\BrowserPlugins\UnityWebPlayer\Unity3d2.x"
247240
valueKind="String" />
248241
</registryBackups>
249-
</modification>
250-
```
242+
</modification>```
251243
252244
The `type` attribute of the `registryBackup` element specifies whether the element represents a `KEY` or `VALUE`. If not specified, the default is `KEY`. The `keyName` and `valueName` attributes specify the location of the registry key and value. The `valueKind` attribute specifies the kind of value that will be set. Currently, only `String` (REG_SZ) is supported. If the `type` attribute is `KEY`, the `valueName`, `value`, and `valueKind` attributes are ignored.
253245
254246
There is no way to delete a registry key or value, only set them. The application may set a `_deleted` attribute, which is for internal use by the application only, and is ignored outside of the active configuration file (see the section about [Crash Recovery](#crash-recovery) below.)
255247
256248
**binaryType Attribute and WOW64 Keys**
257-
258249
*You do not need to include the WOW6432Node or WOW64AANode subkeys when creating a Registry Backup.* If the `binaryType` attribute of the `registryBackups` element is not set to `SCS_64BIT_BINARY`, the 32-bit registry view is used, so the WOW6432Node and WOW64AANode subkeys will be used automatically where necessary.
259250
260251
**ActiveX Imports**
261-
262252
See the section about [ActiveX Mode](#activex-mode) above.
263253
264254
**<a name="#crash-recovery"></a>Crash Recovery**
265-
266255
The configuration file in the same folder as the executable is the *active configuration file.* This configuration file is maintained by the application and is not meant to be modified by curators or users (unless there is an issue with loading the file.) This file is created so that the registry may be restored in the event of a crash, shutdown or power outage.
267256
268257
There are four possible scenarios.
@@ -277,7 +266,6 @@ In scenarios one and two, Flashpoint Secure Player reverts the active Registry B
277266
If the Registry Backups Modification cannot be reverted, an error occurs and the application will exit, and not do anything else regardless of what Modes or Modifications are specified until the issue is resolved. If the registry has been modified by a different application outside of Flashpoint Secure Player, the application no longer assumes control of those registry keys and values, and the active Registry Backups Modification is silently discarded.
278267
279268
**Administrator Mode**
280-
281269
ActiveX Imports are always created in Administrator Mode, but it is not required during playback. Please note that in some cases, ActiveX Controls may be required to be launched in Administrator Mode. Flashpoint Secure Player will attempt to play the game without running as administrator by default, and in these cases, the ActiveX Control will not work unless the Run As Administrator Modification is used. For more information, see the section about the [Run As Administrator Modification](#run-as-administrator) above.
282270
283271
## Single Instance
@@ -300,8 +288,7 @@ This command line in combination with this `modification` element uses the Singl
300288
</softwareModeTemplate>
301289
</modeTemplates>
302290
<singleInstance strict="false" commandLine="basilisk.exe" />
303-
</modification>
304-
```
291+
</modification>```
305292

306293
The Single Instance Modification has two attributes: `strict` and `commandLine`. The `strict` attribute specifies whether the test only looks for the process with the exact same pathname or any process on the machine with a matching name. The default is `false`. The `commandLine` attribute specifies an alternate command line to test for. For example, in this instance, if the `commandLine` attribute were empty, it would instead look for `Basilisk-Portable.exe`.
307294

@@ -310,15 +297,13 @@ Let's curate the game Zenerchi. The first step is to add the ActiveX Control to
310297
`ActiveX\ZenerchiWeb.1.0.0.10\zenerchi.1.0.0.10.dll`
311298

312299
**Creating a Registry Backup from an ActiveX Control**
313-
314300
The first time an ActiveX Control is added to Flashpoint, a curator must create an ActiveX Import. This is accomplished with the following command line, substituting the ActiveX Control's location. If not run as administrator, the curator will be asked to launch in Administrator Mode. This command line is NOT to be included in the curation metadata, it is only used to create the Registry Backup.
315301

316302
`FlashpointSecurePlayer --name "ActiveX\ZenerchiWeb.1.0.0.10\zenerchi.1.0.0.10.dll" --activex`
317303

318304
This will produce a file in the FlashpointSecurePlayerConfigs folder called `activex.zenerchiweb.1.0.0.10.zenerchi.1.0.0.10.dll.config`. This file may be included in the curation as if it existed at the URL of http://flashpointsecureplayerconfigs/activex.zenerchiweb.1.0.0.10.zenerchi.1.0.0.10.dll.config and it will be downloaded from the Flashpoint Server by Flashpoint Secure Player when required.
319305

320306
**Using the Registry Backup**
321-
322307
To use the ActiveX Control, the same Modification Name is specified but the Mode is changed to Server Mode with the URL to load. This is the command line the curation metadata may include.
323308

324309
`FlashpointSecurePlayer --name "ActiveX\ZenerchiWeb.1.0.0.10\zenerchi.1.0.0.10.dll" --server "http://www.shockwave.com/content/zenerchi/sis/index.html"`
@@ -354,13 +339,10 @@ You may notice that because the Flashpoint Secure Player is effectively capable
354339

355340
# Questions And Answers
356341
**Is there is Linux version?**
357-
358342
No, but also, what? This application deals mostly in solving Windows specific problems (to do with the registry, or running as administrator, etc.) for Windows specific plugins. The types of programs Flashpoint Secure Player is useful for would not have run natively on Linux in the first place.
359343

360344
**Why does the Modification Name need to be specified in the configuration file if the filename of the configuration file also reflects it?**
361-
362345
It provides additional redundancy, ensuring the configuration file loaded was the one intended, and also opens the door for potentially allowing single configuration files to have multiple `modification` elements in the future.
363346

364347
**Shouldn't the Flashpoint Launcher just have these features built in?**
365-
366348
No.

FlashpointSecurePlayer/Server.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ namespace FlashpointSecurePlayer {
1515
public partial class Server : Form {
1616
public Uri WebBrowserURL = null;
1717

18-
public Server() {
18+
public Server(Uri WebBrowserURL) {
1919
InitializeComponent();
20+
this.WebBrowserURL = WebBrowserURL;
2021
}
2122

2223
private void Server_Load(object sender, EventArgs e) {

0 commit comments

Comments
 (0)