<commit_before>var config = require('../config')

module.exports = function () {
  if (process.platform === 'win32') {
    registerProtocolHandlerWin32('magnet', 'URL:BitTorrent Magnet URL', config.APP_FILE_ICON + '.ico', process.execPath)
    registerFileHandlerWin32('.torrent', 'io.webtorrent.torrent', 'BitTorrent Document', config.APP_FILE_ICON + '.ico', process.execPath)
  }
  if (process.platform === 'linux') {
    installDesktopFile()
  }
}

function installDesktopFile () {
  var fs = require('fs')
  var path = require('path')
  var os = require('os')

  var templatePath = path.join(config.STATIC_PATH, 'webtorrent.desktop')
  var desktopFile = fs.readFileSync(templatePath, 'utf8')

  desktopFile = desktopFile.replace(/\$APP_NAME/g, config.APP_NAME)
  desktopFile = desktopFile.replace(/\$APP_PATH/g, path.dirname(process.execPath))
  desktopFile = desktopFile.replace(/\$EXEC_PATH/g, process.execPath)
<commit_msg>Only use 'app.asar.unpacked' path where it is needed<commit_after>module.exports = function () {
  if (process.platform === 'win32') {
    var path = require('path')
    var iconPath = path.join(process.resourcesPath, 'app.asar.unpacked', 'static', 'WebTorrentFile.ico')
    registerProtocolHandlerWin32('magnet', 'URL:BitTorrent Magnet URL', iconPath, process.execPath)
    registerFileHandlerWin32('.torrent', 'io.webtorrent.torrent', 'BitTorrent Document', iconPath, process.execPath)
  }
  if (process.platform === 'linux') {
    installDesktopFile()
  }
}

function installDesktopFile () {
  var config = require('../config')
  var fs = require('fs')
  var path = require('path')
  var os = require('os')

  var templatePath = path.join(config.STATIC_PATH, 'webtorrent.desktop')
  var desktopFile = fs.readFileSync(templatePath, 'utf8')

  desktopFile = desktopFile.replace(/\$APP_NAME/g, config.APP_NAME)
  desktopFile = desktopFile.replace(/\$APP_PATH/g, path.dirname(process.execPath))
  desktopFile = desktopFile.replace(/\$EXEC_PATH/g, process.execPath)

{'fraction_non_alphanumeric': 0.1514543630892678, 'fraction_numerical': 0.007021063189568706, 'mean_word_length': 5.027190332326284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5416925', 'n_tokens_mistral': 660, 'n_tokens_neox': 641, 'n_words': 122}