Skip to content

Commit 4cf10da

Browse files
Merge pull request #9 from frtello/issue/PPSS-41997
PPSS-41997 Release application browser 4.0.3
2 parents 1d4dd0e + 3021467 commit 4cf10da

4 files changed

Lines changed: 140 additions & 6 deletions

File tree

RELEASENOTES.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
- [Launch the Application Browser with an ID parameter](#Launch-the-Application-Browser-with-an-ID-parameter)
1010
- [How to Configure PPSS DO Email Approval](#How-to-Configure-PPSS-DO-Email-Approval)
1111
- [How to enable servers to automatic NTLM authentication](#How-to-enable-servers-to-automatic-NTLM-authentication)
12+
- [What to do if extension is not shown when exporting a file](#What-to-do-if-extension-is-not-shown-when-exporting-a-file)
13+
- [How to let Application Browser work with Pepper after EOL](#How-to-let-Application-Browser-work-with-Pepper-after-EOL)
1214
- [Changes](#Changes)
1315
- [4.0.1](#4.0.1)
1416
- [4.0.2](#4.0.2)
17+
- [4.0.3](#4.0.3)
1518
- [Known Issues](#Known-Issues)
1619

1720
## How to Install on Windows
@@ -162,6 +165,40 @@ To enable servers to use automatic NTLM authentication add the **authServerWhite
162165

163166
Without * prefix the URL has to match exactly. If you use only **"*"** wildcard, this integration will be globally enabled. If you don't want this integration to be turned on, remove the property from the config.json file.
164167

168+
## What to do if extension is not shown when exporting a file
169+
For users that are experiencing problems with lack of extension when exporting a file, open Windows explorer and check the File name extensions box to unhide the extension.
170+
Users can also add the **saveDialogFilters** property in the config.json file, associating an allowed extensions filter array. For example:
171+
172+
- "saveDialogFilters":[
173+
{"name":"Excel", "extensions":["xlsx", "xls"]},
174+
{"name":"Document", "extensions":["docx", "doc"]},
175+
{"name":"Text", "extensions":["txt", "text"]},
176+
{"name":"All Files", "extensions":["*"]}
177+
]
178+
179+
The first attribute "name" let you to group extensions. It will be shown in the download dialog.
180+
The second attribute is "extensions". This is an array of extensions and should not contain wildcards or dots (e.g. 'png' is good but '.png' and '*.png' are bad). To show all files, use the '*' wildcard (no other wildcard is supported).
181+
182+
## How to let Application Browser work with Pepper after EOL
183+
To let Application Browser work with Pepper Flash Player after EOL, mms.cfg file must exist in the path:
184+
185+
**C:\Users\<user>\AppData\Roaming\ApplicationBrowser\Pepper Data\Shockwave Flash\System**
186+
187+
Upgrading to version 4.0.3 or later and starting the application will automatically create an mms.config file if missing. See notes below for more detail or customization.
188+
189+
This file must contain the following entries:
190+
191+
EOLUninstallDisable=1
192+
SilentAutoUpdateEnable=0
193+
EnableAllowList=1
194+
AutoUpdateDisable=1
195+
ErrorReportingEnable=1
196+
AllowListURLPattern=<Base URL to your application instance>
197+
198+
AllowListURLPattern rules are explained with more detail here: https://www.adobe.com/content/dam/acom/en/devnet/flashplayer/articles/flash_player_admin_guide/pdf/latest/flash_player_32_0_admin_guide.pdf
199+
200+
When you start Application Browser, the mms.cfg file is automatically created and filled using the protocol and host of the existing URLs of config.json file environments. If mms.cfg already exists, it will be filled with the information that does not exist. It means, previous entries are not going to be overwritten. To take effect any change, this application must be restarted. To disable auto fill mms.cfg file, add the disableAutoFillMmsFile property as false to the config.json file. This is enabled by default.
201+
165202
## Changes
166203

167204
### 4.0.1
@@ -173,9 +210,9 @@ Without * prefix the URL has to match exactly. If you use only **"*"** wildcard,
173210
- PPSS-40347 Update readme file with FAQ and release notes for Application Browser.
174211
- PPSS-39787 Remove spaces and concatenate version to the installer name for Application Browser.
175212

213+
### 4.0.3
214+
- PPSS-38383 Excel export file lacks name and extension using Application Browser.
215+
- PPSS-42118 PROS Application Browser - Flash Content Blocked from Jan 12 2021.
216+
176217
## Known Issues
177218
- PPSS-35717 When using an ID value with a blank space the PPSS login page is not displayed.
178-
- PPSS-38383 Excel export file lacks name and extension using Application Browser.
179-
180-
### Workaround for PPSS-38383
181-
For users that are experiencing problems with lack of extension when exporting a file, please open Windows explorer and check the File name extensions box to unhide the extension.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ApplicationBrowser",
33
"productName": "Application Browser",
4-
"version": "4.0.2",
4+
"version": "4.0.3",
55
"description": "A simple application that provides flash support",
66
"main": "src/index.js",
77
"scripts": {

src/environmentSetup.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,88 @@ const validateParams = (json) => {
175175
return errorMessages;
176176
};
177177

178+
const containsValidUrl = (url) => {
179+
const urlValidator = /^(ftp|file|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?/;
180+
return urlValidator.test(url);
181+
}
182+
183+
const getProtocolAndHostFromUrl = (url) => {
184+
const [protocolScheme, protocolPath] = url.split('://');
185+
const [protocolHost] = protocolPath.split('/');
186+
return `${protocolScheme}://${protocolHost}`;
187+
}
188+
189+
/**
190+
* Automatically fills the mms.cfg file using the url of each environment from config.json file.
191+
* Each time the application is launched this file is updated with config.json URL environments that
192+
* do not exist on mms.cfg file. If a new change is made, the application must be restarted.
193+
*
194+
* This is an example of the AllowListURLPattern output in the mms.cfg file:
195+
*
196+
* For config.json url: "http://<server>:<port>/application/index.html"
197+
*
198+
* This is the mms.cfg new entry: "AllowListURLPattern=http://<server>:<port>"
199+
*
200+
* SilentAutoUpdateEnable=0, AutoUpdateDisable=1, EOLUninstallDisable=1, ErrorReportingEnable=1
201+
* and EnableAllowList=1 are added when mms.cfg file does not exist.
202+
*
203+
* To disable this functionality add the disableAutoFillMmsFile property as false to the config.json file
204+
*
205+
* This document presents more information about how to configure the AllowListURLPattern entry:
206+
* https://www.adobe.com/content/dam/acom/en/devnet/flashplayer/articles/flash_player_admin_guide/pdf/latest/flash_player_32_0_admin_guide.pdf
207+
*
208+
*/
209+
const fillMmsFile = () => {
210+
const MMS_FOLDER = app.getPath('userData') + "\\Pepper Data\\Shockwave Flash\\System\\";
211+
const MMS_FILE_NAME = "mms.cfg";
212+
const MMS_PATH = MMS_FOLDER + MMS_FILE_NAME;
213+
console.log(MMS_PATH);
214+
let mmsEntries = "";
215+
216+
if (!fs.existsSync(MMS_PATH)) {
217+
if (!fs.existsSync(MMS_FOLDER)) {
218+
fs.mkdirSync(MMS_FOLDER);
219+
}
220+
mmsEntries = "SilentAutoUpdateEnable=0\n";
221+
mmsEntries += "AutoUpdateDisable=1\n";
222+
mmsEntries += "EOLUninstallDisable=1\n";
223+
mmsEntries += "ErrorReportingEnable=1\n";
224+
mmsEntries += "EnableAllowList=1\n";
225+
}
226+
else {
227+
const mmsFileEntries = fs.readFileSync(MMS_PATH, 'utf8').split("\n");
228+
mmsFileEntries.forEach(element => {
229+
if (element.trim() != "") {
230+
mmsEntries += element + "\n";
231+
}
232+
});
233+
}
234+
235+
if (fs.existsSync(CONFIG_FILE_PATH)) {
236+
let json = {};
237+
const file = fs.readFileSync(CONFIG_FILE_PATH);
238+
json = JSON.parse(file);
239+
if (json.environments) {
240+
for (let i = 0; i < json.environments.length; i += 1) {
241+
if(containsValidUrl(json.environments[i].url)) {
242+
const allowedEntry = "AllowListURLPattern=" + getProtocolAndHostFromUrl(json.environments[i].url) + "\n";
243+
if (mmsEntries.indexOf(allowedEntry.trim()) === -1) {
244+
mmsEntries += allowedEntry;
245+
}
246+
}
247+
}
248+
try {
249+
fs.writeFileSync(MMS_PATH, mmsEntries);
250+
}
251+
catch(error) {
252+
app.globalContext.error.push(`Could not write to ${MMS_PATH} file.`)
253+
}
254+
}
255+
} else {
256+
console.log("fillMmsFile# configuration file not found.");
257+
}
258+
}
259+
178260
const initEnv = () => {
179261
try {
180262
const { json, configErrors } = validateConfigFile();
@@ -212,6 +294,10 @@ const initEnv = () => {
212294
app.commandLine.appendSwitch('ppapi-flash-path', flashPath);
213295
app.commandLine.appendSwitch('ppapi-flash-version', '27.0.0.130');
214296
mainConsole.log(`Using flash path: ${flashPath}`);
297+
298+
if (!json.disableAutoFillMmsFile) {
299+
fillMmsFile();
300+
}
215301
} catch (ex) {
216302
app.globalContext.error = [];
217303
app.globalContext.error.push(startupError);

src/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ if (!gotTheLock) {
205205
*/
206206
const newTopWindow = () => {
207207
environment.mainConsole.log('loading top window...');
208+
const {config} = app.globalContext;
208209

209210
const win = new BrowserWindow({
210211
minWidth: 1024,
@@ -295,7 +296,6 @@ const newTopWindow = () => {
295296
win.on('page-title-updated', (ev, newTitle) => {
296297
ev.preventDefault();
297298
devToolsLog(`Change title: ${newTitle}`);
298-
const {config} = app.globalContext;
299299

300300
if (deeplinkingUrl) {
301301
let deepLinkEnvironment = config.environments.find(
@@ -314,6 +314,17 @@ const newTopWindow = () => {
314314
}
315315
});
316316

317+
// If saveDialogFilters configuration property is set, then the filters are passed to the
318+
// save dialog. This is a example of the configuration:
319+
// "saveDialogFilters": [{"name":"Excel", "extensions":["xlsx", "xls"]}]
320+
if (config && config.saveDialogFilters) {
321+
win.webContents.session.on('will-download', (event, item, webContents) => {
322+
item.setSaveDialogOptions({
323+
filters: config.saveDialogFilters
324+
});
325+
});
326+
}
327+
317328
return win;
318329
};
319330

0 commit comments

Comments
 (0)