 
 findChromeFlashPath = ->
   # Refer to: https://helpx.adobe.com/flash-player/kb/flash-player-google-chrome.html
-  switch platform
+  switch PLATFORM
     when 'darwin'
       try
         # Usually there are 2 directories under the 'Versions' directory,

  true

getBuiltInFlashPath = ->
  builtInPath = join EXECROOT, innerPath if EXECROOT?
  builtInPath = join ROOT, innerPath if not validatePath builtInPath
  if validatePath builtInPath then builtInPath else null

reVerNum = /(\d+)\.(\d+)\.(\d+)\.(\d+)/

{app} = require 'electron'
{join} = require 'path-extra'
fs = require 'fs-extra'
{error} = require './utils'

PLATFORM = process.platform
FILENAME = switch PLATFORM
  when 'darwin' then 'PepperFlashPlayer.plugin'
  when 'linux'  then 'libpepflashplayer.so'
  when 'win32'  then 'pepflashplayer.dll'
INNER_PATH = join 'PepperFlash', PLATFORM, FILENAME

validatePath = (path) ->
  return false if typeof path isnt 'string' or not path.endsWith FILENAME
  try
    fs.accessSync path
  catch
